Game Development Reference
In-Depth Information
5.3 Health, lives, and score
Player health is one of the vital things needed in many games. The player usually starts
the game with full health represented most of times as numeric value of 100. As the
player goes through the game he gets attacked by enemies, which causes his health to drop.
Nevertheless, he can also pickup some objects that increases his health. If the health of the
player reaches zero, the player dies. After his death, however, it is possible to give the player
another chance by allowing him to have multiple lives. When the player loses all of his
lives, the game is over. In addition to health and lives, it is possible to have a score system
that makes the performance of the players comparable.
In this section, we are going to compile the three topics: health, lives, and score into a
complete game. In this game, the player controls a cube inside a closed room, which is
surrounded by cannons that shoot projectiles. The objective is to survive for the longest
possible time by moving and avoiding these projectiles. The player has a health of 100 and
three lives. Projectiles has two types: red projectiles that take 10 health points, and green
projectiles that take 5 health points. The good player performance results in longer survival
time, so it is a good idea to take the number of seconds the player survived as his score.
Illustration 83 shows a top view of the room we are going to use. The barrels you see are
the torrents (shooters), which are simply cylinders. It is important to rotate each shooter so
that the positive direction of its local y axis points towards inside the room.
Search WWH ::




Custom Search