• The Die function starts by incrementing the player score by the ScorePoints variable. This is an integer property and represents the number of points achieved for killing the enemy.
  • The game then determines whether a bonus should be unlocked, because a new record has been set by typing the full word (total number of letters) in the fastest time.
  • In addition, the ActiveEnemies field is a static integer property. Being static, it is, in effect, shared across all instances. It represents the total number of active enemies in the level, that is, the total number of enemies who are either searching, chasing, or attacking the player right now and, thus, who can be dispatched through typing combat.
  • As the enemy is destroyed, the ActiveEnemies ...

Get Mastering Unity 2017 Game Development with C# - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.