Lab 03 Pong Game Lab Extra Credits

Due: 2:00pm on Wed (Feb 10)

Extra Credit #1: Up to 5 points
The "bounciness" of the ball determines how many points you get. Catching a bouncy ball gets you more points.
Hint: You may need to use Math.abs(). Look it up in Flash Help.


Extra Credit #2: Up to 7 points
Either one of the followings:

(1) Rotate the paddle upon a key press

How the Completed File May Work:
Rotate the paddle when you hold down the SPACEBAR. The paddle returns to the upright position when the SPACEBAR is not pressed.
(Note: Click inside the area first. Othewise, it won't respond to the key press.)

(2) Program a cheat

For example, lengthen the paddle upon a key press so that it will be "almost" impossible to miss the ball.

How the Completed File May Work:
Lengthen the paddle upon pressing the SHIFT key. The paddle returns to the original length when the SHIFT is not pressed.
(Note: Click inside the area first. Othewise, it won't respond to the key press.)

 

Extra Credit #3: Up to 20 points
Add code to make the game into a two-player game, working like the following specifications:

  • A second paddle on the right. This paddle is controlled by UP and DOWN arrow keys.
  • A second score textbox. One textbox keeps score for the player on the left, and the second textbox keeps score for the player on the right.
  • Whenever the ball goes off the edge, it will restarts at the center of the stage.
  • The second paddle should not go off the top and bottom edge.
  • Of course, the ball bounces off the second paddle too.