Welcome to Computer Programming

 

HWJ9 Key Listener

 

All students must do all 5.

Starter

 

Create a program called HWJ9_Keys

that will

1. Move a square around the board using the arrows.

2. Add the power that if the person TYPES the 1-5 it will adjust the speed of the square.(1slow 5 fastest, )[so int speed should be a global variable]

3. Screen wrap (if it goes off the left screen, it will reappear on the right side

4. If they type b,r,g it will change the square to blue, red or green.

5. Have if they hit the space bar, it becomes invisible, when they hit space again it appears again.

 

 

Advanced People: (do 1 or 2 depending on ability)

 

5. If they press c it turns in to a circle, if they press s it turns in to a square.

 

Use timer and have 3 large asteroids of random size drop from the top of the screen. The user needs to avoid hitting them. After they are off the screen, new ones will appear.