A Java Applet game

Chapter: A Java Applet game

Events happen when users do things like hitting keys on the keyboard or moving the mouse. In this lab we will see that objects can create events too. We will be using a Timer object to cause updates to occur in a JApplet at regular intervals.

I will lead you through the steps needed to create an applet like this:



Try to click on the mouse when it is visible. Each time you successfully do that you will gain a point. When you get to 10 points you will go to the next level. If you click when the mouse has changed to a devil you will lose 20 points. Your aim is to rise through as many levels as possible. You can restart a game by sliding the mouse out of the applet space.


Exercise 1

Play the game. All you have to do for this exercise is report to the grader what was the highest level you were able to ascend to.


rhyspj@gwu.edu