In This Chapter
Using threads to control animation
Creating a bouncing ball
Creating a whole room full of bouncing balls
Devising a simple Pong-like game
Because of its powerful drawing capabilities, Java lends itself especially well to creating game programs — especially games that are created as applets so they can be played over the Internet. Game programming is a huge subject, big enough for a whole shelf of books. In this chapter, I just scratch the surface of creating basic animations and playing simple games. Specifically, you find out how to get a ball bouncing in an applet, how to create a paddle to hit the ball, and how to find out when you miss.
In other words, welcome to the 1970s! You're going to create an applet that plays Pong!