NEON Air Hockey Game

by Vertex5 in Circuits > Software

370 Views, 5 Favorites, 0 Comments

NEON Air Hockey Game

Screenshot 2021-01-11 at 6.33.39 PM.png

Objectives.:

1: Try to protect your goal from the enemies' ball.

2: You have to attempt to bounce the ball into the other goal without your opponent blocking your ball.

3: Move the green rectangle cursor to prevent the ball from going into your goal as it bounces vertically across the rink.

4. Try to score more points then your opponent

How the Ball Moves

Screenshot 2021-01-11 at 5.32.52 PM.png

Code 1. The ball moves in the direction of 45 `degrees an if it hits the wall it bounces

Code 2. The second code starts when you hit the flag. Then if the ball hits the green paddle it will bounce off of it and start moving to the blue net. Also if it hits the wall it will bounce off of it.

Code 3. The third code is the same as the second code but it will go in the direction of the green net not its own net.

How the Blue Paddle Works

Screenshot 2021-01-11 at 5.42.44 PM.png

How it works: This starts when the flag is clicked. All it does is if the left arrow key is pressed it changes the paddles x coordinate by -10. Also if you hit the right arrow it will change the paddles x coordinate by

How the Green Paddel Works

Screenshot 2021-01-11 at 5.45.24 PM.png

How it works: The code starts when the green flag is clicked. Firstly, when the a key is pressed the green paddles x coordinate changes by -10. When the d key is pressed the greens paddles x coordinate changes by 10.

Scoring Player One/ GREEN

Screenshot 2021-01-11 at 6.05.16 PM.png

1.When the green flag is pressed, the player one’s score gets set to 0.

2. The code gets started when the green flag is clicked. Then forever if the green block is touching the ball it gives player two, one point. Then it waits one second so player two doesn’t get multiple points.

Scoring Player Two/ BLUE

Screenshot 2021-01-11 at 6.06.52 PM.png

1.When the flag is clicked it waits 60 seconds then it stops the game completely.

2.When the green flag is pressed, the player two’s score gets set to 0.

3.The code gets started when the green flag is clicked. Then forever if the blue block is touching the ball it gives player one, one point. Then it waits one second so player one doesn’t get multiple points.