(You may need to click once on the application above to get your browser to recognize the applet)
The application functions as follows:
- Press one of the number keys 0-9 to activate a saucer
- All saucers are initially placed at random locations within the display window (be careful to keep them inside the window)
- You must create a HoverSaucer class, instantiate HoverSaucer objects, and call HoverSaucer methods from the main program
- Keyboard event handling should occur in the main program; translation, rotation, scaling, animation, etc. should occur in the class
- Note that only two global variables are required in the main program: an array to hold the HoverSaucers, and an int to remember which saucer is active. Any other animation globals belong inside the class
- -- The instructions below mirror the requirements from Lab 09
- UP arrow makes saucer go up
- LEFT arrow makes saucer go left
- RIGHT arrow makes saucer go right
- The saucer cannot leave the bounds of the display window in any direction
- Gravity is always pulling the saucer down. Only UP arrow can make it ascend
- The saucer will continue being pulled down by gravity even if LEFT or RIGHT arrow keys are held down
- When ascending, the saucer's propellers should spin fast clockwise
- When descending, the saucer's propellers should slowly spin counter clockwise
- The propellers should not spin at all when the craft is on the ground
- All objects should be created with their center at (0,0) and then translated to where they belong