Star-Dodging Bird | Explanations |
There are 8 spinstars. There is 1 bird at the bottom. The bird is controlled by the keyboard. There is 1 ball. |
Object declaration, instantiation, and initial placement. Declaration of controlled object. |
When an arrow is pressed, the bird moves in the same direction. | Conditional statement for describing how to control the bird. |
The ball wanders around. The spinstars move east at 2 pixels per frame. |
Unconditional statement for describing how the ball and spinstars move. |
When the ball meets a border, it reverses direction. When a spinstar meets the border, it wraps around. |
Conditional statements for describing border events. |
When a bird collides with a spinstar, the bird explodes and the game is over. When the bird collides with the ball, you win. |
Conditional statements for collision and game control. |
Map: |
Click the image to try it |
Varying-speed Star-Dodging Bird | Explanations |
There are 8 spinstars. There is 1 bird at the bottom. The bird is controlled by the keyboard. There is 1 ball. |
Object declaration, instantiation, and initial placement. Declaration of controlled object. |
When an arrow is pressed, the bird moves in the same direction. | Conditional statement for describing how to control the bird. |
The ball wanders around. When a spinstar sees the bird, it moves east at 3 pixels per frame. Otherwise, it moves east at 2 pixels per frame. |
Statements for describing how the ball and spinstars move. |
When the ball meets a border, it reverses direction. When a spinstar meets the border, it wraps around. |
Conditional statements for describing border events. |
When a bird collides with a spinstar, the bird explodes and the game is over. When the bird collides with the ball, you win. |
Conditional statements for collision and game control. |
Map: |
Click the image to try it |