SOFTWARE
.png)
PSEUDO CODE
Shooter Arena
After successful read of swipe sensor, system activates.
LCD display greets user and 10 seconds timer begins.
The DC motor will also get activated for the movement of the Turret which is controlled by Joystick.
Laser emitter will be activated.
On pressing the push button, Laser light will shoot.
.png)
PSEUDO CODE
Target Arena
System gets activated when the swipe reader reads swipe successfully.
On system activation, photo-resistor gets activated to receiver laser tag. Timer and score is displayed on the LCD display.
Microprocessor checks if the timer is less than sixty, if yes then it keeps the Laser receiver activated, else if the timer is zero it stops the Laser receiver and displays the score.
Arduino checks if the photo-resistor received a laser? If yes then it buzz buzzer, glows LED and update the score as well, if not it goes to step 3.
FINITE STATE MACHINE

FSM WORKFLOW
Idle:
When game turns on, it connects to the Arduino and runs the permanent setup code of components like swipe sensor, 7 segment display, LCD and buzzer. It greets user to play the game on LCD display. Once all the connections are made and verified successfully, it stays in idle condition until a card is swiped successfully.
Starting setup:
As soon as card is swiped, the code runs all of the transient setup code, like incrementing the count of number of swipes, displaying that on LCD display. Turn on both the stepper motor, joystick and Laser senor transmitter and receiver. Ten seconds timer begins and after timer is zero, buzzer is buzzed and continues into Run state.
Run:
This brings you in “Main” state of the game which will run for 60 seconds. In this state, player adjust the position of turret with help of joystick and at right position, player press the push button to shoot the Laser light.
The other Arduino at the Target arena get in Level 1 mode for first 20 seconds. In this level, photoresistors on static objects are turned on and on hit to the static obstacle, it increments the score by 1. Score is displayed on the LCD display. On 21st second, LED is blinked to notify player about start of level 2 for next 20 seconds. In this level, moving obstacle start moving in random direction and photo resistor on it is activated, while photoresistors on static objects are turned off and on hit to the moving obstacle, it increments the score by 3. Score is updated and displayed on the LCD display. On 41st second, LED is blinked to notify player about start of level 3 for next 20 seconds. In this level, moving obstacle speed increases and photo resistor on it as well as static obstacles are activated. On hit to the moving obstacle, it increments the score by 3 an static by 1. Score is updated and displayed on the LCD display.
End:
Game enters into the final state on 61st second, where moving obstacle, turret, laser transmitter and photo resistor stop working. The final score is displayed on the LCD for a brief moment, then the game would loop back into idle mode.