diff --git a/overcooked_simulator/game_content/environment_config.yaml b/overcooked_simulator/game_content/environment_config.yaml index 4b3a9c2641cc06475cb1cf7c68e25b187453e375..1bee3dc305347749bc72b8cb649be7ad018c6980 100644 --- a/overcooked_simulator/game_content/environment_config.yaml +++ b/overcooked_simulator/game_content/environment_config.yaml @@ -4,4 +4,4 @@ plates: plate_delay: [ 5, 10 ] game: - time_limit_seconds: 5.0 + time_limit_seconds: 30.0 diff --git a/overcooked_simulator/gui_2d_vis/gui_theme.json b/overcooked_simulator/gui_2d_vis/gui_theme.json index 3ca11b55479e8d69bbbf8ab0e3fc4b46cad713e7..3db73ba4a5fa0311c6ddca21d0c538aeaab38e35 100644 --- a/overcooked_simulator/gui_2d_vis/gui_theme.json +++ b/overcooked_simulator/gui_2d_vis/gui_theme.json @@ -45,5 +45,23 @@ "misc": { "tool_tip_delay": "1.5" } + }, + "#timer_label": { + "colours": { + "normal_text": "#000000" + }, + "font": { + "size": 20, + "bold": 1 + } + }, + "#score_label": { + "colours": { + "normal_text": "#000000" + }, + "font": { + "size": 20, + "bold": 1 + } } } \ No newline at end of file diff --git a/overcooked_simulator/gui_2d_vis/overcooked_gui.py b/overcooked_simulator/gui_2d_vis/overcooked_gui.py index 89a3acc8725a3b79b0fb72cd284e4a1e6cad95c4..39aa1e7afe38474c8c4043ccf38409d39afaa271 100644 --- a/overcooked_simulator/gui_2d_vis/overcooked_gui.py +++ b/overcooked_simulator/gui_2d_vis/overcooked_gui.py @@ -489,9 +489,9 @@ class PyGameGUI: def update_score_label(self, state): score = state["score"] - self.score_label.set_text(f"Your Score is {score}") + self.score_label.set_text(f"Your score is {score}") - def draw_time(self, remaining_time: timedelta): + def update_remaining_time(self, remaining_time: timedelta): hours, rem = divmod(remaining_time.seconds, 3600) minutes, seconds = divmod(rem, 60) display_time = f"{minutes}:{'%02d' % seconds}" @@ -509,7 +509,7 @@ class PyGameGUI: self.draw_counters(state) self.draw_players(state) self.manager.draw_ui(self.main_window) - self.draw_time(state["remaining_time"]) + self.update_remaining_time(state["remaining_time"]) def init_ui_elements(self): self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) @@ -606,7 +606,7 @@ class PyGameGUI: text="GAMETIME", relative_rect=pygame.Rect( (0, 0), - (button_width, button_height), + (button_width * 1.5, button_height), ), manager=self.manager, object_id="#timer_label", @@ -717,13 +717,11 @@ class PyGameGUI: pygame.init() pygame.font.init() - # self.setup_windows() - self.init_ui_elements() - pygame.display.set_caption("Simple Overcooked Simulator") clock = pygame.time.Clock() + self.init_ui_elements() self.manage_button_visibility() # Game loop @@ -736,6 +734,8 @@ class PyGameGUI: for event in pygame.event.get(): if event.type == pygame.QUIT: self.running = False + + # UI Buttons: if event.type == pygame_gui.UI_BUTTON_PRESSED: match event.ui_element: case self.start_button: