Sale!

CS211 – Programming Practicum Programming Project 7 Dungeon Crawler

$30.00 $18.00

Category: You will Instantly receive a download link for .zip solution file upon Payment || To Order Original Work Click Custom Order?

Description

5/5 - (2 votes)

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
a. Chest Class
b. Door Class
c. 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.
a. The generic tile is the floor that the player stands on. This role is not interactive aside
from the player’s ability to stand on it.
b. 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.
c. The chest tile is a tile that when found will contain a number. This number will be
added to the score.
d. There will be a defined number of doors.
e. Inheritance will be required to be used for these tiles, as the M*N matrix will only
be defined as a Tiles matrix
f. It will also have a data member for if the player is on that tile
CS211 – Programming Practicum Spring 2019
2. The Room will contain a N*M matrix of Tiles (This is a dynamic matrix similar to Project 3)
a. 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
i. The matrix will contain a number of doors that will be placed according to the input
file
ii. The Matrix will contain some number of chests as defined in the input file
3. 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 player’s current location in
the Dungeon (filename) and in the room (x,y coordinates).
a. The command F: used to find a path to a door using DFS
b. The WASD keys: used to send the player to a new tile adjacent to current tile.
c. The H key: used to remind the player of the commands and what characters represent which
tile types.
d. The G key: used to print the score
4. The Player Class will contain the following items
a. A value in which to store the amount of gold collected
b. The number of tiles visited
c. Current x,y location
Program Commands
You have to read the user’s 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).
CS211 – Programming Practicum Spring 2019
H Print a list of all available commands
G Print Player’s 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)
C X Y Point_Value (chests)
D X Y “filename.txt”(Doors see project 6)
E 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 dungeon’s exit.
Display/Output
A sample room CAN look like this (we are not binding you to these ascii characters, but please make
sure it’s 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
CS211 – Programming Practicum Spring 2019
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
Don’t 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.
Program Submission
You are to submit the files for this Project as a single zip file via the Assignments Page in
Blackboard
.
To help the TA, zip your files together and name your Zip file with your net-id and the assignment
name, like: net-idProj7.zip
Extra Credits
You can implement the following features for extra credit. The extra credit will be applied to your
overall project grade. So, if you have lost points in previous projects this is a great opportunity to
make up points.
Adding BFS feature (20 points)
Adding command B to find the nearest door using BFS algorithm. Breadth First Search is another
traversal algorithm that traverses a grid or a graph layerwise. Unlike the Depth First Search, BFS will
explore the neighboring tiles first and then moves to the next level of tiles.
Pretty output format (5 points)
If you have time try and make your display look nice I advise using special ascii characters for the
walls. There are more than are listed. But get creative with the look.
CS211
– Programming Practicum Spring 201
9
ALT 188:

ALT 186:

ALT 187:

ALT 201:

ALT 200: