IT 140_5-3 Project One_Larissa_Rojas
docx
keyboard_arrow_up
School
Southern New Hampshire University *
*We aren’t endorsed by this school
Course
IT140
Subject
Information Systems
Date
Feb 20, 2024
Type
docx
Pages
5
Uploaded by DukePenguin2879
IT 140
Professor Patrick Moore
June 4, 2023
5-3 Project One Submission
Storyboard (Description and Map)
The player is an adventurer who has discovered an ancient temple rumored to be filled with valuable treasures. The adventurer must navigate through various rooms in the temple, collecting
different items hidden in each room. However, there is a villain, a guardian of the temple, who will try to stop the adventurer from collecting all the treasures. The adventurer's goal is to collect all the items before encountering the villain and escaping the temple with the treasures.
Villain: The villain is a mystical guardian named Zephyr, who can sense the presence of intruders in the temple. Zephyr is determined to protect the treasures and will confront the player
1
if they encounter him before collecting all the items.
Pseudocode or Flowchart for Code to “Move Between Rooms” and “Get an Item”
Define the rooms and items:
"Entrance Hall": "description": "You are in the Entrance Hall.",
"items": []
"Corridor of Statues":
"description": "You are in the Corridor of Statues.",
"items": ["Torch"]
2
"Hall of Mirrors":
"description": "You are in the Hall of Mirrors.",
"items": ["Key"]
"Puzzle Room":
"description": "You are in the Puzzle Room.",
"items": ["Map"]
"Treasure Chamber":
"description": "You are in the Treasure Chamber.",
"items": ["Gemstone"]
"Secret Passage": "description": "You are in the Secret Passage.",
"items": ["Golden Idol"]
"Library": "description": "You are in the Library.",
"items": ["Ancient Scroll"]
"Courtyard": "description": "You are in the Courtyard.",
"items": []
Define the player's starting inventory
inventory = []
Define the starting room
current_room = "Entrance Hall"
Define a function to display the available directions in a room
def display_directions(room):
directions = {"Entrance Hall": "North", "Corridor of Statues": "North, East",
"Hall of Mirrors": "West, East",
"Puzzle Room": "South, West",
"Treasure Chamber": "South",
"Secret Passage": "North, East",
"Library": "West",
"Courtyard": "South"}
Define a function to handle moving to a different room:
def move(direction):
global current_room
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
if direction in display_directions(current_room):
if direction ="North":
current_room = "Corridor of Statues"
elif direction = "South":
current_room = "Puzzle Room"
elif direction = "East":
current_room = "Hall of Mirrors"
elif direction = "West":
current_room = "Treasure Chamber"
print("You have moved to", current_room)
print(rooms[current_room]["description"])
else:
print("You cannot go in that direction.")
Define a function to handle getting an item from the current room:
def get_item(item):
global current_room
if item in rooms[current_room]["items"]:
inventory.append(item)
rooms[current_room]["items"].remove(item)
print("You have obtained", item)
else:
print("There is no", item, "in this room.")
Game loop:
while True:
print("Current Room:", current_room)
print("Available Directions:", display_directions(current_room))
print("Inventory:", inventory)
command = input("Enter a command: ")
if command == "quit":
break
elif command == "north" or command == "south" or command == "east" or command == "west":
move(command.capitalize())
elif command.startswith("get "):
item = command[4:]
get_item(item.capitalize())
else:
print("Invalid command.")
4
In this pseudocode, the game is implemented using a game loop that allows the player to enter commands. The available directions in each room are displayed, and the player can enter commands to move to different rooms or get items. The game loop continues until the player decides to quit. The pseudocode utilizes "IF" and "IF ELSE" statements to handle different commands, loops to iterate through the game, and functions to handle moving between rooms and getting items from the current room
5