Simple Dodge and Aim | Explanations |
There are ten aliens near the top. There is 1 pointer near the bottom. | Object declaration, instantiation, and initial placement. |
The player controls the pointer with the mouse. | Declaration of controlled object. |
When spacebar is pressed, the pointer shoots up. | Conditional statement for describing how the pointer shoots. |
When an alien is shot, it blows up. | Conditional statement for describing what happens when an alien is shot. |
When the pointer reaches a border, the pointer blows up. | Conditional statement for describing border event. |
When the pointer collides with an alien, it blows up. | Conditional statement for describing collision between the pointer and an alien. |
When the pointer is gone, the game is over. When all the aliens are gone, you win. |
Conditional statements for describing game over. |
Map: |
Click the image to try it |
Extended Dodge and Aim | Explanations |
There are ten aliens near the top. There is 1 pointer near the bottom. | Object declaration, instantiation, and initial placement. |
The player controls the pointer with the mouse. | Declaration of controlled object. |
The aliens wander around. | Unconditional statement for describing how the alien moves. |
When an alien reaches a border, it reverses direction. | Conditional statement for describing collision of alien and a border. |
When spacebar is pressed, the pointer shoots up. | Conditional statement for describing how the pointer shoots. |
When an alien is shot, it blows up. | Conditional statement for describing what happens when an alien is shot. |
When the pointer reaches a border, the pointer blows up. | Conditional statement for describing border event. |
When the pointer collides with an alien, it blows up. | Conditional statement for describing collision between the pointer and an alien. |
When the pointer is gone, the game is over. When all the aliens are gone, you win. |
Conditional statements for describing game over. |
Map: |
Click the image to try it |
Extended Dodge and Aim with Chase | Explanations |
There are ten aliens near the top. There is 1 pointer near the bottom. | Object declaration, instantiation, and initial placement. |
The player controls the pointer with the mouse. | Declaration of controlled object. |
The aliens chase the pointer at 3 pixels per frame. | Unconditional statement for describing how fast the alien moves. |
When two aliens collide, they both reverse direction. | Conditional statement for describing collision of two aliens. |
When an alien reaches a border, it reverses direction. | Conditional statement for describing collision of alien and a border. |
When spacebar is pressed, the pointer shoots up. | Conditional statement for describing how the pointer shoots. |
When an alien is shot, it blows up. | Conditional statement for describing what happens when an alien is shot. |
When the pointer reaches a border, the pointer blows up. | Conditional statement for describing border event. |
When the pointer collides with an alien, it blows up. | Conditional statement for describing collision between the pointer and an alien. |
When the pointer is gone, the game is over. When all the aliens are gone, you win. |
Conditional statements for describing game over. |
Map: |
Click the image to try it |