diff --git a/Orange-team/Explanation-spaceship-escape-game b/Orange-team/Explanation-spaceship-escape-game new file mode 100644 index 00000000..5c2e01ab --- /dev/null +++ b/Orange-team/Explanation-spaceship-escape-game @@ -0,0 +1,4 @@ +Escape game project made by the Orange Team : Gonzalo Benitez, Irina Markova, Nhan Nguyen, Amandine Croset +Access to demo : +Scenario 1 : https://www.loom.com/share/a0a6236972d14e24b216f678c94d3a58?sid=987f0abb-17a9-4f2b-9a8c-2716b61e6ed4 +Scenario 2 : https://www.loom.com/share/122fd2a81d014fa5b40c5c8c89ae26c7?sid=c1ac9bb7-728f-4833-84cc-0032c3c67950 diff --git a/Orange-team/Group 2Distribution plan.jpg b/Orange-team/Group 2Distribution plan.jpg new file mode 100644 index 00000000..96ba93a4 Binary files /dev/null and b/Orange-team/Group 2Distribution plan.jpg differ diff --git a/Orange-team/Notebook_escape_game_final_orange_team.ipynb b/Orange-team/Notebook_escape_game_final_orange_team.ipynb new file mode 100644 index 00000000..bec14ddd --- /dev/null +++ b/Orange-team/Notebook_escape_game_final_orange_team.ipynb @@ -0,0 +1,431 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 4, + "id": "24915a59", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Requirement already satisfied: pygame in /Users/gonzalo/anaconda3/lib/python3.11/site-packages (2.5.2)\r\n" + ] + } + ], + "source": [ + "!pip install pygame" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "64149d5c", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "You wake up near from the control panel and find yourself in a strange spaceship with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get back to Earth, NOW!\n", + "You are now in navigation room\n", + "What would you like to do? Type 'explore', 'examine', 'exit' or 'stop the music'? examine\n", + "What would you like to examine? control panel\n", + "Yay! You have found the key for door A. If you get the next two questions right, you get key D and select if you advance to the control room! You'll be one door away from the last room. Oh and one more thing... Make sure you make the RIGHT choice in the airlock chamber ;).\n", + "How many rooms do you think are in the game? (Enter a number): 5\n", + "What's the speed of light (in 10^8 m/s)? (Enter the approximate integer): 3\n", + "You examine control panel. You find key for door a. You answered the questions correctly and earned the key for door D, and you are now in the control room, one step away to the last room!.\n", + "Do you want to go to the next room? Enter 'yes' or 'no'yes\n", + "You are now in control room\n", + "What would you like to do? Type 'explore', 'examine', 'exit' or 'stop the music'? stop the music\n", + "Music stopped.\n", + "You are now in control room\n", + "What would you like to do? Type 'explore', 'examine', 'exit' or 'stop the music'? examine\n", + "What would you like to examine? door d\n", + "You examine door d. You unlock it with a key you have.\n", + "Do you want to go to the next room? Enter 'yes' or 'no'yes\n", + "You're now out of the control room and in the airlock chamber connected to outside, you have to choose to turn left or right. Choosing wrong side will lead you back to the navigation room\n", + "Do you want to turn left or turn right? Enter the word left or right left\n", + "Oops it is a wrong direction. You are now back in the spaceship\n", + "You are now in navigation room\n", + "What would you like to do? Type 'explore', 'examine', 'exit' or 'stop the music'? exit\n", + "Do you want to exit the game? (Enter 'yes' to exit or 'no' to continue): yes\n", + "Thank you for playing. Goodbye!\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n" + ] + } + ], + "source": [ + "#FINAL VERSION - Spaceship theme + PyGame\n", + "\n", + "#add PyGame to have background music\n", + "import pygame\n", + "import random #To select a random item in the treasure box\n", + "\n", + "# Initialize PyGame and set up music\n", + "pygame.init()\n", + "\n", + "pygame.mixer.init()\n", + "pygame.mixer.music.load(\"space-chillout-14194.mp3\") # path added to the music file\n", + "pygame.mixer.music.set_volume(0.5) # Adjust the volume as needed\n", + "\n", + "\n", + "music_stopped = False\n", + "\n", + "\n", + "# Define rooms and items\n", + "couch = {\n", + " \"name\": \"couch\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "desk = {\n", + " \"name\": \"desk\",\n", + " \"type\": \"furniture\"\n", + "} # Irina: new furniture\n", + "\n", + "chair = {\n", + " \"name\": \"chair\",\n", + " \"type\": \"furniture\"\n", + "} # Irina: new furniture\n", + "\n", + "armchair = {\n", + " \"name\": \"armchair\",\n", + " \"type\": \"furniture\"\n", + "} # Irina: new furniture\n", + "\n", + "shelf = {\n", + " \"name\": \"shelf\",\n", + " \"type\": \"furniture\"\n", + "} # Irina: new furniture\n", + "\n", + "sofa = {\n", + " \"name\": \"sofa\",\n", + " \"type\": \"furniture\"\n", + "} # Irina: new furniture\n", + "\n", + "chest_of_drawers = {\n", + " \"name\": \"chest of drawers\",\n", + " \"type\": \"furniture\"\n", + "} # Irina: new furniture\n", + "\n", + "door_a = {\n", + " \"name\": \"door a\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "key_a = {\n", + " \"name\": \"key for door a\",\n", + " \"type\": \"key\",\n", + " \"target\": door_a,\n", + "}\n", + "\n", + "door_b = {\n", + " \"name\": \"door b\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "key_b = {\n", + " \"name\": \"key for door b\",\n", + " \"type\": \"key\",\n", + " \"target\": door_b,\n", + "}\n", + "\n", + "door_c = {\n", + " \"name\": \"door c\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "key_c = {\n", + " \"name\": \"key for door c\",\n", + " \"type\": \"key\",\n", + " \"target\": door_c,\n", + "}\n", + "\n", + "door_d = {\n", + " \"name\": \"door d\",\n", + " \"type\": \"door\",\n", + "}\n", + "\n", + "key_d = {\n", + " \"name\": \"key for door d\",\n", + " \"type\": \"key\",\n", + " \"target\": door_d,\n", + "}\n", + "\n", + "control_panel = {\n", + " \"name\": \"control panel\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "bunk_bed = {\n", + " \"name\": \"bunk bed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "double_bed = {\n", + " \"name\": \"double bed\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "dresser = {\n", + " \"name\": \"dresser\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "emergency_kit = {\n", + " \"name\": \"emergency kit\",\n", + " \"type\": \"furniture\",\n", + "}\n", + "\n", + "# Spaceship\n", + "\n", + "navigation_room = {\n", + " \"name\": \"navigation room\",\n", + " \"type\": \"room\",\n", + "}\n", + "\n", + "cabin_1 = {\n", + " \"name\": \"cabin 1\",\n", + " \"type\": \"room\",\n", + "}\n", + "\n", + "cabin_2 = {\n", + " \"name\": \"cabin 2\",\n", + " \"type\": \"room\",\n", + "}\n", + "\n", + "control_room = {\n", + " \"name\": \"control room\",\n", + " \"type\": \"room\",\n", + "}\n", + "\n", + "airlock_chamber = {\n", + " \"name\": \"Airlock chamber\",\n", + " \"type\": \"room\",\n", + "}\n", + "\n", + "outside = {\n", + " \"name\": \"outside\"\n", + "}\n", + "\n", + "treasure_box = {\n", + " \"name\": \"treasure box\",\n", + " \"type\": \"furniture\",\n", + " \"content\": random.choice([\"one year free unlimited traveling pass in business class\", \"a rocket sticker\", \"a trip for an island of your choice\"])\n", + "} #Amandine new furniture added\n", + "\n", + "random_item = None #intialize random item\n", + "\n", + "all_rooms = [navigation_room, cabin_1, cabin_2, control_room, airlock_chamber, outside]\n", + "\n", + "all_doors = [door_a, door_b, door_c, door_d]\n", + "\n", + "object_relations = {\n", + " \"navigation room\": [couch, control_panel, desk, chair, door_a], #Irina: new furniture added\n", + " \"cabin 1\": [bunk_bed, armchair, shelf, door_c, door_b], #Irina: new furniture added\n", + " \"cabin 2\": [double_bed, chest_of_drawers, dresser, door_b], #Irina: new furniture added\n", + " \"control room\": [emergency_kit, sofa, door_d, door_c, treasure_box], #Irina: new furniture added + Amandine : added treasure box\n", + " \"airlock chamber\" : [outside, navigation_room],#Amandine : added hallway\n", + " \"control panel\": [key_a],\n", + " \"bunk bed\": [key_b],\n", + " \"dresser\": [key_d],\n", + " \"double bed\": [key_c],\n", + " \"door a\": [navigation_room, cabin_1],\n", + " \"door b\": [cabin_1, cabin_2],\n", + " \"door c\": [cabin_1, control_room],\n", + " \"door d\": [control_room, airlock_chamber] #Nhan : change destination to \"hallway\" instead of \"outside\"\n", + "}\n", + "\n", + "\n", + "INIT_GAME_STATE = {\n", + " \"current_room\": navigation_room,\n", + " \"keys_collected\": [],\n", + " \"target_room\": outside\n", + "}\n", + "\n", + "def linebreak():\n", + " print(\"\\n\\n\")\n", + "\n", + "#Amandine : add exit function if the user does not want to play anytime\n", + "def exit_game():\n", + " exit_choice = input(\"Do you want to exit the game? (Enter 'yes' to exit or 'no' to continue): \").strip()\n", + " if exit_choice.lower() == 'yes':\n", + " print(\"Thank you for playing. Goodbye!\")\n", + " exit()\n", + "\n", + "def start_game():\n", + " print(\"You wake up near from the control panel and find yourself in a strange spaceship with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get back to Earth, NOW!\")\n", + "\n", + " # Start playing the music\n", + " pygame.mixer.music.play(-1) # Loop the music\n", + " play_room(game_state[\"current_room\"])\n", + "\n", + "def play_room(room):\n", + " game_state[\"current_room\"] = room\n", + " \n", + " global music_stopped\n", + "\n", + " if(game_state[\"current_room\"] == game_state[\"target_room\"]):\n", + " print(f\"Yeah! You are now on the way to Earth! And you won {random_item}\") #add this to see the item\n", + " else:\n", + " if game_state[\"current_room\"]==airlock_chamber:\n", + " if left_or_right()==True:\n", + " print(\"Congrats! You made the right choice\")\n", + " pygame.mixer.music.stop()\n", + " play_room(game_state[\"target_room\"])\n", + " else:\n", + " print(\"Oops it is a wrong direction. You are now back in the spaceship\")\n", + " game_state[\"current_room\"] = navigation_room # Set the current room back to game room\n", + " play_room(navigation_room) # Play in the game room\n", + " else:\n", + " print(\"You are now in \" + room[\"name\"])\n", + " intended_action = input(\"What would you like to do? Type 'explore', 'examine', 'exit' or 'stop the music'? \").strip()\n", + " if intended_action == \"explore\":\n", + " explore_room(room)\n", + " play_room(room)\n", + " elif intended_action == \"examine\":\n", + " examine_item(input(\"What would you like to examine? \").strip())\n", + " #give the possibility to exit game any time\n", + " elif intended_action == \"stop the music\" and not music_stopped:\n", + " pygame.mixer.music.stop()\n", + " music_stopped = True # Set the flag to True\n", + " print(\"Music stopped.\")\n", + " play_room(room)\n", + " return\n", + " elif intended_action == \"exit\":\n", + " exit_game()\n", + " else:\n", + " print(\"Not sure what you mean. Type 'explore', 'examine', or 'exit'.\")\n", + " play_room(room)\n", + " linebreak()\n", + "\n", + "def explore_room(room):\n", + " items = [i[\"name\"] for i in object_relations[room[\"name\"]]\n", + " ]\n", + " print(\"You explore the room. This is \" + room[\"name\"] + \". You find \" + \", \".join(items))\n", + "\n", + "def get_next_room_of_door(door, current_room):\n", + " connected_rooms = object_relations[door[\"name\"]]\n", + " for room in connected_rooms:\n", + " if not current_room == room:\n", + " return room\n", + "\n", + "def examine_item(item_name):\n", + " global random_item # Use the global random_item variable to print the item\n", + " current_room = game_state[\"current_room\"]\n", + " next_room = \"\"\n", + " output = None\n", + "\n", + " for item in object_relations[current_room[\"name\"]]:\n", + " if item[\"name\"] == item_name:\n", + " output = \"You examine \" + item_name + \". \"\n", + " if item[\"type\"] == \"door\":\n", + " have_key = False\n", + " for key in game_state[\"keys_collected\"]:\n", + " if key[\"target\"] == item:\n", + " have_key = True\n", + " if have_key:\n", + " output += \"You unlock it with a key you have.\"\n", + " next_room = get_next_room_of_door(item, current_room)\n", + " else:\n", + " output += \"It is locked but you don't have the key.\"\n", + "\n", + " elif item[\"name\"] == \"treasure box\":\n", + " # Randomly select an item to put in the box\n", + " random_item = random.choice([\"one year's free, unlimited rocket travel in business class\", \"a rocket sticker\", \"a trip for an island of your choice\"])\n", + " output += f\"You find {random_item} in the box.\"\n", + "\n", + " # Remove the box from the room as it's been examined.\n", + " object_relations[current_room[\"name\"]] = [i for i in object_relations[current_room[\"name\"]] if i[\"name\"] != \"box\"]\n", + "\n", + " else:\n", + " if item[\"name\"] in object_relations and len(object_relations[item[\"name\"]]) > 0:\n", + " item_found = object_relations[item[\"name\"]].pop()\n", + " game_state[\"keys_collected\"].append(item_found)\n", + " output += \"You find \" + item_found[\"name\"] + \". \"\n", + " if item_found[\"name\"] == \"key for door a\":\n", + " if ask_questions():\n", + " output += \"You answered the questions correctly and earned the key for door D, and you are now in the control room, one step away to the last room!.\"\n", + " game_state[\"keys_collected\"].append(key_d)\n", + " next_room = control_room\n", + " else:\n", + " output += \"You answered the questions incorrectly, let's keep exploring.\"\n", + "\n", + " else:\n", + " output += \"There isn't anything interesting about it.\"\n", + " print(output)\n", + " break\n", + "\n", + " if output is None:\n", + " print(\"The item you requested is not found in the current room.\")\n", + "\n", + " if next_room and input(\"Do you want to go to the next room? Enter 'yes' or 'no'\").strip() == 'yes':\n", + " play_room(next_room)\n", + " else:\n", + " play_room(current_room)\n", + "\n", + "def ask_questions():\n", + " print(\"Yay! You have found the key for door A. If you get the next two questions right, you get key D and select if you advance to the control room! You'll be one door away from the last room. Oh and one more thing... Make sure you make the RIGHT choice in the airlock chamber ;).\")\n", + " question1 = input(\"How many rooms do you think are in the game? (Enter a number): \").strip()\n", + " question2 = input(\"What's the speed of light (in 10^8 m/s)? (Enter the approximate integer): \").strip()\n", + "\n", + " if question1 == \"5\" and question2 == \"3\":\n", + " return True\n", + " else:\n", + " return False\n", + "\n", + "def left_or_right():\n", + " print(\"You're now out of the control room and in the airlock chamber connected to outside, you have to choose to turn left or right. Choosing wrong side will lead you back to the navigation room\")\n", + " the_choice = input(\"Do you want to turn left or turn right? Enter the word left or right \") #Add that the user can just enter right or left, otherwise it does not work\n", + " if the_choice ==\"left\":\n", + " return False\n", + " #print(\"Oops it is a wrong direction. You are now back in game room\")\n", + " #start_game()\n", + " else:\n", + " return True\n", + "\n", + "game_state = INIT_GAME_STATE.copy()\n", + "start_game()\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "86118720", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.4" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/Orange-team/Powerpoint_escape_game_team_orange.pptx b/Orange-team/Powerpoint_escape_game_team_orange.pptx new file mode 100644 index 00000000..81986a97 Binary files /dev/null and b/Orange-team/Powerpoint_escape_game_team_orange.pptx differ diff --git a/Orange-team/Py_escape_game_orange_team.py b/Orange-team/Py_escape_game_orange_team.py new file mode 100644 index 00000000..8b218ff9 --- /dev/null +++ b/Orange-team/Py_escape_game_orange_team.py @@ -0,0 +1,350 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[4]: + + +get_ipython().system('pip install pygame') + + +# In[5]: + + +#FINAL VERSION - Spaceship theme + PyGame + +#add PyGame to have background music +import pygame +import random #To select a random item in the treasure box + +# Initialize PyGame and set up music +pygame.init() + +pygame.mixer.init() +pygame.mixer.music.load("space-chillout-14194.mp3") # path added to the music file +pygame.mixer.music.set_volume(0.5) # Adjust the volume as needed + + +music_stopped = False + + +# Define rooms and items +couch = { + "name": "couch", + "type": "furniture", +} + +desk = { + "name": "desk", + "type": "furniture" +} # Irina: new furniture + +chair = { + "name": "chair", + "type": "furniture" +} # Irina: new furniture + +armchair = { + "name": "armchair", + "type": "furniture" +} # Irina: new furniture + +shelf = { + "name": "shelf", + "type": "furniture" +} # Irina: new furniture + +sofa = { + "name": "sofa", + "type": "furniture" +} # Irina: new furniture + +chest_of_drawers = { + "name": "chest of drawers", + "type": "furniture" +} # Irina: new furniture + +door_a = { + "name": "door a", + "type": "door", +} + +key_a = { + "name": "key for door a", + "type": "key", + "target": door_a, +} + +door_b = { + "name": "door b", + "type": "door", +} + +key_b = { + "name": "key for door b", + "type": "key", + "target": door_b, +} + +door_c = { + "name": "door c", + "type": "door", +} + +key_c = { + "name": "key for door c", + "type": "key", + "target": door_c, +} + +door_d = { + "name": "door d", + "type": "door", +} + +key_d = { + "name": "key for door d", + "type": "key", + "target": door_d, +} + +control_panel = { + "name": "control panel", + "type": "furniture", +} + +bunk_bed = { + "name": "bunk bed", + "type": "furniture", +} + +double_bed = { + "name": "double bed", + "type": "furniture", +} + +dresser = { + "name": "dresser", + "type": "furniture", +} + +emergency_kit = { + "name": "emergency kit", + "type": "furniture", +} + +# Spaceship + +navigation_room = { + "name": "navigation room", + "type": "room", +} + +cabin_1 = { + "name": "cabin 1", + "type": "room", +} + +cabin_2 = { + "name": "cabin 2", + "type": "room", +} + +control_room = { + "name": "control room", + "type": "room", +} + +airlock_chamber = { + "name": "Airlock chamber", + "type": "room", +} + +outside = { + "name": "outside" +} + +treasure_box = { + "name": "treasure box", + "type": "furniture", + "content": random.choice(["one year free unlimited traveling pass in business class", "a rocket sticker", "a trip for an island of your choice"]) +} #Amandine new furniture added + +random_item = None #intialize random item + +all_rooms = [navigation_room, cabin_1, cabin_2, control_room, airlock_chamber, outside] + +all_doors = [door_a, door_b, door_c, door_d] + +object_relations = { + "navigation room": [couch, control_panel, desk, chair, door_a], #Irina: new furniture added + "cabin 1": [bunk_bed, armchair, shelf, door_c, door_b], #Irina: new furniture added + "cabin 2": [double_bed, chest_of_drawers, dresser, door_b], #Irina: new furniture added + "control room": [emergency_kit, sofa, door_d, door_c, treasure_box], #Irina: new furniture added + Amandine : added treasure box + "airlock chamber" : [outside, navigation_room],#Amandine : added hallway + "control panel": [key_a], + "bunk bed": [key_b], + "dresser": [key_d], + "double bed": [key_c], + "door a": [navigation_room, cabin_1], + "door b": [cabin_1, cabin_2], + "door c": [cabin_1, control_room], + "door d": [control_room, airlock_chamber] #Nhan : change destination to "hallway" instead of "outside" +} + + +INIT_GAME_STATE = { + "current_room": navigation_room, + "keys_collected": [], + "target_room": outside +} + +def linebreak(): + print("\n\n") + +#Amandine : add exit function if the user does not want to play anytime +def exit_game(): + exit_choice = input("Do you want to exit the game? (Enter 'yes' to exit or 'no' to continue): ").strip() + if exit_choice.lower() == 'yes': + print("Thank you for playing. Goodbye!") + exit() + +def start_game(): + print("You wake up near from the control panel and find yourself in a strange spaceship with no windows which you have never been to before. You don't remember why you are here and what had happened before. You feel some unknown danger is approaching and you must get back to Earth, NOW!") + + # Start playing the music + pygame.mixer.music.play(-1) # Loop the music + play_room(game_state["current_room"]) + +def play_room(room): + game_state["current_room"] = room + + global music_stopped + + if(game_state["current_room"] == game_state["target_room"]): + print(f"Yeah! You are now on the way to Earth! And you won {random_item}") #add this to see the item + else: + if game_state["current_room"]==airlock_chamber: + if left_or_right()==True: + print("Congrats! You made the right choice") + pygame.mixer.music.stop() + play_room(game_state["target_room"]) + else: + print("Oops it is a wrong direction. You are now back in the spaceship") + game_state["current_room"] = navigation_room # Set the current room back to game room + play_room(navigation_room) # Play in the game room + else: + print("You are now in " + room["name"]) + intended_action = input("What would you like to do? Type 'explore', 'examine', 'exit' or 'stop the music'? ").strip() + if intended_action == "explore": + explore_room(room) + play_room(room) + elif intended_action == "examine": + examine_item(input("What would you like to examine? ").strip()) + #give the possibility to exit game any time + elif intended_action == "stop the music" and not music_stopped: + pygame.mixer.music.stop() + music_stopped = True # Set the flag to True + print("Music stopped.") + play_room(room) + return + elif intended_action == "exit": + exit_game() + else: + print("Not sure what you mean. Type 'explore', 'examine', or 'exit'.") + play_room(room) + linebreak() + +def explore_room(room): + items = [i["name"] for i in object_relations[room["name"]] + ] + print("You explore the room. This is " + room["name"] + ". You find " + ", ".join(items)) + +def get_next_room_of_door(door, current_room): + connected_rooms = object_relations[door["name"]] + for room in connected_rooms: + if not current_room == room: + return room + +def examine_item(item_name): + global random_item # Use the global random_item variable to print the item + current_room = game_state["current_room"] + next_room = "" + output = None + + for item in object_relations[current_room["name"]]: + if item["name"] == item_name: + output = "You examine " + item_name + ". " + if item["type"] == "door": + have_key = False + for key in game_state["keys_collected"]: + if key["target"] == item: + have_key = True + if have_key: + output += "You unlock it with a key you have." + next_room = get_next_room_of_door(item, current_room) + else: + output += "It is locked but you don't have the key." + + elif item["name"] == "treasure box": + # Randomly select an item to put in the box + random_item = random.choice(["one year's free, unlimited rocket travel in business class", "a rocket sticker", "a trip for an island of your choice"]) + output += f"You find {random_item} in the box." + + # Remove the box from the room as it's been examined. + object_relations[current_room["name"]] = [i for i in object_relations[current_room["name"]] if i["name"] != "box"] + + else: + if item["name"] in object_relations and len(object_relations[item["name"]]) > 0: + item_found = object_relations[item["name"]].pop() + game_state["keys_collected"].append(item_found) + output += "You find " + item_found["name"] + ". " + if item_found["name"] == "key for door a": + if ask_questions(): + output += "You answered the questions correctly and earned the key for door D, and you are now in the control room, one step away to the last room!." + game_state["keys_collected"].append(key_d) + next_room = control_room + else: + output += "You answered the questions incorrectly, let's keep exploring." + + else: + output += "There isn't anything interesting about it." + print(output) + break + + if output is None: + print("The item you requested is not found in the current room.") + + if next_room and input("Do you want to go to the next room? Enter 'yes' or 'no'").strip() == 'yes': + play_room(next_room) + else: + play_room(current_room) + +def ask_questions(): + print("Yay! You have found the key for door A. If you get the next two questions right, you get key D and select if you advance to the control room! You'll be one door away from the last room. Oh and one more thing... Make sure you make the RIGHT choice in the airlock chamber ;).") + question1 = input("How many rooms do you think are in the game? (Enter a number): ").strip() + question2 = input("What's the speed of light (in 10^8 m/s)? (Enter the approximate integer): ").strip() + + if question1 == "5" and question2 == "3": + return True + else: + return False + +def left_or_right(): + print("You're now out of the control room and in the airlock chamber connected to outside, you have to choose to turn left or right. Choosing wrong side will lead you back to the navigation room") + the_choice = input("Do you want to turn left or turn right? Enter the word left or right ") #Add that the user can just enter right or left, otherwise it does not work + if the_choice =="left": + return False + #print("Oops it is a wrong direction. You are now back in game room") + #start_game() + else: + return True + +game_state = INIT_GAME_STATE.copy() +start_game() + + +# In[ ]: + + + + diff --git a/Orange-team/space-chillout-14194.mp3 b/Orange-team/space-chillout-14194.mp3 new file mode 100644 index 00000000..2669ae39 Binary files /dev/null and b/Orange-team/space-chillout-14194.mp3 differ