Due Date: Tue 13 Dec (firm!)
An understanding of
- thread-based concurrency
- shared state and locking
In this final stage of the project, you will add autonomous monsters to the game. These roam around the terrain and kill the player if they manage to track him/her down. Specific behaviors and enhancements are as follows:
- The monsters have limited view. As long as they are more than one cell away from the player, they move around randomly with a delay within a configurable range. Once a monster enters a neighboring cell of the player's current location, two things happen:
- The player is warned of the monster's presence.
- The monster becomes aware of the player and will make its next move to the player's current cell.
- Once the monster enters the player's current cell, there will be another delay within a separately configurable range after which the monster kills the player. During this period, the player can either move somewhere else or defend himself/herself against the monster (see next bullet).
- Certain kinds of carriable armor protect the player passively against monsters, that is, without requiring the player to engage the armor. These kinds of armor are heavy and reduce the remaining load the player can carry.
- Certain kinds of carriable weapons allow the player to protect himself/herself actively against monsters, that is, by engaging the weapon before getting killed.
- Try to adhere to these C# coding guidelines.
- More importantly, continue to follow test-driven development (TDD) by creating automated unit tests for your various program components.
- Reuse suitable .NET library components whenever possible instead of building your own.
- Use design principles and patterns where appropriate.
- The autonomous monsters are responsible for their behaviors and state as described above.
- Your code must be thread-safe. This means shared state, especially the terrain, must be protected from concurrent modification. Use the basic synchronization mechanisms to achieve this.
One point for each of these capabilities:
- monster moves around
- monster kills player in same cell after warning and delay
- player passive protection
- player active protection
- coding quality and style