Project 2c

Due Date: Thu 6 Dec

Group Project

Please see here.

Objectives

An understanding of
  • object-oriented modeling and design
  • SOLID and other design principles
  • basic design patterns and their implementation in C#
    • strategy
    • observer
    • decorator
    • singleton
    • iterator
  • graph representation and algorithms

Description

This project builds on your earlier work by adding some enhancements to the game.

Concretely, the game starts with the player at the designated starting location (the proverbial "square one"). The human user directs the player using the available commands detailed below. Initially, the player carries no items and has a configurable energy level. With each move the player makes, his or her energy level decreases by a configurable amount. When the player eats food, his or her energy level goes back up an amount that corresponds to the food item consumed. Certain locations contain items such as weapons, armor, food, and coins. The player can pick up items up to a configurable maximum. 

The object of the game is to reach a designated exit and pick up as many coins as possible in the process. The player has a configurable number of lives. If the player gets stuck in a dead end, such as a dungeon, or runs out of energy, he or she starves.

Player Configuration

As mentioned above, the following settings are configurable in a central place:
  • player's initial number of lives
  • player's initial energy level
  • max items a player can carry
  • rate at which a player runs out of energy as he/she moves

Terrain Configuration/Items in Locations

The terrain includes several designated exits.

In addition, some of the following items can be found in certain locations (determined by the terrain designer):
  • (passive) armor
  • (active) weapons such as knives
  • food
  • coins

Autonomous Monsters

In this 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.

Nonfunctional Requirements

  • Try to adhere to the usual coding guidelines.
  • Continue to follow test-driven development (TDD) by creating automated unit tests for your various program components.
  • 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. We will discuss this topic in class.

Grading

Total 10:
  • 0.5 managed player attribute: lives
  • 1 managed player attribute: energy, rate of decrease
  • 1 player attribute: max items, ability to carry
  • 1 central configuration
  • 0.5 items: passive armor
  • 0.5 items: active weapons
  • 0.5 items: food
  • 0.5 items: coin
  • 1.5 UI for picking up, using, and dropping items
  • 2 monsters
  • 1 playability/user experience (subjective)

Submission

Maintain your work in your existing project2 repository and notify the instructor and TA when your work is ready to be graded.
Comments