Sample Beginner Video Games

Below is a number of sample beginner games, that you can use to try, modify, and learn. Remember that there is a tutorials page to learn the basics.


Rabbit Searching for Carrots Explanations
There are 10 carrots and 1 rabbit. Object declaration and instantiation.
The rabbit looks for the carrots. Unconditional statement for how the rabbit acts / moves.
When the rabbit catches a carrot, the carrot is eaten. Conditional statement for describing the collision event between rabbit and carrot.
When all carrots are eaten, the game is over. Conditional statement for describing gameover.
Map:
Click the image to try it

You might want to change the number of carrots, the characters, and see what happens!



Controlled Rabbit Searching for Carrots Explanations
There are 10 carrots spread near the top and 1 rabbit. Object declaration and instantiation.
Initial positioning of carrots is performed.
The player controls the rabbit with the keyboard. Declaration of controlled object.
When up is pressed, the rabbit moves up.
When left is pressed, the rabbit moves left.
When left is pressed, the rabbit moves left.
When down is pressed, the rabbit moves down.
Conditional statements for describing how the rabbit is controlled.
When the rabbit catches a carrot, the carrot is eaten. Conditional statement for describing the collision event between rabbit and carrot.
When all carrots are eaten, you win. Conditional statement for describing gameover.
Map:
Click the image to try it

You might want to change the number of carrots, the characters, and see what happens!



Controlled Rabbit Searching for Moving Carrots Explanations
There are 10 carrots and 1 rabbit. Object declaration and instantiation.
A map is also used to initialize the positions.
The player controls the rabbit with the keyboard. Declaration of controlled object.
When up is pressed, the rabbit moves up.
When left is pressed, the rabbit moves left.
When left is pressed, the rabbit moves left.
When down is pressed, the rabbit moves down.
Conditional statements for describing how the rabbit is controlled.
The carrots move around. Unconditional statement for how the carrots move.
When a carrot reaches a border, it reverses direction. Conditional statement for describing how the carrots move when hitting a border.
When the rabbit catches a carrot, the carrot is eaten. Conditional statement for describing the collision event between rabbit and carrot.
When all carrots are eaten, you win. Conditional statement for describing gameover.
Map:
--
--
-c-----c----
-----c----
---c---------c
-c-----c----
-----c----
---c---------c
Click the image to try it

You might want to change the number of carrots, the characters, and see what happens!


Next Page

Samples Page