In One Sentence
Game Screen 1
Game Screen 2
The old Pong Page is archived here.
Pong is a very simple game. It is based on the game ping-pong.
initialize game tool create all variables load all sprites load all images
Moving the Player
if key arrow_up is pressed move player up if key arrow_down is pressed move player down
Set up window and load images Initialize needed variables such as position of ball and players // Main loop While not escape pressed // Read keyboard if keyup pressed move yPlayer up if keydown pressed move yPlayer down // Move ball according to hspeed and vspeed // Move computer opponent if ball above opponent move opponent up if ball below opponent move opponent down // Draw graphics draw playfield draw ball draw player draw opponent if ball collide with player or opponent change ball horizontal direction if ball collide with borders change ball vertical direction if ball out of screen reset ball add point to player who touched ball last end loop
page revision: 12, last edited: 02 Jul 2012 01:54