Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Worksheet 1.4 For this worksheet you are expected to work in small groups to complete the following programming tasks using C++ in Visual Studio. For

Worksheet 1.4 For this worksheet you are expected to work in small groups to complete the following programming tasks using C++ in Visual Studio. For each exercise you should create a new Visual Studio console project. Please ask your tutor to explain the activities in more detail if you are unsure what is expected. Task 1: Dungeon Crawl Game Your task is to develop a C++ class called DungeonCrawl which represents a simple grid-based game board (20 x 6 cells). Each grid cell contains an ASCII character to represent its content. A cell can contain a trap (T), treasure (X), player (@) or empty cell (.). A valid game board must contain a single player, a single treasure and the number of traps is a parameter of the game. An example game board is shown below: ...T................ .@..........T....... ......T............. ....T..........T.... ......T............. .........X......T... Your class definition should use a two-dimensional STL Vector to represent the game board. You will need to include several functions to implement the game itself: an initialiser function to randomly place all the required pieces on the board an output function to print the current game board to the console a collision detection function to check whether the player has either found the treasure or fallen into a trap a player movement function which adjusts the players position on the game board depending on which key the user presses: w move up s move down a move left d move right NOTE: the game board is toroidal, e.g. if a player steps off the left side of the board they appear at the same row on the right side of the board. Task 2: Oh No! There are loads of them This task involves adding moving enemies to the Dungeon Crawl Game. The number of enemies should be a parameter of the game. Enemies move around the game board at random (i.e. move one cell in any direction (up, down, left or right) once per turn). If a player touches an enemy (i.e. either of them attempt to occupy the same cell) then Game Over!. JOURnal Task 4 Your task is to build a working C++ Dungeon Crawl Game in Visual Studio. You may work in a small group or individually to complete this task. Your Journal entry should reflect on your experiences in completing this task. This will include a short explanation of what you did, any problems encountered and important discoveries, and a compressed copy of your project. Please include brief details of the other members of your group (if you choose to work in a group) in your Journal entry. NOTE: Please name your journal entry for this task as TASK 4.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

c. Will leaders rotate periodically?

Answered: 1 week ago

Question

b. Will there be one assigned leader?

Answered: 1 week ago