(This is part 3 of the Pong tutorial series. Please read Part 1 and Part 2 if you haven’t done so already.)
Step Three: Program the Player-controlled Paddle
We got the ball to move and bounce off of the walls in our last tutorial. Now it’s time to program the player-controlled paddle. What does the playerPaddle need to do?
- Set it’s y-position to the y-position of the mouse
- Stay within the boundaries of the screen
- Block the ball from passing through it
This will be a pretty simple tutorial section.
