Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this application, you will develop a newer version of the adventure game that you have developed previously. Game features and rules are listed below:

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

In this application, you will develop a newer version of the adventure game that you have developed previously. Game features and rules are listed below: 1. [0.2pt.] The adventure land will have the size of 6 rows x7 columns, resulting in 42 cells. 2. [0.2pt.] Inside these cells, the following values should be distributed randomly: 5 Treasures (' T),5 Monster ('M'), 2 Sword (' S),3 Potion (' P ), and 3 Venom (' V '). 3. [0.3pt.] However, the adventure land should be initially displayed to user but with empty values, except that the initial starting point. The starting point should be randomly selected from an empty field (E). 4. [0.3pt.] User should be able to move to Left, Right, Up or Down, by pressing respectively L or I, R or r,U or u, and D or d. Upon moving to a new cell, the content of the cell should be displayed. 5. [0.3pt.] After each move the adventure land should be updated with the new cell showing its content. The adventure land should not be duplicated on the screen to show the new location of the player. That means you should clear the console each time the user moves around. To do that, you can use the following statement: print(" \033[H\033[] ", end="") 6. [0.1pt.] With every move that does not kill the user, user earns 1 point. 7. [0.1pt.] Each time the user finds a Treasure, the user earns 1 additional point. 8. [0.1pt.] Each time the player finds a Sword, it is added to his toolkit. There is no limit on the number of potion that the player can collect. 9. [0.1pt.] Each time the player finds a Potion, it is added to his toolkit. There is no limit on the number of potion that the player can collect. 10. [0.1pt.] Encountering a Monster should kill the player if the user has NO Sword in the toolkit. 11. [0.2pts.] Encountering a Monster should NOT kill the player if the user has a Sword in the toolkit to use against the Monster. In this case, the sword count should be dropped by one. 12. [0.1pt.] Encountering a Venom should kill the player if the user has NO Potion in the toolkit. 13. [0.2pts.] Encountering a Venom should NOT kill the player if the user has a Potion in the toolkit to recover from the Venom. In this case, the potion count should be dropped by one. 14. [0.2pts.] User should not be allowed to pass through a cell that is already visited before. 15. [0.2pts.] At the bottom of the adventure map, the current score, and the number of swords and potions collected should be displayed and updated after each user move. In the image above, user pressed I to move to the cell on the left (of the current cell), which contained ' V ', as seen below. Since the user does not have any Potion to use against Venom, the user dies. In another game play shown in the following two images below, the user moves down and finds a Sword. After finding the Sword, the Sword count it increased to 1 at the bottom row: Sword: [1] Press L,U,R, D to move: d Score: [1] Sword: [1] Poition: [0] Press L, U, R, D to move: In several next moves, the user encounters a Potion, which increases the Potion count by 1 as displayed at the bottom row in the next screen. Next the user encounters a Monster and uses a Sword to save his/her life. As seen in the image below, the Sword count is decreased to 0 . Next the user encounters a Monster and uses a Sword to save his/her life. As seen in the image below, the Sword count is decreased to 0 . Oh No! MONSTOR. SWORD is used. Score: [6] Sword: [0] Poition: [1] Press L, U, R, D to move: Finding another potion, the potion count increases to 2 as shown in the image below. After finding a Treasure, the user gains an additional 1 point (besides the move). In the following screen, the user encounters a Venom and to recover from it, a Potion is used. Now the potion count is reduced to 1 . In the following screen, the user encounters a Monster. Since no Sword is available in the toolkit, the user dies. After the game ends, the moves made by the user and the total score should be stored in the gamelog.json file. The key should be the start time of the game. A new log should be created after each game session. An example json file, which contains the logs of two game sessions, is shown below: \begin{tabular}{l|r} 1 & \{ \\ 2 & "22/01/2022 21:02:19": \{ \\ 3 & "moves": ["r","d"], \\ 4 & "score": 1 \\ 5 & \}, \\ 6 & "22/01/2022 21:02:34": \{ \\ 7 & "moves": ["r", "r"], \\ 8 & "score": 1 \\ 9 & \}, \end{tabular}

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_2

Step: 3

blur-text-image_3

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions