Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 41 additions & 23 deletions src/adv.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
from room import Room
# from player import Player

# Declare all the rooms

room = {
'outside': Room("Outside Cave Entrance",
"North of you, the cave mount beckons"),
# room = {
# 'outside': Room("Outside Cave Entrance"),

'foyer': Room("Foyer", """Dim light filters in from the south. Dusty
passages run north and east."""),
# 'foyer': Room("Foyer", """Dim light filters in from the south. Dusty
# passages run north and east."""),

'overlook': Room("Grand Overlook", """A steep cliff appears before you, falling
into the darkness. Ahead to the north, a light flickers in
the distance, but there is no way across the chasm."""),
# 'overlook': Room("Grand Overlook", """A steep cliff appears before you, falling
# into the darkness. Ahead to the north, a light flickers in
# the distance, but there is no way across the chasm."""),

'narrow': Room("Narrow Passage", """The narrow passage bends here from west
to north. The smell of gold permeates the air."""),
# 'narrow': Room("Narrow Passage", """The narrow passage bends here from west
# to north. The smell of gold permeates the air."""),

'treasure': Room("Treasure Chamber", """You've found the long-lost treasure
chamber! Sadly, it has already been completely emptied by
earlier adventurers. The only exit is to the south."""),
}
# 'treasure': Room("Treasure Chamber", """You've found the long-lost treasure
# chamber! Sadly, it has already been completely emptied by
# earlier adventurers. The only exit is to the south."""),
# }


# Link rooms together

room['outside'].n_to = room['foyer']
room['foyer'].s_to = room['outside']
room['foyer'].n_to = room['overlook']
room['foyer'].e_to = room['narrow']
room['overlook'].s_to = room['foyer']
room['narrow'].w_to = room['foyer']
room['narrow'].n_to = room['treasure']
room['treasure'].s_to = room['narrow']
# room['outside'].n_to = room['foyer']
# room['foyer'].s_to = room['outside']
# room['foyer'].n_to = room['overlook']
# room['foyer'].e_to = room['narrow']
# room['overlook'].s_to = room['foyer']
# room['narrow'].w_to = room['foyer']
# room['narrow'].n_to = room['treasure']
# room['treasure'].s_to = room['narrow']

#
# Main
#



# Make a new player object that is currently in the 'outside' room.
on_start = input("Enter your name:")

# print(on_start)
# Write a loop that:
#
# * Prints the current room name
Expand All @@ -49,3 +52,18 @@
# Print an error message if the movement isn't allowed.
#
# If the user enters "q", quit the game.
if on_start.lower().strip() == "anto":
question = input("chose a room to enter").lower().strip()
if question = "Room1":
question = input("You Entered a room with gold, All your armor upgraded")

if question = "Upgrade":
print("You leveled up")
else:
print("heard to the next room")




elif question = "Room2":
print("Lights Off and greedy monsters")
6 changes: 6 additions & 0 deletions src/player.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Write a class to hold player information, e.g. what room they are in
# currently.
class Player:
def __init__(self, name):
self.name = name

# def __str__(self):
# return "" + self.name
20 changes: 18 additions & 2 deletions src/room.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
# Implement a class to hold room information. This should have name and
# description attributes.
# Implement a class to hold room information. This should have name power ups and power downs / lights_on or lights_out
# description attributes.
class Room:
def __init__ (self, name):
# attributes / fields
self.name = name
self.lights_on = lights_on
self.lights_out = lights_out

# def __str__(self):
# return self.name

# a = Room("Room 1", True, False)
# b = Room("Room 2", True, False)
# c = Room("Room 3", True, False)
# d = Room("Room 4", False, True)
# e = Room("Room 5", True, False)
# f = Room("Room 6", False, True)