IMPORTANT: The directions include sample code from the dragon-themed game. Be sure to modify any sample code so that it fits the theme of your game. 1. First, create a new file in the PyCharm integrated development environment (IDE), title it "TextBasedGame.py," and include a comment at the top with your full name. As you develop your code, remember that you must use industry standard best practices including in-line comments and appropriate naming conventions to enhance the readability and maintainability of the code. 2. In order for a player to navigate your game, you will need to develop a function or functions using Python script. Your function or functions should do the following: o show the player the different commands they can enter (such as "go North", "go West", and "get [item Name]"). Show the player's status by identifying the room they are currently in, showing a list of their inventory of items, and displaying the item in their current room. 3. Next, begin developing a main function in your code. The main function will contain the overall gameplay functionality. Review the Project Two Sample Text Game Flowchart, located in the Supporting Materials section, to help you visualize how main() will work. this step, simply add in a line of code to define your main function, and a line at the end of For your code that will run main(). You will develop each of the pieces for main() in Steps #4-7. Be sure to also include input validation by developing code that tells the program what to do if the player enters an invalid command. 7. The gameplay loop should continue looping, allowing the player to move to different rooms and acquire items until the player has either won or lost the game. Remember that the player wins the game by retrieving all of the items before encountering the room with the villain. The player loses the game by moving to the room with the villain before collecting all of the items. Be sure to include output to the player for both possible scenarios: winning and losing the game. 8. As you develop, you should be sure to debug your code to minimize errors and enhance functionality. After you have developed all of your code, be sure to run the code and use the map you designed to navigate through the rooms, testing to make sure that the game is working correctly. Be sure to test different scenarios such as the following: •What happens if the player enters a valid direction? Does the game move them to the correct room? When the player gets an item from a room, is the item added to their inventory? o What happens if the player enters an invalid direction or item command? Does the game provide the correct output? What happens if the player wins the game? What happens if the player loses the game?

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter12: Event-driven Gui Programming, Multithreading, And Animation
Section: Chapter Questions
Problem 8PE
icon
Related questions
Question
100%
IMPORTANT: The directions include sample code from the dragon-themed game. Be sure to modify any
sample code so that it fits the theme of your game.
1. First, create a new file in the PyCharm integrated development environment (IDE), title it
"TextBasedGame.py," and include a comment at the top with your full name. As you develop
your code, remember that you must use industry standard best practices including in-line
comments and appropriate naming conventions to enhance the readability and
maintainability of the code.
2. In order for a player to navigate your game, you will need to develop a function or functions
using Python script. Your function or functions should do the following:
0
Show the player the different commands they can enter (such as "go North", "go West",
and "get [item Name]").
Show the player's status by identifying the room they are currently in, showing a list of
their inventory of items, and displaying the item in their current room.
3. Next, begin developing a main function in your code. The main function will contain the overall
gameplay functionality. Review the Project Two Sample Text Game Flowchart, located in the
Supporting Materials section, to help you visualize how main() will work.
this step, simply add in a line of code to define your main function, and a line at the end of For
your code that will run main(). You will develop each of the pieces for main() in Steps #4-7.
4.
In main(), create a dictionary linking rooms to one another and linking items to their
corresponding rooms. The game needs to store all of the possible moves per room and the item
in each room in order to properly validate player commands (input). This will allow the player
only to move between rooms that are linked or retrieve the correct item from a room. Use your
storyboard and map from Project One to help you create your dictionary.
.
5. The bulk of the main function should include a loop for the gameplay. In your gameplay
loop, develop calls to the function(s) that show the player's status and possible commands.
You developed these in Step #2. When called, the function(s) should display the player's current
room and prompt the player for input (their next command). The player should enter a
command to either move between rooms or to get an item, if one exists, from a room.
6. Within the gameplay loop, you should include decision branching to handle different
commands and control the program flow. This should tell the game what to do for each of the
possible commands (inputs) from the player. Use your pseudocode or flowcharts from Project
One to help you write this code.
What should happen if the player enters a command to move between rooms?
What should happen if the player enters valid command to get an item from the room?
Be sure to also include input validation by developing code that tells the program what to do if the
player enters an invalid command.
7. The gameplay loop should continue looping, allowing the player to move to different rooms
and acquire items until the player has either won or lost the game. Remember that the player
wins the game by retrieving all of the items before encountering the room with the villain. The
player loses the game by moving to the room with the villain before collecting all of the items.
Be sure to include output to the player for both possible scenarios: winning and losing the game.
8. As you develop, you should be sure to debug your code to minimize errors and enhance
functionality. After you have developed all of your code, be sure to run the code and use the
map you designed to navigate through the rooms, testing to make sure that the game is working
correctly. Be sure to test different scenarios such as the following:
0
What happens if the player enters a valid direction? Does the game move them to the
correct room?
0 When the player gets an item from a room, is the item added to their inventory?
0
What happens if the player enters an invalid direction or item command? Does the
game provide the correct output?
What happens if the player wins the game? What happens if the player loses the game?
What to Submit
To complete this project, you must submit the following:
TextBasedGame.py
Develop and submit the "TextBasedGame.py" file using PyCharm. Include your full name in a
comment at the top of the code. Be sure to submit the code that you have completed, even if
you did not finish the full game.
(Ctrl)
Transcribed Image Text:IMPORTANT: The directions include sample code from the dragon-themed game. Be sure to modify any sample code so that it fits the theme of your game. 1. First, create a new file in the PyCharm integrated development environment (IDE), title it "TextBasedGame.py," and include a comment at the top with your full name. As you develop your code, remember that you must use industry standard best practices including in-line comments and appropriate naming conventions to enhance the readability and maintainability of the code. 2. In order for a player to navigate your game, you will need to develop a function or functions using Python script. Your function or functions should do the following: 0 Show the player the different commands they can enter (such as "go North", "go West", and "get [item Name]"). Show the player's status by identifying the room they are currently in, showing a list of their inventory of items, and displaying the item in their current room. 3. Next, begin developing a main function in your code. The main function will contain the overall gameplay functionality. Review the Project Two Sample Text Game Flowchart, located in the Supporting Materials section, to help you visualize how main() will work. this step, simply add in a line of code to define your main function, and a line at the end of For your code that will run main(). You will develop each of the pieces for main() in Steps #4-7. 4. In main(), create a dictionary linking rooms to one another and linking items to their corresponding rooms. The game needs to store all of the possible moves per room and the item in each room in order to properly validate player commands (input). This will allow the player only to move between rooms that are linked or retrieve the correct item from a room. Use your storyboard and map from Project One to help you create your dictionary. . 5. The bulk of the main function should include a loop for the gameplay. In your gameplay loop, develop calls to the function(s) that show the player's status and possible commands. You developed these in Step #2. When called, the function(s) should display the player's current room and prompt the player for input (their next command). The player should enter a command to either move between rooms or to get an item, if one exists, from a room. 6. Within the gameplay loop, you should include decision branching to handle different commands and control the program flow. This should tell the game what to do for each of the possible commands (inputs) from the player. Use your pseudocode or flowcharts from Project One to help you write this code. What should happen if the player enters a command to move between rooms? What should happen if the player enters valid command to get an item from the room? Be sure to also include input validation by developing code that tells the program what to do if the player enters an invalid command. 7. The gameplay loop should continue looping, allowing the player to move to different rooms and acquire items until the player has either won or lost the game. Remember that the player wins the game by retrieving all of the items before encountering the room with the villain. The player loses the game by moving to the room with the villain before collecting all of the items. Be sure to include output to the player for both possible scenarios: winning and losing the game. 8. As you develop, you should be sure to debug your code to minimize errors and enhance functionality. After you have developed all of your code, be sure to run the code and use the map you designed to navigate through the rooms, testing to make sure that the game is working correctly. Be sure to test different scenarios such as the following: 0 What happens if the player enters a valid direction? Does the game move them to the correct room? 0 When the player gets an item from a room, is the item added to their inventory? 0 What happens if the player enters an invalid direction or item command? Does the game provide the correct output? What happens if the player wins the game? What happens if the player loses the game? What to Submit To complete this project, you must submit the following: TextBasedGame.py Develop and submit the "TextBasedGame.py" file using PyCharm. Include your full name in a comment at the top of the code. Be sure to submit the code that you have completed, even if you did not finish the full game. (Ctrl)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

how do i comment my name at the top in python please 

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

hey is there anychance i could get this in text please so that i can put it in pycharm

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage