[Solved] CS211 Project7-Dungeon Crawler

$25

File Name: CS211_Project7-Dungeon_Crawler.zip
File Size: 282.6 KB

SKU: [Solved] CS211 Project7-Dungeon Crawler Category: Tag:
5/5 - (1 vote)

In this project you will be creating a dungeon crawler game. In this program you will have a player character that will move from room to room in the dungeon collecting chests and accumulating gold. The objective is to have the character accumulate the maximum amount of gold and exit the dungeon. Once you exit a room you cannot return to said room.

Controls

You will have a character that moves using the w,a,s, and d keys. You will go through the dungeon collecting chests until you reach an exit or hit the q button to quit the game.

Class Break Down

For this assignment you will be writing a C++ Program that will contain the following classes:

  1. Tile Class
    1. Chest Class
    2. Door Class
    3. Wall Class
  2. Room Class
  3. Player Class

For the purposes of this assignment the classes and interfaces are defined below, along with the basic interactions.

  1. The Tile Class is a class that contains abstract methods, the purpose of this class is to create a common access class that the player can interact with, without knowing whether they are dealing with a Wall, a Tile, a Chest or a Door. The tile itself will be the parent.
  1. The generic tile is the floor that the player stands on. This role is not interactive aside from the players ability to stand on it.
  2. The wall tile is a barrier, when the player reaches the edge of the M*N matrix (rows 0 and M, columns 0 and N) the player will be placed back on the tile from the previous move.
  3. The chest tile is a tile that when found will contain a number. This number will be added to the score.
  4. There will be a defined number of doors.
  5. Inheritance will be required to be used for these tiles, as the M*N matrix will only be defined as a Tiles matrix
  6. It will also have a data member for if the player is on that tile
  1. The Room will contain a N*M matrix of Tiles (This is a dynamic matrix similar to Project 3)
  1. The N*M matrix will have its size determined by the input file and have a border added to it (1 space wide, see earlier maze project) b. This class will contain N*M Matrix of Tiles
  1. The matrix will contain a number of doors that will be placed according to the input

file

  1. The Matrix will contain some number of chests as defined in the input file
  1. The User interface will process the commands given by the User and will interact with the rooms, determining what actions will be taken and keeping track of the players current location in the Dungeon (filename) and in the room (x,y coordinates).
  1. The command F: used to find a path to a door using DFS
  2. The WASD keys: used to send the player to a new tile adjacent to current tile.
  3. The H key: used to remind the player of the commands and what characters represent which tile types.
  4. The G key: used to print the score
  1. The Player Class will contain the following items
  1. A value in which to store the amount of gold collected
  2. The number of tiles visited
  3. Current x,y location

Program Commands

You have to read the users input keys and execute proper actions. Project 6 should help you set up the process of reading user input from standard input.

Q Exit the program
W Your Player will move to the neighboring tile above. If the current position is (x , y) after reading W key input, you should move the player to neighboring tile at position (x, y-1).
A Your Player will move to the neighboring left tile. If the current position is (x , y) after reading A key input, you should move the player to neighboring tile at position (x-1, y).
S Your Player will move to the neighboring tile below. If the current position is (x , y) after reading S key input, you should move the player to neighboring tile at position (x, y+1).
D Your Player will move to the neighboring right tile. If the current position is (x , y) after reading D key input, you should move the player to neighboring tile at position (x+1, y).
H Print a list of all available commands
G Print Players score
F Find a path to a door using DFS and print the path
B (Optional) Find the Shortest path to the nearest door using BFS and print the path

Program Input (your maze project will be helpful)

Your input file will be formatted in the following format:

X Y (size X by Y)

S X Y (Start location of person)

O X Y (List of obstacles)

  • X Y Point_Value (chests)
  • X Y filename.txt(Doors see project 6)
  • X Y (Dungeon Exit, will only be in 1 file)

You will be required to write a .txt which contains your own custom room design. It will be called Room5.txt This room will also contain your dungeons exit.

Display/Output

A sample room CAN look like this (we are not binding you to these ascii characters, but please make sure its obvious what everything is:

********************

*P *

***************** *

  • *
  • ****************
  • * *
  • C * * D *

********************

At the end of the game you will print out the number of gold coins collected.

Multiple Source Code Files

Your program is to be written using at least two source code files. One of the source file files is to contain the main function of the program named in a file using your net-id and Program name, like:

net-idProj7.cpp

You must have at least one file for each of the classes listed above and 1 for the file that will contain your main.

You will also be required to create your own text file for a room. This should be called Room5.txt

The above implies that you will need to write any appropriate .h file(s) and a makefile.

Coding Style

Dont forget to use good coding style when writing your program. Good coding style makes your program easier to be read by other people as the compiler ignores these parts/differences in your code.

Elements of good code style include (but may not be limited to):

  • Meaningful variable names
  • Use of functions/methods
  • Proper indentation
  • Use of blank lines between code sections
  • In-line comments
  • Function/method header comments
  • File header comments

The Code Review Checklist also hints at other elements of good coding style.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] CS211 Project7-Dungeon Crawler
$25