The game works as follows : The player is represented by the earth. Move the mouse around and the earth follows. The player starts with a health of 5. If the player hits a "heart", their health increases by 1. If they are hit by (or hit) a dinosaur, their health decreases by 3. But, the earth can be put into dinosaur "killing mode" (red earth) by pressing the x-key. However, the killing mode only lasts a few seconds, and then can't be turned on again for a few more seconds. In this mode, if the earth hits a dinosaur, it gains 2 health. Dinosaurs are generated every 2 to 4 seconds. They bounce around the screen, and die after a while. They kill the hearts too. Hearts are generated every 10 to 20 seconds in a fixed position. They die after a while, are killed by dinosaurs, and increase earth health, if touched by earth. Note: When dinosaurs are touched by earth or heart, the dinosaur clone is deleted. As is the heart clone, if touched.
This was a tutorial project developed by tutor David Harper to explain how much more efficient the code is if you use clones.