Sample Video Games

You can experiment, modify, and learn from the following sample games. Remember that there is a tutorials page to learn the basics.


Smart Goalie Explanations
There is one fast alien, one pointer, and one ball.
You control the pointer with the mouse.
Object declaration, instantiation, and initial placement.
Declaration of controlled object.
When the mouse moves, the horizontal position of the pointer is determined. Conditional statement for describing how the pointer is controlled.
The alien falls down.
The alien chases the ball.
When the alien hits a wall, it bounces.
Statements for describing the alien's behavior.
The spinstar starts moving down.
When spinstar reaches the bottom border, it wraps around.
Statements for describing the spinstars' behavior.
The ball starts out moving randomly at 5 pixels per frame.
When the ball collides with the wall, the ball bounces.
When the ball collides with the pointer, the ball reverses direction.
When the ball collides with the alien, it reverses direction.
When the ball reaches a border, it bounces.
Statements for describing collision.
When the ball reaches the bottom border, you win.
When the ball reaches the top border, you lose.
Conditional statements for describing gameover.
Map:
ww--------p-------ww
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
ww--------a-------ww
Click the image to try it

Can you add a few more obstacle objects to make the game more challenging?


Next Page

Samples Page