- 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 ...
Comments
Get Mastering Unity 2017 Game Development with C# - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.