Pong is a two-dimensional sports game that simulates table tennis. The player controls an in-game paddle by moving it vertically across the left or right side of the screen. They can compete against another player controlling a second paddle on the opposing side.
Modules: turtle, time font : Retro Gaming
Steps:
-
Create the screen
- screen size : 800X600
- bg color: black
- used listen and onkey methods
-
Create and move a paddle
- Paddle class
- make it move along y-axis like up and down
-
Create another paddle
-
Create the ball and make it move constantly across the screen
- Ball class and make it move
- add bounce logic
-
Detect when the ball collides with wall and make it bounce back
-
Detect when there's a collision with the paddle to know when to bounce it back
- reset position of the ball when a paddle misses hitting
- make it move opp side of the paddle that missed
-
Count the score when the ball misses the paddle
- Divide scoreboard for right paddle and left side
- Update scoreboard with clear method
-
Create the separator line in between left paddle and right paddle