Shooting Star | Explanations |
There is 1 spinstar in the middle. There are 8 aliens. The spinstar is controlled by the keyboard. |
Object declaration, instantiation, and initial placement. Declaration of controlled object. |
When w is pressed, the spinstar shoots up. When s is pressed, the spinstar shoots down. When a is pressed, the spinstar shoots left. When d is pressed, the spinstar shoots right. When an arrow key is pressed, the spinstar moves in the same direction. |
Conditional statement for describing how the spinstar is controlled. |
The aliens wander. When an alien reaches a border, it reverses direction. When an alien that is not white is shot, it turns white. When a white alien is shot, the alien explodes. |
Statements for describing alien's behvior. |
When all the aliens are gone, you win. If an alien hits the spinstar, you lose. |
Conditional statements for describing gameover. |
Map: |
Click the image to try it |
Can you add a few more obstacle objects to make the game more challenging?