From cba06cbe44f369dee896e18ccd309f816c236a0f Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Fri, 1 Nov 2019 11:12:26 -0400 Subject: [PATCH 01/35] Create Rectangle-Joe.py --- CodeHS/3/4/7/Rectangle-Joe.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 CodeHS/3/4/7/Rectangle-Joe.py diff --git a/CodeHS/3/4/7/Rectangle-Joe.py b/CodeHS/3/4/7/Rectangle-Joe.py new file mode 100644 index 0000000..cd28109 --- /dev/null +++ b/CodeHS/3/4/7/Rectangle-Joe.py @@ -0,0 +1,8 @@ +length = 10 +width = 5 + +area = length * width +perimeter = 2 * (length + width) + +print "Length is " + str(length) + "\nWidth is " + str(width) +print "Area is " + str(area) + "\nPerimeter is " + str(perimeter) \ No newline at end of file From a2115148de7938da0f3aa4ab445f7e63a940e173 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Sun, 3 Nov 2019 17:44:07 -0500 Subject: [PATCH 02/35] framework for adventure game --- Basic Text Adventure Game/Adventure.py | 67 +++++++++++++++++++ Basic Text Adventure Game/gamedata/lobby.yaml | 30 +++++++++ .../gamedata/newroom.yaml | 3 + Basic Text Adventure Game/requirements.txt | 2 + 4 files changed, 102 insertions(+) create mode 100644 Basic Text Adventure Game/Adventure.py create mode 100644 Basic Text Adventure Game/gamedata/lobby.yaml create mode 100644 Basic Text Adventure Game/gamedata/newroom.yaml create mode 100644 Basic Text Adventure Game/requirements.txt diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py new file mode 100644 index 0000000..3f21ea3 --- /dev/null +++ b/Basic Text Adventure Game/Adventure.py @@ -0,0 +1,67 @@ +import yaml +import Levenshtein as lev + +select_edits = 2 # How close an input has to be to match +current_yaml = "gamedata/lobby.yaml" + +selected_direction = '' + +def enter_room(filepath): + """Reads data from a yaml file""" + with open(filepath, "r") as file_desc: + data = yaml.full_load(file_desc) + return data + +def save_data(filepath, data): + """Dumps data to a yaml""" + with open(filepath, "w") as file_desc: + yaml.dump(data, file_desc) + +if __name__ == "__main__": + current_room = enter_room(current_yaml) + print (current_room['roommeta']['desc']) + while(True): + + user_command = (input(":")).upper() + user_arg_1 = user_command.split()[0] + try: + user_arg_2 = user_command.split()[1] + except: + user_arg_2 = "" + + if (lev.distance(user_arg_1, "LOOK")) < select_edits: + if (lev.distance(user_arg_2, "LEFT")) < select_edits: + selected_direction = 'left' + print(current_room['left']['desc']) + elif (lev.distance(user_arg_2, "RIGHT")) < select_edits: + selected_direction = 'right' + print(current_room['right']['desc']) + elif (lev.distance(user_arg_2, "AHEAD")) < select_edits or (lev.distance(user_arg_1, "FORWARD")) < select_edits: + selected_direction = 'ahead' + print(current_room['ahead']['desc']) + elif (lev.distance(user_arg_2, "BEHIND")) < select_edits or (lev.distance(user_arg_1, "BACK")) < select_edits: + selected_direction = 'behind' + print(current_room['behind']['desc']) + elif (lev.distance(user_arg_1, "INSPECT")) < select_edits or (lev.distance(user_arg_1, "EXAMINE")) < select_edits: + print(current_room[selected_direction][user_arg_2.lower()]['inspect']) + elif (lev.distance(user_arg_1, "PICKUP")) < select_edits or (lev.distance(user_arg_1, "GRAB")) < select_edits: + print("pickup") + elif (lev.distance(user_arg_1, "OPEN")) < select_edits: + if user_arg_2 == "DOOR": + destination = current_room[selected_direction][user_arg_2.lower()]['dest'] + if destination != "Nowhere": + confirm = input(destination + ", would you like to enter? Y/N: ") + if confirm == "Y": + current_yaml = current_room[selected_direction][user_arg_2.lower()]['path'] + current_room = enter_room(current_yaml) + print (current_room['roommeta']['desc']) + elif confirm == "N": + break + else: + print("I did not understand the command") + else: + print("This door does not lead anywhere, its a wonder somebody took the time to install it.") + else: + print("This is not a door") + else: + print("I did not understand") \ No newline at end of file diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml new file mode 100644 index 0000000..17250be --- /dev/null +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -0,0 +1,30 @@ +roommeta: + desc: "Welcome to the first room of the game! Thanks so much for playing." + inspect: "Its a simple blue room" +items: + blueKey: + name: "A Blue Key" + inspect: "The key is small and looks new" + gameManual: + name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" + inspect: "This manual is almost useful for nothing!" +left: + desc: "You see a simple wooden door and a small blue key on the floor." + item: + blueKey: 1 + door: + inspect: "A simple wooden door, you're not sure where it leads" + dest: "Nowhere" +right: + desc: "You see a simple wooden door and nothing else." + door: + inspect: "A simple wooden door, you're not sure where it leads" + dest: "It apears this door leads to newroom" + path: "gamedata/newroom.yaml" +behind: + desc: "There is nothing behind you but wall" +ahead: + desc: "You see a simple wooden door and nothing else." + door: + inspect: "A simple wooden door, you're not sure where it leads" + dest: "Nowhere" \ No newline at end of file diff --git a/Basic Text Adventure Game/gamedata/newroom.yaml b/Basic Text Adventure Game/gamedata/newroom.yaml new file mode 100644 index 0000000..0dcf2f2 --- /dev/null +++ b/Basic Text Adventure Game/gamedata/newroom.yaml @@ -0,0 +1,3 @@ +roommeta: + desc: "Its a basic empty room." + inspect: "There's nothing in this room." \ No newline at end of file diff --git a/Basic Text Adventure Game/requirements.txt b/Basic Text Adventure Game/requirements.txt new file mode 100644 index 0000000..00558c0 --- /dev/null +++ b/Basic Text Adventure Game/requirements.txt @@ -0,0 +1,2 @@ +PyYAML==5.1.2 +python-Levenshtein==0.12.0 \ No newline at end of file From 4d66d350530a563b6b922160a475b49e9570b072 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Sun, 3 Nov 2019 17:51:42 -0500 Subject: [PATCH 03/35] Added `where` command --- Basic Text Adventure Game/Adventure.py | 28 ++++++++++++++++--- .../gamedata/newroom.yaml | 8 +++++- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 3f21ea3..0a556b0 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -32,16 +32,36 @@ def save_data(filepath, data): if (lev.distance(user_arg_1, "LOOK")) < select_edits: if (lev.distance(user_arg_2, "LEFT")) < select_edits: selected_direction = 'left' - print(current_room['left']['desc']) + try: + print(current_room['left']['desc']) + except: + print("There is nothing notible to your left") + elif (lev.distance(user_arg_2, "RIGHT")) < select_edits: selected_direction = 'right' - print(current_room['right']['desc']) + try: + print(current_room['right']['desc']) + except: + print("There is nothing notible to your right") + elif (lev.distance(user_arg_2, "AHEAD")) < select_edits or (lev.distance(user_arg_1, "FORWARD")) < select_edits: selected_direction = 'ahead' - print(current_room['ahead']['desc']) + try: + print(current_room['ahead']['desc']) + except: + print("There is nothing ahead of you") + elif (lev.distance(user_arg_2, "BEHIND")) < select_edits or (lev.distance(user_arg_1, "BACK")) < select_edits: selected_direction = 'behind' - print(current_room['behind']['desc']) + try: + print(current_room['behind']['desc']) + except: + print("Missing Data") + elif (lev.distance(user_arg_1, "WHERE")) < select_edits or (lev.distance(user_arg_1, "MAP")) < select_edits: + try: + print(current_room[selected_direction]) + except: + print("Choose a direction") elif (lev.distance(user_arg_1, "INSPECT")) < select_edits or (lev.distance(user_arg_1, "EXAMINE")) < select_edits: print(current_room[selected_direction][user_arg_2.lower()]['inspect']) elif (lev.distance(user_arg_1, "PICKUP")) < select_edits or (lev.distance(user_arg_1, "GRAB")) < select_edits: diff --git a/Basic Text Adventure Game/gamedata/newroom.yaml b/Basic Text Adventure Game/gamedata/newroom.yaml index 0dcf2f2..c157b41 100644 --- a/Basic Text Adventure Game/gamedata/newroom.yaml +++ b/Basic Text Adventure Game/gamedata/newroom.yaml @@ -1,3 +1,9 @@ roommeta: desc: "Its a basic empty room." - inspect: "There's nothing in this room." \ No newline at end of file + inspect: "There's nothing in this room." +behind: + desc: "You see a basic wooden door" + door: + inspect: "A simple wooden door, it leads to the lobby" + dest: "It apears this door leads to the lobby" + path: "gamedata/lobby.yaml" \ No newline at end of file From 0f28a72e12369d4eb002af72fd9a978519489642 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Sun, 3 Nov 2019 17:56:16 -0500 Subject: [PATCH 04/35] updated text --- Basic Text Adventure Game/Adventure.py | 2 +- Basic Text Adventure Game/gamedata/lobby.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 0a556b0..72ab56e 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -84,4 +84,4 @@ def save_data(filepath, data): else: print("This is not a door") else: - print("I did not understand") \ No newline at end of file + print("Thats not something I understand") \ No newline at end of file diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index 17250be..8187b86 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -1,15 +1,15 @@ roommeta: - desc: "Welcome to the first room of the game! Thanks so much for playing." - inspect: "Its a simple blue room" + desc: "Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSOECT items, and you can OPEN doors." + inspect: "The room is simple and undecoreated, somebody should tell the game designer to add stuff" items: blueKey: name: "A Blue Key" - inspect: "The key is small and looks new" + inspect: "The key is small and looks blue." gameManual: name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" left: - desc: "You see a simple wooden door and a small blue key on the floor." + desc: "You turn to the left and find a wooden door and a small key on the floor, you cannot pick up the key beacuse i did not program that feature yet." item: blueKey: 1 door: @@ -18,7 +18,7 @@ left: right: desc: "You see a simple wooden door and nothing else." door: - inspect: "A simple wooden door, you're not sure where it leads" + inspect: "Its a simple wooden door, your inspection reveals nothing more about it" dest: "It apears this door leads to newroom" path: "gamedata/newroom.yaml" behind: From 8c243b590636962d5fc6f0595eddaf91399c2690 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 07:35:46 -0500 Subject: [PATCH 05/35] Use def for fuzzy words --- Basic Text Adventure Game/Adventure.py | 34 +++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 72ab56e..147a3f3 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -6,6 +6,16 @@ selected_direction = '' +def fuzzy_words(input_word, alisis_list): + output = 0 + for word in alisis_list: + if ((lev.distance(input_word, word)) < select_edits): + output = output + 1 + if output >= 1: + return True + else: + return False + def enter_room(filepath): """Reads data from a yaml file""" with open(filepath, "r") as file_desc: @@ -17,9 +27,9 @@ def save_data(filepath, data): with open(filepath, "w") as file_desc: yaml.dump(data, file_desc) -if __name__ == "__main__": - current_room = enter_room(current_yaml) - print (current_room['roommeta']['desc']) +if __name__ == "__main__": # If this is the main file + current_room = enter_room(current_yaml) # fill current_room with all the room data of the current room + print (current_room['roommeta']['desc']) # give us the desc of that room while(True): user_command = (input(":")).upper() @@ -29,44 +39,44 @@ def save_data(filepath, data): except: user_arg_2 = "" - if (lev.distance(user_arg_1, "LOOK")) < select_edits: - if (lev.distance(user_arg_2, "LEFT")) < select_edits: + if (fuzzy_words(user_arg_1, ["LOOK"])): + if (fuzzy_words(user_arg_2, ["LEFT"])): selected_direction = 'left' try: print(current_room['left']['desc']) except: print("There is nothing notible to your left") - elif (lev.distance(user_arg_2, "RIGHT")) < select_edits: + elif (fuzzy_words(user_arg_2, ["RIGHT"])): selected_direction = 'right' try: print(current_room['right']['desc']) except: print("There is nothing notible to your right") - elif (lev.distance(user_arg_2, "AHEAD")) < select_edits or (lev.distance(user_arg_1, "FORWARD")) < select_edits: + elif (fuzzy_words(user_arg_2, ["AHEAD", "FORWARD"])): selected_direction = 'ahead' try: print(current_room['ahead']['desc']) except: print("There is nothing ahead of you") - elif (lev.distance(user_arg_2, "BEHIND")) < select_edits or (lev.distance(user_arg_1, "BACK")) < select_edits: + elif (fuzzy_words(user_arg_2, ["BEHIND", "BACK"])): selected_direction = 'behind' try: print(current_room['behind']['desc']) except: print("Missing Data") - elif (lev.distance(user_arg_1, "WHERE")) < select_edits or (lev.distance(user_arg_1, "MAP")) < select_edits: + elif (fuzzy_words(user_arg_1, ["WHERE", "MAP"])): try: print(current_room[selected_direction]) except: print("Choose a direction") - elif (lev.distance(user_arg_1, "INSPECT")) < select_edits or (lev.distance(user_arg_1, "EXAMINE")) < select_edits: + elif (fuzzy_words(user_arg_1, ["INSPECT", "EXAMINE"])): print(current_room[selected_direction][user_arg_2.lower()]['inspect']) - elif (lev.distance(user_arg_1, "PICKUP")) < select_edits or (lev.distance(user_arg_1, "GRAB")) < select_edits: + elif (fuzzy_words(user_arg_1, ["PICKUP", "GRAB"])): print("pickup") - elif (lev.distance(user_arg_1, "OPEN")) < select_edits: + elif (fuzzy_words(user_arg_1, ["OPEN"])): if user_arg_2 == "DOOR": destination = current_room[selected_direction][user_arg_2.lower()]['dest'] if destination != "Nowhere": From a5753ebd16f99ab2cceb88da323118f81828e7c6 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 09:25:26 -0500 Subject: [PATCH 06/35] Update Adventure.py Added main_menu Added save_userdata --- Basic Text Adventure Game/Adventure.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 147a3f3..6081d17 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -5,6 +5,7 @@ current_yaml = "gamedata/lobby.yaml" selected_direction = '' +current_user = "" def fuzzy_words(input_word, alisis_list): output = 0 @@ -26,9 +27,30 @@ def save_data(filepath, data): """Dumps data to a yaml""" with open(filepath, "w") as file_desc: yaml.dump(data, file_desc) + +def save_userdata(data_type, data): + print(current_user) + if current_user == "": + print("Error, you must create a user") + else: + current_user_data = enter_room(current_user) + current_user_data.update([data_type][data]) + save_data(current_user, current_user_data) + +def main_menu(): + print("Welcome to the main menu\n[N] to start a new game, [L] to load an old one.") + menu_input = (input(": ")).upper() + if menu_input == "N": + menu_username = input("Input your name: ") + current_user = "saves/" + menu_username + ".yaml" + print(current_user) + save_userdata("name", menu_username) + elif menu_input == "L": + print("Feature not functional") if __name__ == "__main__": # If this is the main file current_room = enter_room(current_yaml) # fill current_room with all the room data of the current room + main_menu() print (current_room['roommeta']['desc']) # give us the desc of that room while(True): @@ -76,6 +98,8 @@ def save_data(filepath, data): print(current_room[selected_direction][user_arg_2.lower()]['inspect']) elif (fuzzy_words(user_arg_1, ["PICKUP", "GRAB"])): print("pickup") + elif (fuzzy_words(user_arg_1, ["EXIT", "MENU"])): + main_menu() elif (fuzzy_words(user_arg_1, ["OPEN"])): if user_arg_2 == "DOOR": destination = current_room[selected_direction][user_arg_2.lower()]['dest'] From 716eaffb37aaa85801cc66fffd6af77fce4fafb7 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 10:13:56 -0500 Subject: [PATCH 07/35] Update Adventure.py --- Basic Text Adventure Game/Adventure.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 6081d17..aa6d2ea 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -28,26 +28,30 @@ def save_data(filepath, data): with open(filepath, "w") as file_desc: yaml.dump(data, file_desc) -def save_userdata(data_type, data): - print(current_user) - if current_user == "": - print("Error, you must create a user") - else: - current_user_data = enter_room(current_user) - current_user_data.update([data_type][data]) - save_data(current_user, current_user_data) - def main_menu(): print("Welcome to the main menu\n[N] to start a new game, [L] to load an old one.") menu_input = (input(": ")).upper() if menu_input == "N": menu_username = input("Input your name: ") + global current_user current_user = "saves/" + menu_username + ".yaml" print(current_user) save_userdata("name", menu_username) elif menu_input == "L": print("Feature not functional") +def save_userdata(data_type, data): + print(current_user) + if current_user == "": + print("Error, you must create a user") + else: + userfile = open(current_user, "w") + userfile.close() + current_user_data = enter_room(current_user) + current_user_data.update([data_type][data]) + save_data(current_user, current_user_data) + + if __name__ == "__main__": # If this is the main file current_room = enter_room(current_yaml) # fill current_room with all the room data of the current room main_menu() From 48c3fda5f73744c52560e208c293adc8a8b30694 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 10:43:44 -0500 Subject: [PATCH 08/35] It works! --- Basic Text Adventure Game/Adventure.py | 3 ++- Basic Text Adventure Game/saves/Joe.yaml | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 Basic Text Adventure Game/saves/Joe.yaml diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index aa6d2ea..7216960 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -46,9 +46,10 @@ def save_userdata(data_type, data): print("Error, you must create a user") else: userfile = open(current_user, "w") + userfile.write("name:") userfile.close() current_user_data = enter_room(current_user) - current_user_data.update([data_type][data]) + current_user_data.update({data_type: data}) save_data(current_user, current_user_data) diff --git a/Basic Text Adventure Game/saves/Joe.yaml b/Basic Text Adventure Game/saves/Joe.yaml new file mode 100644 index 0000000..c408973 --- /dev/null +++ b/Basic Text Adventure Game/saves/Joe.yaml @@ -0,0 +1 @@ +name: Joe From 9c9eac0bcfd1259e7e2a5950d46f5d4f8f2338bc Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 10:44:28 -0500 Subject: [PATCH 09/35] Remove verbose --- Basic Text Adventure Game/Adventure.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 7216960..1c5dbf4 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -35,13 +35,11 @@ def main_menu(): menu_username = input("Input your name: ") global current_user current_user = "saves/" + menu_username + ".yaml" - print(current_user) save_userdata("name", menu_username) elif menu_input == "L": print("Feature not functional") def save_userdata(data_type, data): - print(current_user) if current_user == "": print("Error, you must create a user") else: From 50b20e70c60d890f2f424c1b4d8601ec7bebfc59 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 11:33:43 -0500 Subject: [PATCH 10/35] Create .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c5fe3ed --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Basic Text Adventure Game/saves \ No newline at end of file From cadaa78fa1652b0dd40f8cd0e19e6f394bb52b6f Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 12:02:05 -0500 Subject: [PATCH 11/35] save system kinda works but not really lol! --- .gitignore | 2 +- Basic Text Adventure Game/Adventure.py | 55 ++++++++++++++++---------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index c5fe3ed..2a0da29 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -Basic Text Adventure Game/saves \ No newline at end of file +Basic Text Adventure Game/saves/*.yaml \ No newline at end of file diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 1c5dbf4..fe1474a 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -29,27 +29,35 @@ def save_data(filepath, data): yaml.dump(data, file_desc) def main_menu(): - print("Welcome to the main menu\n[N] to start a new game, [L] to load an old one.") - menu_input = (input(": ")).upper() - if menu_input == "N": - menu_username = input("Input your name: ") - global current_user - current_user = "saves/" + menu_username + ".yaml" - save_userdata("name", menu_username) - elif menu_input == "L": - print("Feature not functional") + while(True): + print("Welcome to the main menu\n[N] to start a new game, [L] to load an old one.") + menu_input = (input(":")).upper() # Get the menu input and make it uppercase + if menu_input == "N": # if the input is N + menu_username = input("Input your name: ") # Ask for name + global current_user # tell python that we're using the global instance of current_user + current_user = "saves/" + menu_username + ".yaml" # Set the user to the user's file location + save_userdata("name", menu_username) + break + elif menu_input == "L": + print("Feature not functional") + else: + print("I did not understand that") def save_userdata(data_type, data): if current_user == "": print("Error, you must create a user") else: - userfile = open(current_user, "w") - userfile.write("name:") - userfile.close() - current_user_data = enter_room(current_user) - current_user_data.update({data_type: data}) - save_data(current_user, current_user_data) - + try: + current_user_data = enter_room(current_user) + current_user_data.update({data_type: data}) + save_data(current_user, current_user_data) + except: + userfile = open(current_user, "w") + userfile.write("name:") + userfile.close() + current_user_data = enter_room(current_user) + current_user_data.update({data_type: data}) + save_data(current_user, current_user_data) if __name__ == "__main__": # If this is the main file current_room = enter_room(current_yaml) # fill current_room with all the room data of the current room @@ -96,13 +104,20 @@ def save_userdata(data_type, data): try: print(current_room[selected_direction]) except: - print("Choose a direction") + print("Even i dont know where you are") elif (fuzzy_words(user_arg_1, ["INSPECT", "EXAMINE"])): - print(current_room[selected_direction][user_arg_2.lower()]['inspect']) - elif (fuzzy_words(user_arg_1, ["PICKUP", "GRAB"])): + try: + print(current_room[selected_direction][user_arg_2.lower()]['inspect']) # Print the inspection text for that object + except: + print("This object cannot be inspected") # Tell the user that there is no information for that selected object + elif (fuzzy_words(user_arg_1, ["PICKUP", "GRAB", "TAKE"])): print("pickup") elif (fuzzy_words(user_arg_1, ["EXIT", "MENU"])): + save_userdata("current_room", current_yaml) # Save current room + save_userdata("selected_direction", selected_direction) # Save current direction main_menu() + elif (fuzzy_words(user_arg_1, ["USE"])): + print("use") elif (fuzzy_words(user_arg_1, ["OPEN"])): if user_arg_2 == "DOOR": destination = current_room[selected_direction][user_arg_2.lower()]['dest'] @@ -119,6 +134,6 @@ def save_userdata(data_type, data): else: print("This door does not lead anywhere, its a wonder somebody took the time to install it.") else: - print("This is not a door") + print("This is not a door or cannot be opened") else: print("Thats not something I understand") \ No newline at end of file From 9ca36f3cde364ad1724d5b7840c56bfe3fb3c3ac Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Mon, 4 Nov 2019 12:02:25 -0500 Subject: [PATCH 12/35] Delete Joe.yaml --- Basic Text Adventure Game/saves/Joe.yaml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 Basic Text Adventure Game/saves/Joe.yaml diff --git a/Basic Text Adventure Game/saves/Joe.yaml b/Basic Text Adventure Game/saves/Joe.yaml deleted file mode 100644 index c408973..0000000 --- a/Basic Text Adventure Game/saves/Joe.yaml +++ /dev/null @@ -1 +0,0 @@ -name: Joe From b25c469bebe1a202f29aee402ef5d74089bb9e82 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 5 Nov 2019 13:11:30 -0500 Subject: [PATCH 13/35] fix a bug where lowercase y would not allow you through a door --- Basic Text Adventure Game/Adventure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index fe1474a..0b21284 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -122,7 +122,7 @@ def save_userdata(data_type, data): if user_arg_2 == "DOOR": destination = current_room[selected_direction][user_arg_2.lower()]['dest'] if destination != "Nowhere": - confirm = input(destination + ", would you like to enter? Y/N: ") + confirm = (input(destination + ", would you like to enter? Y/N: ")).upper() if confirm == "Y": current_yaml = current_room[selected_direction][user_arg_2.lower()]['path'] current_room = enter_room(current_yaml) From 82e89c2fa363dcfeaf616bad79a5541b6acff403 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 5 Nov 2019 13:14:02 -0500 Subject: [PATCH 14/35] Create instructions for installing requires --- Basic Text Adventure Game/readme.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Basic Text Adventure Game/readme.md diff --git a/Basic Text Adventure Game/readme.md b/Basic Text Adventure Game/readme.md new file mode 100644 index 0000000..1cd87f7 --- /dev/null +++ b/Basic Text Adventure Game/readme.md @@ -0,0 +1,4 @@ +Welcome! To get started after cloning this repo, make sure to install dependencies! +`pip install -r requirements.txt` +or if on windows +`py -m pip install -r requirements.txt` \ No newline at end of file From 00a7a97ed7e205000069b4a62215409a14e5d8af Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 5 Nov 2019 13:14:17 -0500 Subject: [PATCH 15/35] Update readme.md --- Basic Text Adventure Game/readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Basic Text Adventure Game/readme.md b/Basic Text Adventure Game/readme.md index 1cd87f7..f514521 100644 --- a/Basic Text Adventure Game/readme.md +++ b/Basic Text Adventure Game/readme.md @@ -1,4 +1,7 @@ Welcome! To get started after cloning this repo, make sure to install dependencies! `pip install -r requirements.txt` or if on windows -`py -m pip install -r requirements.txt` \ No newline at end of file +`py -m pip install -r requirements.txt` + +once done, play the game! +`python Adventure.py` \ No newline at end of file From 5a12a37a20ff22b3d8391c6124587402e898dfae Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 5 Nov 2019 18:31:23 -0500 Subject: [PATCH 16/35] Update Adventure.py --- Basic Text Adventure Game/Adventure.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 0b21284..06fb8dc 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -27,7 +27,7 @@ def save_data(filepath, data): """Dumps data to a yaml""" with open(filepath, "w") as file_desc: yaml.dump(data, file_desc) - + def main_menu(): while(True): print("Welcome to the main menu\n[N] to start a new game, [L] to load an old one.") @@ -60,18 +60,18 @@ def save_userdata(data_type, data): save_data(current_user, current_user_data) if __name__ == "__main__": # If this is the main file - current_room = enter_room(current_yaml) # fill current_room with all the room data of the current room + current_room = enter_room(current_yaml) # fill current_room with all the room data of the current room main_menu() print (current_room['roommeta']['desc']) # give us the desc of that room while(True): - + user_command = (input(":")).upper() user_arg_1 = user_command.split()[0] try: user_arg_2 = user_command.split()[1] except: user_arg_2 = "" - + if (fuzzy_words(user_arg_1, ["LOOK"])): if (fuzzy_words(user_arg_2, ["LEFT"])): selected_direction = 'left' @@ -79,21 +79,21 @@ def save_userdata(data_type, data): print(current_room['left']['desc']) except: print("There is nothing notible to your left") - + elif (fuzzy_words(user_arg_2, ["RIGHT"])): selected_direction = 'right' try: print(current_room['right']['desc']) except: print("There is nothing notible to your right") - + elif (fuzzy_words(user_arg_2, ["AHEAD", "FORWARD"])): selected_direction = 'ahead' try: print(current_room['ahead']['desc']) except: print("There is nothing ahead of you") - + elif (fuzzy_words(user_arg_2, ["BEHIND", "BACK"])): selected_direction = 'behind' try: @@ -111,6 +111,7 @@ def save_userdata(data_type, data): except: print("This object cannot be inspected") # Tell the user that there is no information for that selected object elif (fuzzy_words(user_arg_1, ["PICKUP", "GRAB", "TAKE"])): + print(current_room[selected_direction][user_arg_2.lower()]['desc']) print("pickup") elif (fuzzy_words(user_arg_1, ["EXIT", "MENU"])): save_userdata("current_room", current_yaml) # Save current room @@ -136,4 +137,4 @@ def save_userdata(data_type, data): else: print("This is not a door or cannot be opened") else: - print("Thats not something I understand") \ No newline at end of file + print("Thats not something I understand") From a4901250a0a4ab4073d45193f39f120e957bd543 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 5 Nov 2019 18:32:07 -0500 Subject: [PATCH 17/35] update typo in lobby --- Basic Text Adventure Game/gamedata/lobby.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index 8187b86..1033549 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -1,5 +1,5 @@ roommeta: - desc: "Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSOECT items, and you can OPEN doors." + desc: "Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors." inspect: "The room is simple and undecoreated, somebody should tell the game designer to add stuff" items: blueKey: @@ -17,7 +17,7 @@ left: dest: "Nowhere" right: desc: "You see a simple wooden door and nothing else." - door: + door: inspect: "Its a simple wooden door, your inspection reveals nothing more about it" dest: "It apears this door leads to newroom" path: "gamedata/newroom.yaml" @@ -25,6 +25,6 @@ behind: desc: "There is nothing behind you but wall" ahead: desc: "You see a simple wooden door and nothing else." - door: + door: inspect: "A simple wooden door, you're not sure where it leads" - dest: "Nowhere" \ No newline at end of file + dest: "Nowhere" From b7b1ad0bd43a1340fa0dfe9f8c4bc806a9468ad7 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 5 Nov 2019 18:51:23 -0500 Subject: [PATCH 18/35] Update Adventure.py Fixed a bug where opening a door with no direction selected crashes the game --- Basic Text Adventure Game/Adventure.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 06fb8dc..3f6ca90 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -121,7 +121,11 @@ def save_userdata(data_type, data): print("use") elif (fuzzy_words(user_arg_1, ["OPEN"])): if user_arg_2 == "DOOR": - destination = current_room[selected_direction][user_arg_2.lower()]['dest'] + if selected_direction != '': + destination = current_room[selected_direction][user_arg_2.lower()]['dest'] + else: + print("You were not looking in a direction.") + destination = "Nowhere" if destination != "Nowhere": confirm = (input(destination + ", would you like to enter? Y/N: ")).upper() if confirm == "Y": From 5762c61fcaaf983eb728623edb2d4e47d7bcbff6 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Wed, 6 Nov 2019 15:16:43 -0500 Subject: [PATCH 19/35] added Travis Room added travis room and a path from new room to travis room --- .../gamedata/newroom.yaml | 3 ++ .../gamedata/travisroom.yaml | 30 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Basic Text Adventure Game/gamedata/travisroom.yaml diff --git a/Basic Text Adventure Game/gamedata/newroom.yaml b/Basic Text Adventure Game/gamedata/newroom.yaml index c157b41..4fa020e 100644 --- a/Basic Text Adventure Game/gamedata/newroom.yaml +++ b/Basic Text Adventure Game/gamedata/newroom.yaml @@ -1,6 +1,9 @@ roommeta: desc: "Its a basic empty room." inspect: "There's nothing in this room." +left: + dest: "this leads to travis room" + path: "gamedata/travisroom.yaml" behind: desc: "You see a basic wooden door" door: diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml new file mode 100644 index 0000000..c8d3f0a --- /dev/null +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -0,0 +1,30 @@ +roommeta: + desc: "Welcome to Travis Special room! There are three new commands you can use: you can LOOK UP, DOWN, and FORWARD" + inspect: "The room is large and has a small fountain in the middle. The fountain doesn't work." +items: + fountain: + name: "A fountain" + inspect: "The fountain has some water in it. The fountain doesn't work." + gameManual: + name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" + inspect: "This manual is almost useful for nothing!" +left: + desc: "You see some grafitti." +up: + desc: "you see a wet ceiling. you wonder: why is it wet?" +down: + desc: "You see your ugly feet." +right: + desc: "You see a locked door" + door: + inspect: "The door has a wooden beam running across it with a simple chain holding it down. Maybe you can break it." + dest: "It apears this door leads to a new room" + # path: "gamedata/newroom.yaml" +behind: + desc: "There is the door that leads back to the lobby." + dest: "This leads back to the lobby" + path: "gamedata/lobby.yaml" +forward: + desc: "You can't see past the fountain." + inspect: "its a fountain" + dest: "Nowhere" \ No newline at end of file From 8037e2054adaa1104c7ff4d65fb45e06d7881e9a Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Wed, 6 Nov 2019 16:08:32 -0500 Subject: [PATCH 20/35] made the code better fixed errors --- .../gamedata/newroom.yaml | 6 ++- .../gamedata/travisroom.yaml | 46 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/newroom.yaml b/Basic Text Adventure Game/gamedata/newroom.yaml index 4fa020e..5fc23ff 100644 --- a/Basic Text Adventure Game/gamedata/newroom.yaml +++ b/Basic Text Adventure Game/gamedata/newroom.yaml @@ -2,8 +2,10 @@ roommeta: desc: "Its a basic empty room." inspect: "There's nothing in this room." left: - dest: "this leads to travis room" - path: "gamedata/travisroom.yaml" + desc: "you see a door" + door: + dest: "this leads to travis room" + path: "gamedata/travisroom.yaml" behind: desc: "You see a basic wooden door" door: diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index c8d3f0a..8b519e4 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -1,30 +1,32 @@ roommeta: - desc: "Welcome to Travis Special room! There are three new commands you can use: you can LOOK UP, DOWN, and FORWARD" - inspect: "The room is large and has a small fountain in the middle. The fountain doesn't work." + desc: "This is Travis Room. In this room you can also LOOK UP and LOOK DOWN" + inspect: "Apon further inspection, the room opens up to your left and right more than forward." items: - fountain: - name: "A fountain" - inspect: "The fountain has some water in it. The fountain doesn't work." + emptyBottle: + name: "An empty bottle" + inspect: "The bottle can hold liquid. It's clear." gameManual: name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" -left: - desc: "You see some grafitti." -up: - desc: "you see a wet ceiling. you wonder: why is it wet?" down: - desc: "You see your ugly feet." + desc: "You look down. You see an empty bottle on the ground." + item: + emptyBottle: 1 +left: + desc: "You turn to the left and see a wall." + right: - desc: "You see a locked door" - door: - inspect: "The door has a wooden beam running across it with a simple chain holding it down. Maybe you can break it." - dest: "It apears this door leads to a new room" - # path: "gamedata/newroom.yaml" + desc: "You see a simple wooden door and nothing else." + door: + inspect: "Its a simple wooden door, your inspection reveals nothing more about it" + dest: "It apears this door leads nowhere" + path: idk behind: - desc: "There is the door that leads back to the lobby." - dest: "This leads back to the lobby" - path: "gamedata/lobby.yaml" -forward: - desc: "You can't see past the fountain." - inspect: "its a fountain" - dest: "Nowhere" \ No newline at end of file + desc: "There is the door that leads back to the previous room." + door: + inspect: "It is the door leading back to the room you came from." + dest: "It appears to go back." + path: "gamedata/newroom.yaml" +up: + desc: "You see the ceiling." + inspect: "Apon further inspection, you see that the ceiling is gay." From edd51745aef64b7b1bb15676715dc3ddc07b1859 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Wed, 6 Nov 2019 18:20:47 -0500 Subject: [PATCH 21/35] added inspect yay --- Basic Text Adventure Game/Adventure.py | 16 +++++++++++++++- Basic Text Adventure Game/gamedata/newroom.yaml | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 3f6ca90..8df46f8 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -93,7 +93,21 @@ def save_userdata(data_type, data): print(current_room['ahead']['desc']) except: print("There is nothing ahead of you") - + + elif (fuzzy_words(user_arg_2, ["UP", "ABOVE"])): + selected_direction = 'up' + try: + print(current_room['up']['desc']) + except: + print("There is nothing above you") + + elif (fuzzy_words(user_arg_2, ["DOWN", "BELOW"])): + selected_direction = 'down' + try: + print(current_room['down']['desc']) + except: + print("There is nothing below you") + elif (fuzzy_words(user_arg_2, ["BEHIND", "BACK"])): selected_direction = 'behind' try: diff --git a/Basic Text Adventure Game/gamedata/newroom.yaml b/Basic Text Adventure Game/gamedata/newroom.yaml index 5fc23ff..89209b2 100644 --- a/Basic Text Adventure Game/gamedata/newroom.yaml +++ b/Basic Text Adventure Game/gamedata/newroom.yaml @@ -4,6 +4,7 @@ roommeta: left: desc: "you see a door" door: + inspect: "The door is wet." dest: "this leads to travis room" path: "gamedata/travisroom.yaml" behind: From 3fdef16faf768ca07fbf4d9f04cc8088b57bde82 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Wed, 6 Nov 2019 19:01:49 -0500 Subject: [PATCH 22/35] updated bottle name --- Basic Text Adventure Game/gamedata/travisroom.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index 8b519e4..e16e4b6 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -2,16 +2,16 @@ roommeta: desc: "This is Travis Room. In this room you can also LOOK UP and LOOK DOWN" inspect: "Apon further inspection, the room opens up to your left and right more than forward." items: - emptyBottle: - name: "An empty bottle" + bottle: + name: "A bottle" inspect: "The bottle can hold liquid. It's clear." gameManual: name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" down: - desc: "You look down. You see an empty bottle on the ground." + desc: "You look down. You see a bottle on the ground." item: - emptyBottle: 1 + bottle: 1 left: desc: "You turn to the left and see a wall." From 5905421dca3d1b5c1ccdbbf4b181bdfa57366d64 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 13:13:48 -0500 Subject: [PATCH 23/35] changed the ceiling desc joe please add inspect item \:3 --- .../gamedata/secretroom.yaml | 30 +++++++++++++++++++ .../gamedata/travisroom.yaml | 1 - 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Basic Text Adventure Game/gamedata/secretroom.yaml diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml new file mode 100644 index 0000000..5e1d5cc --- /dev/null +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -0,0 +1,30 @@ +roommeta: + desc: "" + inspect: "" +items: + bottle: + name: "" + inspect: "" + gameManual: + name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" + inspect: "This manual is almost useful for nothing!" +down: + desc: "" + item: + bottle: 1 +left: + desc: "" + +right: + desc: "" + door: + inspect: "" + dest: "" +behind: + desc: "There is the door that leads back to the previous room." + door: + inspect: "It is the door leading back to the room you came from." + dest: "It appears to go back." + path: "gamedata/newroom.yaml" +up: + desc: "You see the ceiling. you see that the ceiling is gay." diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index e16e4b6..3f8d2d5 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -20,7 +20,6 @@ right: door: inspect: "Its a simple wooden door, your inspection reveals nothing more about it" dest: "It apears this door leads nowhere" - path: idk behind: desc: "There is the door that leads back to the previous room." door: From 95e5527ce721ab4515649be04874550f9b92c65a Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 13:16:04 -0500 Subject: [PATCH 24/35] updated the right file this time changed travisroom.yaml with the appropriate ceiling desc. Added secretroom, no changes to secretroom made yet. --- Basic Text Adventure Game/gamedata/secretroom.yaml | 2 +- Basic Text Adventure Game/gamedata/travisroom.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml index 5e1d5cc..95318c7 100644 --- a/Basic Text Adventure Game/gamedata/secretroom.yaml +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -27,4 +27,4 @@ behind: dest: "It appears to go back." path: "gamedata/newroom.yaml" up: - desc: "You see the ceiling. you see that the ceiling is gay." + desc: "You see the ceiling." diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index 3f8d2d5..5349bb3 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -27,5 +27,4 @@ behind: dest: "It appears to go back." path: "gamedata/newroom.yaml" up: - desc: "You see the ceiling." - inspect: "Apon further inspection, you see that the ceiling is gay." + desc: "You see the ceiling. you see that the ceiling is gay." From 054888866ac5467c95deaa37fbbba44c0541f2d3 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Thu, 7 Nov 2019 13:16:38 -0500 Subject: [PATCH 25/35] No synonyms anymore to the look feature Now you can look in any directions but you MUST MAINTAIN SYNTAX --- Basic Text Adventure Game/Adventure.py | 46 +++----------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 8df46f8..5f5c960 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -73,47 +73,11 @@ def save_userdata(data_type, data): user_arg_2 = "" if (fuzzy_words(user_arg_1, ["LOOK"])): - if (fuzzy_words(user_arg_2, ["LEFT"])): - selected_direction = 'left' - try: - print(current_room['left']['desc']) - except: - print("There is nothing notible to your left") - - elif (fuzzy_words(user_arg_2, ["RIGHT"])): - selected_direction = 'right' - try: - print(current_room['right']['desc']) - except: - print("There is nothing notible to your right") - - elif (fuzzy_words(user_arg_2, ["AHEAD", "FORWARD"])): - selected_direction = 'ahead' - try: - print(current_room['ahead']['desc']) - except: - print("There is nothing ahead of you") - - elif (fuzzy_words(user_arg_2, ["UP", "ABOVE"])): - selected_direction = 'up' - try: - print(current_room['up']['desc']) - except: - print("There is nothing above you") - - elif (fuzzy_words(user_arg_2, ["DOWN", "BELOW"])): - selected_direction = 'down' - try: - print(current_room['down']['desc']) - except: - print("There is nothing below you") - - elif (fuzzy_words(user_arg_2, ["BEHIND", "BACK"])): - selected_direction = 'behind' - try: - print(current_room['behind']['desc']) - except: - print("Missing Data") + try: + print(current_room[user_arg_2.lower()]['desc']) + selected_direction = user_arg_2.lower() + except: + print("That is not a direction or there is nothing there.") elif (fuzzy_words(user_arg_1, ["WHERE", "MAP"])): try: print(current_room[selected_direction]) From 9c5511af82d12d9746a69c12fbcf2deb498a54a4 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Thu, 7 Nov 2019 13:26:35 -0500 Subject: [PATCH 26/35] Added comments Proper syntax now requires all room YAMLs to include desc text for every direction! --- Basic Text Adventure Game/Adventure.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 5f5c960..2313424 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -72,12 +72,12 @@ def save_userdata(data_type, data): except: user_arg_2 = "" - if (fuzzy_words(user_arg_1, ["LOOK"])): - try: - print(current_room[user_arg_2.lower()]['desc']) - selected_direction = user_arg_2.lower() + if (fuzzy_words(user_arg_1, ["LOOK"])): # If the user asks to look + try: # First try and set the direction to the user input + print(current_room[user_arg_2.lower()]['desc']) # Print the description + selected_direction = user_arg_2.lower() # Set the selected_direction except: - print("That is not a direction or there is nothing there.") + print("That is not a direction or there is nothing there.") # Print error elif (fuzzy_words(user_arg_1, ["WHERE", "MAP"])): try: print(current_room[selected_direction]) From 36dacb9b3dc2a997d27e9603b5c69831e5c04f43 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Thu, 7 Nov 2019 13:35:14 -0500 Subject: [PATCH 27/35] Removed syntax: No longer requires objects or items in directions to be nested under object or item tag --- Basic Text Adventure Game/gamedata/lobby.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index 1033549..9315866 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -3,15 +3,16 @@ roommeta: inspect: "The room is simple and undecoreated, somebody should tell the game designer to add stuff" items: blueKey: - name: "A Blue Key" + desc: "A Blue Key" inspect: "The key is small and looks blue." gameManual: name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" left: desc: "You turn to the left and find a wooden door and a small key on the floor, you cannot pick up the key beacuse i did not program that feature yet." - item: - blueKey: 1 + key: + name: "blueKey" + inspect: "Its a blue key" door: inspect: "A simple wooden door, you're not sure where it leads" dest: "Nowhere" From 5aeb5ddf9048ba6d88ec5651c50b1f1a71fd6f6b Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 13:40:19 -0500 Subject: [PATCH 28/35] added secretroom --- .../gamedata/secretroom.yaml | 32 +++++++++---------- .../gamedata/travisroom.yaml | 7 ++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml index 95318c7..10e8206 100644 --- a/Basic Text Adventure Game/gamedata/secretroom.yaml +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -1,30 +1,30 @@ roommeta: - desc: "" - inspect: "" + desc: "How did you get in here? This room is a secret." + inspect: "!*(! !) !* )!(((!)) ((!!" items: - bottle: - name: "" - inspect: "" + stone: + desc: "An odd stone. It feels lighter than a regular stone." + inspect: "There seem to be two words in a different language on the stone. It reads: Go back." gameManual: - name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" - inspect: "This manual is almost useful for nothing!" + name: "INSPECT this manual for more info" + inspect: "you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors." down: - desc: "" - item: - bottle: 1 + desc: "You see your body." left: - desc: "" + desc: "(*! !*(*(!(!*)( !*()" right: - desc: "" + desc: "You s)! a d))!. D) Not g) in." door: - inspect: "" + inspect: "*)(*(*()*)*)(!! *)(*)(*)(*(*())**!! )(*()*)(*()*)(*)(*)(*)(*! ()" dest: "" + item: + stone: 1 behind: - desc: "There is the door that leads back to the previous room." + desc: "You feel something looking at you. You should head back to travis room." door: inspect: "It is the door leading back to the room you came from." dest: "It appears to go back." - path: "gamedata/newroom.yaml" + path: "gamedata/travisroom.yaml" up: - desc: "You see the ceiling." + desc: "You look into the sky. Sometimes the clouds glitch. You feel like its a simulation." diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index 5349bb3..db9c3e3 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -16,10 +16,10 @@ left: desc: "You turn to the left and see a wall." right: - desc: "You see a simple wooden door and nothing else." + desc: "You see a large metal door with strange markings all over it. The door is slightly ajar. you see nothing else." door: - inspect: "Its a simple wooden door, your inspection reveals nothing more about it" - dest: "It apears this door leads nowhere" + inspect: "Its a large metal door with strange markings all over it, your inspection reveals nothing more about it" + dest: "gamedata/secretroom.yaml" behind: desc: "There is the door that leads back to the previous room." door: @@ -28,3 +28,4 @@ behind: path: "gamedata/newroom.yaml" up: desc: "You see the ceiling. you see that the ceiling is gay." + From e19e62dbfa2461e93a6e7aa9deab220b278db708 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 13:46:21 -0500 Subject: [PATCH 29/35] changed item naming --- Basic Text Adventure Game/gamedata/secretroom.yaml | 7 ++++--- Basic Text Adventure Game/gamedata/travisroom.yaml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml index 10e8206..6ae926f 100644 --- a/Basic Text Adventure Game/gamedata/secretroom.yaml +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -3,7 +3,7 @@ roommeta: inspect: "!*(! !) !* )!(((!)) ((!!" items: stone: - desc: "An odd stone. It feels lighter than a regular stone." + desc: "A stone. It feels lighter than a regular stone. It looks odd." inspect: "There seem to be two words in a different language on the stone. It reads: Go back." gameManual: name: "INSPECT this manual for more info" @@ -18,8 +18,9 @@ right: door: inspect: "*)(*(*()*)*)(!! *)(*)(*)(*(*())**!! )(*()*)(*()*)(*)(*)(*)(*! ()" dest: "" - item: - stone: 1 + stone: + name: "Stone" + inspect: "There seem to be two words in a different language on the stone. It reads: Go back." behind: desc: "You feel something looking at you. You should head back to travis room." door: diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index db9c3e3..b6d0287 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -3,15 +3,16 @@ roommeta: inspect: "Apon further inspection, the room opens up to your left and right more than forward." items: bottle: - name: "A bottle" + desc: "A bottle" inspect: "The bottle can hold liquid. It's clear." gameManual: name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" down: desc: "You look down. You see a bottle on the ground." - item: - bottle: 1 + bottle: + name: "bottle" + inspect: "Its an empty bottle." left: desc: "You turn to the left and see a wall." From c74f9e1ace52778895b5987fe7f8220e4a5a40a2 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 13:48:49 -0500 Subject: [PATCH 30/35] added path to the secret room --- Basic Text Adventure Game/gamedata/travisroom.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index b6d0287..4125837 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -20,7 +20,8 @@ right: desc: "You see a large metal door with strange markings all over it. The door is slightly ajar. you see nothing else." door: inspect: "Its a large metal door with strange markings all over it, your inspection reveals nothing more about it" - dest: "gamedata/secretroom.yaml" + dest: "This leads to a secret room" + path: "gamedata/secretroom.yaml" behind: desc: "There is the door that leads back to the previous room." door: From 3450d7ef7b335762fed9de15dd4bd2defa2e96ae Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 13:53:53 -0500 Subject: [PATCH 31/35] made it better --- Basic Text Adventure Game/gamedata/lobby.yaml | 2 +- Basic Text Adventure Game/gamedata/secretroom.yaml | 4 ++-- Basic Text Adventure Game/gamedata/travisroom.yaml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index 9315866..cddbb6b 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -6,7 +6,7 @@ items: desc: "A Blue Key" inspect: "The key is small and looks blue." gameManual: - name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" + desc: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" left: desc: "You turn to the left and find a wooden door and a small key on the floor, you cannot pick up the key beacuse i did not program that feature yet." diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml index 6ae926f..b253071 100644 --- a/Basic Text Adventure Game/gamedata/secretroom.yaml +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -6,7 +6,7 @@ items: desc: "A stone. It feels lighter than a regular stone. It looks odd." inspect: "There seem to be two words in a different language on the stone. It reads: Go back." gameManual: - name: "INSPECT this manual for more info" + desc: "INSPECT this manual for more info" inspect: "you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors." down: desc: "You see your body." @@ -14,7 +14,7 @@ left: desc: "(*! !*(*(!(!*)( !*()" right: - desc: "You s)! a d))!. D) Not g) in." + desc: "You see a stone on the ground next to the wall. You can INSPECT STONE." door: inspect: "*)(*(*()*)*)(!! *)(*)(*)(*(*())**!! )(*()*)(*()*)(*)(*)(*)(*! ()" dest: "" diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index 4125837..37e6923 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -6,10 +6,10 @@ items: desc: "A bottle" inspect: "The bottle can hold liquid. It's clear." gameManual: - name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" + desc: "Welcome! and thanks for playing this game, INSPECT this manual for more info" inspect: "This manual is almost useful for nothing!" down: - desc: "You look down. You see a bottle on the ground." + desc: "You look down. You see a bottle on the ground. You can INSPECT bottle." bottle: name: "bottle" inspect: "Its an empty bottle." From 824a5038c0a3da75b393d5748c239d1b982a1b15 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:03:06 -0500 Subject: [PATCH 32/35] Item pickup now works You no longer need "" in files --- Basic Text Adventure Game/Adventure.py | 9 ++++- Basic Text Adventure Game/gamedata/lobby.yaml | 40 ++++++++++--------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/Basic Text Adventure Game/Adventure.py b/Basic Text Adventure Game/Adventure.py index 2313424..5bc8090 100644 --- a/Basic Text Adventure Game/Adventure.py +++ b/Basic Text Adventure Game/Adventure.py @@ -89,8 +89,13 @@ def save_userdata(data_type, data): except: print("This object cannot be inspected") # Tell the user that there is no information for that selected object elif (fuzzy_words(user_arg_1, ["PICKUP", "GRAB", "TAKE"])): - print(current_room[selected_direction][user_arg_2.lower()]['desc']) - print("pickup") + try: + pick_item = current_room[selected_direction][user_arg_2.lower()]['name'] + data = current_room['items'][pick_item] + save_userdata('inventory', data) + print("You picked up the item") + except: + print("Item cannot be picked up") elif (fuzzy_words(user_arg_1, ["EXIT", "MENU"])): save_userdata("current_room", current_yaml) # Save current room save_userdata("selected_direction", selected_direction) # Save current direction diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index 9315866..afd034e 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -1,31 +1,33 @@ roommeta: - desc: "Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors." - inspect: "The room is simple and undecoreated, somebody should tell the game designer to add stuff" + desc: Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors. + inspect: The room is simple and undecoreated, somebody should tell the game designer to add stuff items: blueKey: - desc: "A Blue Key" - inspect: "The key is small and looks blue." + blueKey: + desc: A Blue Key + inspect: The key is small and looks blue. gameManual: - name: "Welcome! and thanks for playing this game, INSPECT this manual for more info" - inspect: "This manual is almost useful for nothing!" + gameManual: + name: Welcome! and thanks for playing this game, INSPECT this manual for more info + inspect: This manual is almost useful for nothing! left: - desc: "You turn to the left and find a wooden door and a small key on the floor, you cannot pick up the key beacuse i did not program that feature yet." + desc: You turn to the left and find a wooden door and a small key on the floor, you cannot pick up the key beacuse i did not program that feature yet. key: - name: "blueKey" - inspect: "Its a blue key" + name: blueKey + inspect: Its a blue key door: - inspect: "A simple wooden door, you're not sure where it leads" - dest: "Nowhere" + inspect: A simple wooden door, you're not sure where it leads + dest: Nowhere right: - desc: "You see a simple wooden door and nothing else." + desc: You see a simple wooden door and nothing else. door: - inspect: "Its a simple wooden door, your inspection reveals nothing more about it" - dest: "It apears this door leads to newroom" - path: "gamedata/newroom.yaml" + inspect: Its a simple wooden door, your inspection reveals nothing more about it + dest: It apears this door leads to newroom + path: gamedata/newroom.yaml behind: - desc: "There is nothing behind you but wall" + desc: There is nothing behind you but wall ahead: - desc: "You see a simple wooden door and nothing else." + desc: You see a simple wooden door and nothing else. door: - inspect: "A simple wooden door, you're not sure where it leads" - dest: "Nowhere" + inspect: A simple wooden door, you're not sure where it leads + dest: Nowhere From 69d91e154066c1e016c06afb4cdeaad90854c672 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Thu, 7 Nov 2019 15:48:49 -0500 Subject: [PATCH 33/35] added compass navigation, added snake room, fixed bugs --- Basic Text Adventure Game/gamedata/lobby.yaml | 8 +-- .../gamedata/newroom.yaml | 33 +++++++----- .../gamedata/secretroom.yaml | 43 ++++++++-------- .../gamedata/snakeroom.yaml | 0 .../gamedata/travisroom.yaml | 51 ++++++++++--------- 5 files changed, 74 insertions(+), 61 deletions(-) create mode 100644 Basic Text Adventure Game/gamedata/snakeroom.yaml diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index afd034e..8ee7bce 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -10,7 +10,7 @@ items: gameManual: name: Welcome! and thanks for playing this game, INSPECT this manual for more info inspect: This manual is almost useful for nothing! -left: +west: desc: You turn to the left and find a wooden door and a small key on the floor, you cannot pick up the key beacuse i did not program that feature yet. key: name: blueKey @@ -18,15 +18,15 @@ left: door: inspect: A simple wooden door, you're not sure where it leads dest: Nowhere -right: +east: desc: You see a simple wooden door and nothing else. door: inspect: Its a simple wooden door, your inspection reveals nothing more about it dest: It apears this door leads to newroom path: gamedata/newroom.yaml -behind: +south: desc: There is nothing behind you but wall -ahead: +north: desc: You see a simple wooden door and nothing else. door: inspect: A simple wooden door, you're not sure where it leads diff --git a/Basic Text Adventure Game/gamedata/newroom.yaml b/Basic Text Adventure Game/gamedata/newroom.yaml index 89209b2..77b8e36 100644 --- a/Basic Text Adventure Game/gamedata/newroom.yaml +++ b/Basic Text Adventure Game/gamedata/newroom.yaml @@ -1,15 +1,24 @@ roommeta: - desc: "Its a basic empty room." - inspect: "There's nothing in this room." -left: - desc: "you see a door" + desc: You are in newroom. Its a basic empty room. + inspect: There's nothing in this room. +north: + desc: you see a door door: - inspect: "The door is wet." - dest: "this leads to travis room" - path: "gamedata/travisroom.yaml" -behind: - desc: "You see a basic wooden door" + inspect: The door is wet. + dest: this leads to travis room + path: gamedata/travisroom.yaml +south: + desc: you see a locked wooden door. you can INSPECT door + door: + inspect: The door needs a red key. + dest: Nowhere +up: + desc: There is a ceiling. +down: + desc: There is nothing on the ground. +west: + desc: You see a basic wooden door door: - inspect: "A simple wooden door, it leads to the lobby" - dest: "It apears this door leads to the lobby" - path: "gamedata/lobby.yaml" \ No newline at end of file + inspect: A simple wooden door, it leads to the lobby + dest: It apears this door leads to the lobby + path: gamedata/lobby.yaml \ No newline at end of file diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml index b253071..725a792 100644 --- a/Basic Text Adventure Game/gamedata/secretroom.yaml +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -1,31 +1,30 @@ roommeta: - desc: "How did you get in here? This room is a secret." - inspect: "!*(! !) !* )!(((!)) ((!!" + desc: How did you get in here? This room is a secret. + inspect: you feel lighter than normal items: stone: - desc: "A stone. It feels lighter than a regular stone. It looks odd." - inspect: "There seem to be two words in a different language on the stone. It reads: Go back." + stone: + desc: A stone. It feels lighter than a regular stone. It looks odd. + inspect: There seems to be two words in a different language on the stone. It reads Go back. gameManual: - desc: "INSPECT this manual for more info" - inspect: "you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors." + gameManual: + desc: Welcome! and thanks for playing this game, INSPECT this manual for more info + inspect: This manual is almost useful for nothing! down: - desc: "You see your body." -left: - desc: "(*! !*(*(!(!*)( !*()" + desc: You see your body. +west: + desc: you see a wall. The wall is illuminated by the ceiling. -right: - desc: "You see a stone on the ground next to the wall. You can INSPECT STONE." - door: - inspect: "*)(*(*()*)*)(!! *)(*)(*)(*(*())**!! )(*()*)(*()*)(*)(*)(*)(*! ()" - dest: "" +east: + desc: You see a stone on the ground next to the wall. You can INSPECT STONE. stone: - name: "Stone" - inspect: "There seem to be two words in a different language on the stone. It reads: Go back." -behind: - desc: "You feel something looking at you. You should head back to travis room." + name: stone + inspect: There seems to be two words in a different language on the stone. It reads Go back. +south: + desc: You feel something looking at you. You should head back to travis room. door: - inspect: "It is the door leading back to the room you came from." - dest: "It appears to go back." - path: "gamedata/travisroom.yaml" + inspect: It is the door leading back to the room you came from. + dest: It appears to go back. + path: gamedata/travisroom.yaml up: - desc: "You look into the sky. Sometimes the clouds glitch. You feel like its a simulation." + desc: You look into the sky. Sometimes the clouds glitch. You feel like its a simulation. diff --git a/Basic Text Adventure Game/gamedata/snakeroom.yaml b/Basic Text Adventure Game/gamedata/snakeroom.yaml new file mode 100644 index 0000000..e69de29 diff --git a/Basic Text Adventure Game/gamedata/travisroom.yaml b/Basic Text Adventure Game/gamedata/travisroom.yaml index 37e6923..bb9f4b5 100644 --- a/Basic Text Adventure Game/gamedata/travisroom.yaml +++ b/Basic Text Adventure Game/gamedata/travisroom.yaml @@ -1,33 +1,38 @@ roommeta: - desc: "This is Travis Room. In this room you can also LOOK UP and LOOK DOWN" - inspect: "Apon further inspection, the room opens up to your left and right more than forward." + desc: This is Travis Room. In this room you can also LOOK UP and LOOK DOWN + inspect: Apon further inspection, the room opens up to your left and right more than forward. items: bottle: - desc: "A bottle" - inspect: "The bottle can hold liquid. It's clear." + desc: A bottle + inspect: The bottle can hold liquid. It's clear. gameManual: - desc: "Welcome! and thanks for playing this game, INSPECT this manual for more info" - inspect: "This manual is almost useful for nothing!" + desc: Welcome! and thanks for playing this game, INSPECT this manual for more info + inspect: This manual is almost useful for nothing! down: - desc: "You look down. You see a bottle on the ground. You can INSPECT bottle." + desc: You look down. You see a bottle on the ground. You can INSPECT bottle. bottle: - name: "bottle" - inspect: "Its an empty bottle." -left: - desc: "You turn to the left and see a wall." + name: bottle + inspect: Its an empty bottle. +west: + desc: You turn to the left and see a wall. -right: - desc: "You see a large metal door with strange markings all over it. The door is slightly ajar. you see nothing else." +east: + desc: You see a large metal door with strange markings all over it. The door is slightly ajar. you see nothing else. door: - inspect: "Its a large metal door with strange markings all over it, your inspection reveals nothing more about it" - dest: "This leads to a secret room" - path: "gamedata/secretroom.yaml" -behind: - desc: "There is the door that leads back to the previous room." + inspect: Its a large metal door with strange markings all over it, your inspection reveals nothing more about it + dest: This leads to a secret room + path: gamedata/secretroom.yaml +south: + desc: There is the door that leads back to the previous room. door: - inspect: "It is the door leading back to the room you came from." - dest: "It appears to go back." - path: "gamedata/newroom.yaml" + inspect: It is the door leading back to the room you came from. + dest: It appears to go back. + path: gamedata/newroom.yaml up: - desc: "You see the ceiling. you see that the ceiling is gay." - + desc: You see the ceiling. you see that the ceiling is gay. +north: + desc: there is a door with a window + door: + inspect: you look through the window. There are a few snakes in the next room. + dest: This leads to another room + path: gamedata/snakeroom.yaml From e44b08af29721039d200738a072b1de585f62b95 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Wed, 13 Nov 2019 12:22:49 -0500 Subject: [PATCH 34/35] added a new room. identified more bugs opening a door when facing a wall with no door crashes the program. added gamedata\minecraft.yaml. will be adding gamedata\woodenhouse.yaml as well. Changed the directions to be compass oriented as well --- Basic Text Adventure Game/gamedata/lobby.yaml | 2 +- .../gamedata/minecraft.yaml | 42 +++++++++++++++++++ .../gamedata/secretroom.yaml | 8 +++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 Basic Text Adventure Game/gamedata/minecraft.yaml diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index 8ee7bce..a34c51d 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -1,5 +1,5 @@ roommeta: - desc: Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK LEFT, RIGHT, AHEAD, or BEHIND, you can INSPECT things, and you can OPEN doors. + desc: "Welcome to the first room of the game! Thanks so much for playing. There are only a few commands you can use right now, you can LOOK NORTH, EAST, SOUTH, or WEST, INSPECT things, OPEN doors, TAKE things, or USE things." inspect: The room is simple and undecoreated, somebody should tell the game designer to add stuff items: blueKey: diff --git a/Basic Text Adventure Game/gamedata/minecraft.yaml b/Basic Text Adventure Game/gamedata/minecraft.yaml new file mode 100644 index 0000000..3a05b69 --- /dev/null +++ b/Basic Text Adventure Game/gamedata/minecraft.yaml @@ -0,0 +1,42 @@ +roommeta: + desc: Dude, it's literally just minecraft. + inspect: "It looks like a new minecraft world! Advancement made: Opening Inventory" +items: + stick: + stick: + desc: A stick! You took it right off of the tree. + inspect: It is a sturdy stick. It seems malleable but you cannot break it. + seed: + seed: + desc: A seed. You foraged it from the grass. + inspect: It is a wheat seed. It is dry. + gameManual: + gameManual: + desc: Welcome! and thanks for playing this game, INSPECT this manual for more info + inspect: This manual is almost useful for nothing! +down: + desc: You look down and see meter long grass blocks. A few of them have grass. you see a SEED. + seed: + name: seed + inspect: It is a wheat seed. It is dry. +west: + desc: you look left. The land seems to go on forever in a cascade of valleys and forests. +east: + desc: You see a wooden house. It is a simple design will large windows. There is a wooden door with slits. + door: + dest: This leads to someones wooden house + inspect: You inspect the door. You see a few marks that look like arrows went through the door. + path: +north: + desc: you look ahead and see a decaying tree. There are a few sticks on the ground surrounding it. One stick looks healthy. + stick: + name: stick + inspect: It is a sturdy stick. It seems malleable but you cannot break it. +south: + desc: There is the door you came in. It leads back to the secret room. + door: + inspect: You try to focus on the details of the door but they seem to disappear. The door seems ethereal. + dest: It appears to go back to the secret room + path: gamedata/secretroom.yaml +up: + desc: You look into the sky. There is a square sun and clouds made of rectangles. diff --git a/Basic Text Adventure Game/gamedata/secretroom.yaml b/Basic Text Adventure Game/gamedata/secretroom.yaml index 725a792..8b7bfde 100644 --- a/Basic Text Adventure Game/gamedata/secretroom.yaml +++ b/Basic Text Adventure Game/gamedata/secretroom.yaml @@ -20,11 +20,17 @@ east: stone: name: stone inspect: There seems to be two words in a different language on the stone. It reads Go back. +north: + desc: There is a magical door with the same markings as a few stones to the east. + door: + inspect: It is glowing as if it wasnt on the wall. The markings seem dangerous.. + dest: this leads to a blocky world + path: gamedata/minecraft.yaml south: desc: You feel something looking at you. You should head back to travis room. door: inspect: It is the door leading back to the room you came from. - dest: It appears to go back. + dest: It appears to go back path: gamedata/travisroom.yaml up: desc: You look into the sky. Sometimes the clouds glitch. You feel like its a simulation. From a56d7b7ef78810ec19190057eb762cfa6ff6a7b5 Mon Sep 17 00:00:00 2001 From: DirDraggo Date: Wed, 20 Nov 2019 10:51:03 -0500 Subject: [PATCH 35/35] added woodenhouse added a wooden house --- Basic Text Adventure Game/gamedata/lobby.yaml | 5 ++++ .../gamedata/woodenhouse.yaml | 23 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Basic Text Adventure Game/gamedata/woodenhouse.yaml diff --git a/Basic Text Adventure Game/gamedata/lobby.yaml b/Basic Text Adventure Game/gamedata/lobby.yaml index a34c51d..d40a51b 100644 --- a/Basic Text Adventure Game/gamedata/lobby.yaml +++ b/Basic Text Adventure Game/gamedata/lobby.yaml @@ -31,3 +31,8 @@ north: door: inspect: A simple wooden door, you're not sure where it leads dest: Nowhere +down: + desc: there is the game manual on the ground. use INSPECT MANUAL. + gameManual: + name: gameManual + inspect: This manual is almost useful for nothing! diff --git a/Basic Text Adventure Game/gamedata/woodenhouse.yaml b/Basic Text Adventure Game/gamedata/woodenhouse.yaml new file mode 100644 index 0000000..5d5b903 --- /dev/null +++ b/Basic Text Adventure Game/gamedata/woodenhouse.yaml @@ -0,0 +1,23 @@ +roommeta: + desc: It is a wooden house in the minecraft room. +items: + gameManual: + gameManual: + desc: Welcome! and thanks for playing this game, INSPECT this manual for more info + inspect: This manual is almost useful for nothing! +down: + desc: There is a nice looking oak wood floor. There is a trapdoor in the corner leading down. + door: + dest: it is a trapdoor that leads under the floor + inspect: it seems to go down very far. + path: Unknown +west: + desc: You can see outside through a large glass window. You can see a decaying tree outside. +east: + desc: There is a table with a few tools, a furnace with some food cooking in it, and a record player. +north: + desc: "There is a closed door labelled: stairs." + door: + dest: There are stairs behind the door. They lead upstairs + inspect: The door is unlocked and goes upstairs. + path: Unknown