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.


How Many Birds Can You Get? Explanations
There are 15 birds. The birds are flying around.
There are 5 spinstars. The spinstars are wandering around.
There is one pointer at the bottom.
There is one alien and one ball.
The pointer is controlled by the keyboard.
Object declaration, instantiation, and initial placement.
Declaration of controlled object.
When the right arrow is pressed, the pointer moves right.
When the left arrow is pressed, the pointer moves left.
When the spacebar is pressed, the pointer shoots up.
Conditional statement for describing how the pointer is controlled.
When a bird reaches a border, it wraps around.
When a spinstar reaches a border, it wraps around.
Conditional statements for describing border events.
When a bird is shot, it dies and the score increments.
When a spinstar is shot, it explodes and the score increments 5 points.
Conditional statements for describing collision.
The ball moves left and right.
When the ball reaches a border, it moves down 10 pixels.
When the ball hits the alien, the game is over.
Conditional statements for describing ball and collision with alien (also for time-control).
Map:
-----------------l
-
-----------------a-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
------p
Click the image to try it

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


Next Page

Samples Page