Java Reference
In-Depth Information
Figure 2-11. The initial state of the ZenPong game
Try out the game by following the instructions in the upcoming exercise, remembering that you control both
paddles (unless you can get a colleague to share your keyboard and play).
eXaMINING the BehaVIOr OF the ZeNpONG GaMe
When the program starts, its appearance should be similar to the screenshot in figure 2-11 . to fully examine its
behavior, perform the following steps.
1.
Before clicking start, drag each of the paddles vertically to other positions. One game cheat
is to drag the left paddle up and the right paddle down, which will put them in good positions
to respond to the ball after being served.
2.
practice using the a key to move the left paddle up, the Z key to move the left paddle down,
the L key to move the right paddle up, and the comma (,) key to move the right paddle down.
3.
Click start to begin playing the game. notice that the start button disappears and the ball
begins moving at a 45° angle, bouncing off paddles and the top and bottom walls. the screen
should look similar to figure 2-12 .
 
Search WWH ::




Custom Search