ATARI.PONG

GOAL: build a 2 person Pong computer game
SYNPOSIS: Individual project | Winter 2018 | Python
KEY SKILLS: Animation | Responding to keyboard input | Objects reacting to their environment
VIDEO OF PROGRAM IN ACTION

A, Z are user 1’s controls. M, K for user 2. R starts a new game.

Key Process:

  1. Created the virtual environment by creating shapes for the paddles and ball. Gave each shape an initial location
  2. When key ‘A’ is pressed, decreased the left paddle’s location by a set paddle velocity. Similarly, changed the respective paddle position for ‘Z’ ‘M’ and ‘K’
  3. Set paddle boundries so the shape never goes off the screen.
  4. Constantly added a ball velocity value to the ball’s x & y location
  5. If the ball hits the screen’s top/bottom or a paddle, flip the ball's direction by adding a negative sign to the ball velocity
  6. If the ball hits the screen’s edge on the right/left side, stop accepting user input and print Game Over
  7. When ‘R’ is pressed, reset the location of all shapes to their initial location. Force quit program when ‘Q’ is pressed