Question: For this assignment you will be creating a simple text-based adventure game. Each room in the adventure should be represented by its own function. (A

 For this assignment you will be creating a simple text-based adventuregame. Each "room" in the adventure should be represented by its own

For this assignment you will be creating a simple text-based adventure game. Each "room" in the adventure should be represented by its own function. (A "room" just represents a particular area, not necessarily a literal room.) If you have never seen or played a text-based adventure game, an article about an early game can be found here: ADVENT
Requirements:
Each "room" should have its own number in the code. This is so that the code can refer to each room by a unique number. Each room function should print some text describing the room and have some options for where the player can go next. You may also include some options for what the player can do in that room. Your game should have at least four rooms.
Each "room" function should return an integer value representing the room the player is in or moving to. For example, if the player is in room 3 and chooses to go north, which takes them to room 6, the function for room 3 should return a 6 indicating the number of the new room the player is moving into. If the player doesn't move from a room, the room function should return its own number.
The main() function should have a switch statement that selects which room function to call next.
At least two of the "room" functions should include a static variable that keeps track of whether that particular room has been entered before. Your program must do something different the first time the room is entered. For example, the first time (and only the first time) that the room is entered, the player should get an object.
There should be at least one "score" variable, such as the amount of gold collected, the number of butterflies rescued, the number of clues found, the number of lives lost, the amount of health remaining, etc. This variable should change as the player moves between rooms. There should be a separate function that prints the value of the variable for the player. That is, it should print something like:
Oxygen Remaining: 120
for any room the character enters.
Variables of this sort should probably be "global", meaning that all functions in the program can access them.

For this assignment you will be creating a simple text-based adventure game. Each "room" in the adventure should be represented by its own function. (A "room" just represents a particular area, not necessarily a literal room.) If you have never seen or played a text-based adventure game, an article about an early game can be found here: ADVENT Requirements: . Each "room" should have its own number in the code. This is so that the code can refer to each room by a unique number. Each room function should print some text describing the room and have some options for where the player can go next. You may also include some options for what the player can do in that room. Your game should have at least four rooms. Each "room" function should return an integer value representing the room the player is in or moving to. For example, if the player is in room 3 and chooses to go north, which takes them to room 6, the function for room 3 should return a 6 indicating the number of the new room the player is moving into. If the player doesn't move from a room, the room function should return its own number. The main() function should have a switch statement that selects which room function to call next. At least two of the "room" functions should include a static variable that keeps track of whether that particular room has been entered before. Your program must do something different the first time the room is entered. For example, the first time (and only the first time) that the room is entered, the player should get an object. There should be at least one "score" variable, such as the amount of gold collected, the number of butterflies rescued, the number of clues found, the number of lives lost, the amount of health remaining, etc. This variable should change as the player moves between rooms. There should be a separate function that prints the value of the variable for the player. That is, it should print something like: Oxygen Remaining: 120 for any room the character enters. Variables of this sort should probably be "global", meaning that all functions in the program can access them. For this assignment you will be creating a simple text-based adventure game. Each "room" in the adventure should be represented by its own function. (A "room" just represents a particular area, not necessarily a literal room.) If you have never seen or played a text-based adventure game, an article about an early game can be found here: ADVENT Requirements: . Each "room" should have its own number in the code. This is so that the code can refer to each room by a unique number. Each room function should print some text describing the room and have some options for where the player can go next. You may also include some options for what the player can do in that room. Your game should have at least four rooms. Each "room" function should return an integer value representing the room the player is in or moving to. For example, if the player is in room 3 and chooses to go north, which takes them to room 6, the function for room 3 should return a 6 indicating the number of the new room the player is moving into. If the player doesn't move from a room, the room function should return its own number. The main() function should have a switch statement that selects which room function to call next. At least two of the "room" functions should include a static variable that keeps track of whether that particular room has been entered before. Your program must do something different the first time the room is entered. For example, the first time (and only the first time) that the room is entered, the player should get an object. There should be at least one "score" variable, such as the amount of gold collected, the number of butterflies rescued, the number of clues found, the number of lives lost, the amount of health remaining, etc. This variable should change as the player moves between rooms. There should be a separate function that prints the value of the variable for the player. That is, it should print something like: Oxygen Remaining: 120 for any room the character enters. Variables of this sort should probably be "global", meaning that all functions in the program can access them

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!