You will be a creating a “treasure hunt” game where a player explores avirtual map looking for treasure.

1.

[200 pts]

You will be a creating a “treasure hunt” game where a player explores a

virtual map looking for treasure. This will be a text based game, so the terminal will

be utilized for describing the player’s surrounding and exploration options. This will

be a randomly generated game, where each play will have a random map/world for

the player to explore. The goal of the game is for the player to find the hidden ruins

and discover the treasure before running out of energy.

The core of this game is exploring a map with different types of “Lands”. There will be

four different kinds of lands to explore, such as forests, deserts, orchards, lakes, and

ruins. The player will have a set x,y position within the map, and each turn will be

given the option to explore north, south, east, or west.

To start with a map of a certain dimension will be constructed (default dimension

is

10

×

10

). Player will be placed in the middle of map (default is at

5

×

5

) with en-

ergy level set to 5 . The user will be provided with the description on what is seen in

NORTH, SOUTH, EAST, and WEST direction. The sample descriptions are as follows:

You see ,

a tropical dense forest to the north ,

an orchard filled with apples to the south ,

a water body to quench your thirst to the west ,

an arid hot desert to the east.

Then the user will make a choice on which direction to move. Depending on the move

the user will either increase the energy or decrease the energy and an outcome will

be described. The energy level and description are as follows:

Land

Outcome

Energy Level

Desert

You walk through the hot and dry desert Decrements by 2

Forest

You trek through the dense forest

Decrements by 1

Orchard

You eat an apple in the orchard

Increment by 2

Lake

You are hydrated

Increment by 1

After each turn, a banner is displayed which details the current energy level of the

user. The game ends when the user runs out of the energy or finds the treasure.

2



2.

Implementation

To implement you will use the following files:

•

Player

:

Player.h

consists of the definition of the Player class and the implemen-

tation is done in

Player.cpp

•

Land

:

Land.h

consists of an Abstract class (pure virtual function) and Derived

class for Desert, Forest, Orchard, Lake, and Ruins.

•

gameEngine.cpp

: Creates the map using a random number generator, and con-

trols the game through a Player object

•

treasure

:

treasure.h

is the game header which includes all the necessary header.

treasure.cpp

creates the Player object and calls the

gameEngine

function

Description:

• Player class will contain (minimal)

–

the current x and y position, energy level, treasure found or not. Write acces-

sors and mutators to access these data members

–

the map dimension. This should be a static private member and add a public

static function to access the data

–

the player movement function. These function (one for each direction North,

South, East, South) will increment or decrement depending on player move-

ment. Make sure to check the boundaries else will result in segmentation

fault

• Land class will contain

–

An abstract class with two pure virtual function. One for the description and

the other for player visit

–

derived classes (derived form Land) for Forest, Orchard, Desert, Lake, and

Ruins. In each derived class the description and player visit function is re-

defined. The player visit function requires Player object to increment and

decrement the energy level

• GameEngine will contain

–

a two dimensional map of all the Land. Use the upcasting technique to create

a variable (Remember Land is an Abstract class you CANNOT have a valued

object of Land)

–

map is defined using random variable generator. (Use

random

library and

NOT time rand() function)

–

a loop for game runtime which displays the description, gets the user input,

and displays the outcome until the energy is exhausted, or user finds the

treasure, or user press Q (Q for QUIT)

3



3 Deliverable

There is no demo for this lab. Instead you turn in the following:

1. Upload all the cpp and h file (do not upload the makefile)

2. Take a screenshot of your output showing at least two turns and upload it to Canvas

(in PNG


Get Help With a similar task to - You will be a creating a “treasure hunt” game where a player explores avirtual map looking for treasure.

Login to view and/or buy answers.. or post an answer

Related Questions

Similar orders to You will be a creating a “treasure hunt” game where a player explores avirtual map looking for treasure.
30
Views
0
Answers
Advance topics in machine learning (Kernels) 2 questions.
Any 2/3 Questions need answering on Advance topics in machine learning (Kernels). relevant notes can be shared upon request....
16
Views
0
Answers
Using R programming to perform functions and do work.
The expectations are to use R programming to answer the questions attached the file, and the result is also to be a .r file....
13
Views
0
Answers
write up a report using c programming.
Using the knowledge acquired from this module write a descriptive report to solve the programming problems listed below. The word count limit is 500 words You must include the full code implementation as appendix! I recommend you use Courier New size 1...
16
Views
0
Answers
Analyse requirements and select appropriate solutions. Design programmes that use appropriate data structures
The assignment requires you to select and implement appropriate data structures, design and implement algorithms and create the relevant software applications that will allow a user to store, update and manipulate the data relating to the operations of an...