diff --git a/backend/app.py b/backend/app.py index 7374fce..b0ea145 100644 --- a/backend/app.py +++ b/backend/app.py @@ -37,7 +37,7 @@ def fetch_object_ids(mode): """ Fetches met museum api for all object ids. """ - if mode == "": + if mode == "classic": url = "https://collectionapi.metmuseum.org/public/collection/v1/objects" else: base_url = "https://collectionapi.metmuseum.org/public/collection/v1/objects?departmentIds=" @@ -155,11 +155,8 @@ def create_game(mode): - Image """ print("Creating game...") - if mode == "": - print("Selected mode: Classic") - else: - print(f"Selected mode: {mode}") - + print(f"Selected mode: {mode}") + # get all objects object_ids = fetch_object_ids(mode) random.shuffle(object_ids) diff --git a/frontend/src/Pages/Game/Start.js b/frontend/src/Pages/Game/Start.js index d18d6d9..744af69 100644 --- a/frontend/src/Pages/Game/Start.js +++ b/frontend/src/Pages/Game/Start.js @@ -28,12 +28,12 @@ export default function Start() { /** * gamemodes: - * "" is classic + * "classic" * "asian" * "medieval" * "music" */ - const [mode, setMode] = useState(""); + const [mode, setMode] = useState("classic"); // game state to be shared by all game pages const [gameState, setGameState] = useState({ @@ -107,7 +107,7 @@ const Menu = ({ setStage, setMode }) => { }} onClick={() => { setStage("game"); - setMode(""); + setMode("classic"); }} >