Interactivity
- cbelizaire76
- Dec 21, 2021
- 1 min read
For this assignment, I decided to create a pong game to build off of what we learned from the bouncing ball code. It was a challenge at first to get the ball to bounce from different directions. The game is very simple yet fun, there is no way to win or lose the game.You play by using the mouse to move the paddle up and down. As the ball comes to the other side you use the paddle to deflect it. The same way you would in a normal ping pong game. There is a line separating the two sides, to make the game seem more realistic as if there were two players. I also added a title using the text "PONG GAME". I used two rectangles for the paddle. The dx and dy represent the speed of the ball, these variables can be manipulated to make the ball move faster.The left paddle moves up and down at a constant speed. While the other paddle, which you use to play with is free to hit the ball in whichever direction the player chooses.


Comments