diff --git a/overcooked_simulator/game_content/layouts/basic.layout b/overcooked_simulator/game_content/layouts/basic.layout index 5238c21f86c487ed90ff8efc6a373c6213d1f6c9..ad384a856540f159b4d8f9d95eebf3c6904829a7 100644 --- a/overcooked_simulator/game_content/layouts/basic.layout +++ b/overcooked_simulator/game_content/layouts/basic.layout @@ -2,7 +2,7 @@ #__________M |__________K $__________I -#__A_____A_D +#__A#$#__A_D C__________E C__________G #__________# diff --git a/overcooked_simulator/game_content/layouts/tutorial.layout b/overcooked_simulator/game_content/layouts/tutorial.layout index 9e80a7e4ffd96d1f2fe76aab7f9a556c6bcea21a..8f4cf0f8ffa67a79836f4f0e69bbb0f2ec60410e 100644 --- a/overcooked_simulator/game_content/layouts/tutorial.layout +++ b/overcooked_simulator/game_content/layouts/tutorial.layout @@ -1,4 +1,5 @@ #C## -T__$ -L__# +#__X +T__# +L__$ #P## diff --git a/overcooked_simulator/game_content/tutorial_env_config.yaml b/overcooked_simulator/game_content/tutorial_env_config.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cff3c29bc1aad863e9c1a8c3e57a5bca57b5d7fe --- /dev/null +++ b/overcooked_simulator/game_content/tutorial_env_config.yaml @@ -0,0 +1,157 @@ +plates: + clean_plates: 2 + dirty_plates: 0 + plate_delay: [ 5, 10 ] + # range of seconds until the dirty plate arrives. + +game: + time_limit_seconds: 90000 + +meals: + all: true + # if all: false -> only orders for these meals are generated + # TODO: what if this list is empty? + list: + - TomatoSoup + - OnionSoup + - Salad + +layout_chars: + _: Free + hash: Counter # # + A: Agent + pipe: Extinguisher + P: PlateDispenser + C: CuttingBoard + X: Trashcan + $: ServingWindow + S: Sink + +: SinkAddon + at: Plate # @ just a clean plate on a counter + U: Pot # with Stove + Q: Pan # with Stove + O: Peel # with Oven + F: Basket # with DeepFryer + T: Tomato + N: Onion # oNioN + L: Lettuce + K: Potato # Kartoffel + I: Fish # fIIIsh + D: Dough + E: Cheese # chEEEse + G: Sausage # sausaGe + B: Bun + M: Meat + question: Counter # ? mushroom + ↓: Counter + ^: Counter + right: Counter + left: Counter + wave: Free # ~ Water + minus: Free # - Ice + dquote: Counter # " wall/truck + p: Counter # second plate return ?? + + +orders: + order_gen_class: !!python/name:overcooked_simulator.order.RandomOrderGeneration '' + # the class to that receives the kwargs. Should be a child class of OrderGeneration in order.py + order_gen_kwargs: + order_duration_random_func: + # how long should the orders be alive + # 'random' library call with getattr, kwargs are passed to the function + func: uniform + kwargs: + a: 40 + b: 60 + max_orders: 6 + # maximum number of active orders at the same time + num_start_meals: 2 + # number of orders generated at the start of the environment + sample_on_dur_random_func: + # 'random' library call with getattr, kwargs are passed to the function + func: uniform + kwargs: + a: 10 + b: 20 + sample_on_serving: false + # Sample the delay for the next order only after a meal was served. + score_calc_gen_func: !!python/name:overcooked_simulator.order.simple_score_calc_gen_func '' + score_calc_gen_kwargs: + # the kwargs for the score_calc_gen_func + other: 20 + scores: + Burger: 15 + OnionSoup: 10 + Salad: 5 + TomatoSoup: 10 + expired_penalty_func: !!python/name:overcooked_simulator.order.simple_expired_penalty '' + expired_penalty_kwargs: + default: -5 + serving_not_ordered_meals: !!python/name:overcooked_simulator.order.serving_not_ordered_meals_with_zero_score '' + # a func that calcs a store for not ordered but served meals. Input: meal + penalty_for_trash: !!python/name:overcooked_simulator.order.penalty_for_each_item '' + # a func that calcs the penalty for items that the player puts into the trashcan. + +player_config: + radius: 0.4 + player_speed_units_per_seconds: 6 + interaction_range: 1.6 + restricted_view: False + view_angle: 70 + view_range: 5.5 # in grid units, can be "null" + +effect_manager: + FireManager: + class: !!python/name:overcooked_simulator.effect_manager.FireEffectManager '' + kwargs: + spreading_duration: [ 5, 10 ] + fire_burns_ingredients_and_meals: true + + +extra_setup_functions: + # json_states: + # func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' + # kwargs: + # hooks: [ json_state ] + # log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' + # log_class_kwargs: + # log_path: USER_LOG_DIR/ENV_NAME/json_states.jsonl + actions: + func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' + kwargs: + hooks: [ pre_perform_action ] + log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' + log_class_kwargs: + log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl + random_env_events: + func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' + kwargs: + hooks: [ order_duration_sample, plate_out_of_kitchen_time ] + log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' + log_class_kwargs: + log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl + add_hook_ref: true + env_configs: + func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' + kwargs: + hooks: [ env_initialized, item_info_config ] + log_class: !!python/name:overcooked_simulator.recording.LogRecorder '' + log_class_kwargs: + log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl + add_hook_ref: true +# info_msg: +# func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' +# kwargs: +# hooks: [ cutting_board_100 ] +# log_class: !!python/name:overcooked_simulator.info_msg.InfoMsgManager '' +# log_class_kwargs: +# msg: Glückwunsch du hast was geschnitten! +# fire_msg: +# func: !!python/name:overcooked_simulator.recording.class_recording_with_hooks '' +# kwargs: +# hooks: [ new_fire ] +# log_class: !!python/name:overcooked_simulator.info_msg.InfoMsgManager '' +# log_class_kwargs: +# msg: Feuer, Feuer, Feuer +# level: Warning \ 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 f11cdd346d0746d420b1487b77d021e8448cd0f1..772504b2fa21e6aeed410c0164500945d9d42fca 100644 --- a/overcooked_simulator/gui_2d_vis/overcooked_gui.py +++ b/overcooked_simulator/gui_2d_vis/overcooked_gui.py @@ -253,6 +253,29 @@ class PyGameGUI: if event.type == pygame.KEYDOWN: key_set.next_player() + def set_window_size(self): + if self.fullscreen: + flags = pygame.FULLSCREEN + self.window_width = self.window_width_fullscreen + self.window_height = self.window_height_fullscreen + else: + flags = 0 + self.window_width = self.window_width_windowed + self.window_height = self.window_height_windowed + + self.main_window = pygame.display.set_mode( + ( + self.window_width, + self.window_height, + ), + flags=flags, + ) + + def reset_window_size(self): + self.game_width = 0 + self.game_height = 0 + self.set_window_size() + def set_game_size(self, max_width=None, max_height=None): if max_width is None: max_width = self.window_width - (2 * self.screen_margin) @@ -286,10 +309,20 @@ class PyGameGUI: self.game_width -= residual_x self.game_height -= residual_y - def show_start_screen(self): + self.game_screen = pygame.Surface( + ( + self.game_width, + self.game_height, + ) + ) + + def init_ui_elements(self): self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") + ######################################################################## + # Start screen + ######################################################################## self.start_button = pygame_gui.elements.UIButton( relative_rect=pygame.Rect( (0, 0), (self.buttons_width, self.buttons_height) @@ -299,36 +332,16 @@ class PyGameGUI: anchors={"center": "center"}, ) - quit_rect = pygame.Rect( - ( - 0, - 0, - ), - (self.buttons_width, self.buttons_height), - ) - quit_rect.topright = (0, 0) + rect = pygame.Rect((0, 0), (self.buttons_width, self.buttons_height)) + rect.topright = (0, 0) self.quit_button = pygame_gui.elements.UIButton( - relative_rect=quit_rect, + relative_rect=rect, text="Quit Game", manager=self.manager, object_id="#quit_button", anchors={"right": "right", "top": "top"}, ) - fullscreen_button_rect = pygame.Rect( - (0, 0), (self.buttons_width * 0.7, self.buttons_height) - ) - fullscreen_button_rect.topright = (-self.buttons_width, 0) - self.fullscreen_button = pygame_gui.elements.UIButton( - relative_rect=fullscreen_button_rect, - text="Fullscreen", - manager=self.manager, - object_id="#fullscreen_button", - anchors={"right": "right", "top": "top"}, - ) - - ####################### - player_selection_rect = pygame.Rect( (0, 0), ( @@ -460,14 +473,12 @@ class PyGameGUI: anchors={"left": "left", "centery": "centery"}, ) - self.update_selection_elements() - - def show_tutorial_screen(self): - self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) - self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") + ######################################################################## + # Tutorial screen + ######################################################################## image = pygame.image.load( - ROOT_DIR / "gui_2d_vis" / "controller_tutorial.png" + ROOT_DIR / "gui_2d_vis" / "tutorial.png" ).convert_alpha() image_rect = image.get_rect() image_rect.topleft = (40, 40) @@ -477,7 +488,7 @@ class PyGameGUI: manager=self.manager, anchors={"top": "top", "left": "left"}, ) - img_height = self.window_height * 0.8 + img_height = self.window_height * 0.75 img_width = img_height * (image_rect.width / image_rect.height) new_dims = (img_width, img_height) self.tutorial_image.set_dimensions(new_dims) @@ -494,7 +505,7 @@ class PyGameGUI: fullscreen_button_rect = pygame.Rect( (0, 0), (self.buttons_width * 0.7, self.buttons_height) ) - fullscreen_button_rect.topright = (0, 0) + fullscreen_button_rect.topright = (-self.buttons_width, 0) self.fullscreen_button = pygame_gui.elements.UIButton( relative_rect=fullscreen_button_rect, text="Fullscreen", @@ -503,34 +514,16 @@ class PyGameGUI: anchors={"right": "right", "top": "top"}, ) - if SHOW_TUTORIAL_GAME: - self.setup_environment(tutorial=True) - - self.key_sets = self.setup_player_keys( - min(self.number_humans_to_be_added, 1), disjunct=False - ) - - self.vis.create_player_colors(self.number_players) - self.reset_gui_values() - self.set_game_size( - max_height=self.window_height * 0.4, max_width=self.window_width * 0.4 - ) - self.set_window_size() - self.game_center = ( - self.window_width - self.game_width // 2 - 20, - self.window_height / 2 + 100, - ) - - def show_pre_game_screen(self): - self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) - self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") + ######################################################################## + # PreGame screen + ######################################################################## image = pygame.image.load( ROOT_DIR / "gui_2d_vis" / "recipe_mock.png" ).convert_alpha() image_rect = image.get_rect() image_rect.top = 50 - self.tutorial_image = pygame_gui.elements.UIImage( + self.recipe_image = pygame_gui.elements.UIImage( image_rect, image, manager=self.manager, @@ -539,7 +532,7 @@ class PyGameGUI: img_height = self.window_height * 0.7 img_width = img_height * (image_rect.width / image_rect.height) new_dims = (img_width, img_height) - self.tutorial_image.set_dimensions(new_dims) + self.recipe_image.set_dimensions(new_dims) self.level_name = pygame_gui.elements.UILabel( text=f"Next level: {self.layout_file_paths[self.current_layout_idx].stem}", @@ -552,30 +545,9 @@ class PyGameGUI: anchors={"centerx": "centerx", "top": "top"}, ) - button_rect = pygame.Rect((0, 0), (220, 80)) - button_rect.bottom = -20 - self.continue_button = pygame_gui.elements.UIButton( - relative_rect=button_rect, - text="Continue", - manager=self.manager, - anchors={"centerx": "centerx", "bottom": "bottom"}, - ) - - fullscreen_button_rect = pygame.Rect( - (0, 0), (self.buttons_width * 0.7, self.buttons_height) - ) - fullscreen_button_rect.topright = (0, 0) - self.fullscreen_button = pygame_gui.elements.UIButton( - relative_rect=fullscreen_button_rect, - text="Fullscreen", - manager=self.manager, - object_id="#fullscreen_button", - anchors={"right": "right", "top": "top"}, - ) - - def show_game_screen(self): - self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) - self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") + ######################################################################## + # Game screen + ######################################################################## self.finished_button = pygame_gui.elements.UIButton( relative_rect=pygame.Rect( @@ -616,14 +588,14 @@ class PyGameGUI: object_id="#timer_label", ) - def show_post_game_screen(self): - self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) - self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") + ######################################################################## + # PostGame screen + ######################################################################## conclusion_rect = pygame.Rect(0, 0, self.window_width, self.window_height * 0.4) conclusion_rect.top = 50 self.conclusion_label = pygame_gui.elements.UILabel( - text="Your final score was _", + text="not set", relative_rect=conclusion_rect, manager=self.manager, object_id="#score_label", @@ -660,30 +632,14 @@ class PyGameGUI: object_id="#split_players_button", ) - def show_end_screen(self): - self.manager = pygame_gui.UIManager((self.window_width, self.window_height)) - self.manager.get_theme().load_theme(ROOT_DIR / "gui_2d_vis" / "gui_theme.json") - - quit_rect = pygame.Rect( - ( - 0, - 0, - ), - (self.buttons_width, self.buttons_height), - ) - quit_rect.topright = (0, 0) - self.quit_button = pygame_gui.elements.UIButton( - relative_rect=quit_rect, - text="Quit Game", - manager=self.manager, - object_id="#quit_button", - anchors={"right": "right", "top": "top"}, - ) + ######################################################################## + # End screen + ######################################################################## conclusion_rect = pygame.Rect( 0, 0, self.window_width * 0.6, self.window_height * 0.4 ) - self.conclusion_label = pygame_gui.elements.UILabel( + self.thank_you_label = pygame_gui.elements.UILabel( text="Thank you!", relative_rect=conclusion_rect, manager=self.manager, @@ -691,20 +647,91 @@ class PyGameGUI: anchors={"center": "center"}, ) - def update_screen(self): + ######################################################################## + + self.start_screen_elements = [ + self.start_button, + self.quit_button, + self.fullscreen_button, + self.player_selection_container, + ] + + self.tutorial_screen_elements = [ + self.tutorial_image, + self.continue_button, + self.fullscreen_button, + self.quit_button, + ] + + self.pregame_screen_elements = [ + self.recipe_image, + self.level_name, + self.continue_button, + self.quit_button, + self.fullscreen_button, + ] + + self.game_screen_elements = [ + self.finished_button, + self.orders_label, + self.score_label, + self.quit_button, + self.fullscreen_button, + self.timer_label, + ] + self.postgame_screen_elements = [ + self.conclusion_label, + self.next_game_button, + self.fullscreen_button, + self.retry_button, + self.quit_button, + self.finish_study_button, + ] + self.end_screen_elements = [ + self.fullscreen_button, + self.quit_button, + self.thank_you_label, + ] + + def show_screen_elements(self, elements: list): + for element in ( + self.start_screen_elements + + self.tutorial_screen_elements + + self.pregame_screen_elements + + self.game_screen_elements + + self.postgame_screen_elements + + self.end_screen_elements + ): + element.hide() + for element in elements: + element.show() + + def update_screen_elements(self): match self.menu_state: case MenuStates.Start: - self.show_start_screen() + self.show_screen_elements(self.start_screen_elements) + self.update_selection_elements() case MenuStates.ControllerTutorial: - self.show_tutorial_screen() + self.show_screen_elements(self.tutorial_screen_elements) + self.reset_gui_values() + self.setup_game(tutorial=True) + self.set_game_size( + max_height=self.window_height * 0.4, + max_width=self.window_width * 0.4, + ) + self.set_window_size() + self.game_center = ( + self.window_width - self.game_width / 2 - 30, + self.window_height - self.game_height / 2 - 50, + ) case MenuStates.PreGame: - self.show_pre_game_screen() + self.show_screen_elements(self.pregame_screen_elements) case MenuStates.Game: - self.show_game_screen() + self.show_screen_elements(self.game_screen_elements) case MenuStates.PostGame: - self.show_post_game_screen() + self.show_screen_elements(self.postgame_screen_elements) case MenuStates.End: - self.show_end_screen() + self.show_screen_elements(self.end_screen_elements) def draw_main_window(self): self.main_window.fill( @@ -818,37 +845,6 @@ class PyGameGUI: ), ) - def set_window_size(self): - self.game_screen = pygame.Surface( - ( - self.game_width, - self.game_height, - ) - ) - - if self.fullscreen: - flags = pygame.FULLSCREEN - self.window_width = self.window_width_fullscreen - self.window_height = self.window_height_fullscreen - else: - flags = 0 - self.window_width = self.window_width_windowed - self.window_height = self.window_height_windowed - - self.main_window = pygame.display.set_mode( - ( - self.window_width, - self.window_height, - ), - flags=flags, - # display=0, - ) - - def reset_window_size(self): - self.game_width = 0 - self.game_height = 0 - self.set_window_size() - def update_score_label(self, state): score = state["score"] self.score_label.set_text(f"Score {score}") @@ -871,13 +867,15 @@ class PyGameGUI: self.key_sets[0].current_player = int(self.player_info["player_id"]) self.player_info = {self.player_info["player_id"]: self.player_info} else: - environment_config_path = ( - ROOT_DIR / "game_content" / "environment_config.yaml" - ) - if tutorial: layout_path = ROOT_DIR / "game_content" / "layouts" / "tutorial.layout" + environment_config_path = ( + ROOT_DIR / "game_content" / "tutorial_env_config.yaml" + ) else: + environment_config_path = ( + ROOT_DIR / "game_content" / "environment_config.yaml" + ) layout_path = self.layout_file_paths[self.current_layout_idx] item_info_path = ROOT_DIR / "game_content" / "item_info.yaml" @@ -891,7 +889,7 @@ class PyGameGUI: seed = 161616161616 creation_json = CreateEnvironmentConfig( manager_id=self.manager_id, - number_players=self.number_players, + number_players=1 if tutorial else self.number_players, environment_settings={"all_player_can_pause_game": False}, item_info_config=item_info, environment_config=environment_config, @@ -1005,9 +1003,7 @@ class PyGameGUI: self.kitchen_width = state["kitchen"]["width"] self.kitchen_height = state["kitchen"]["height"] - def start_button_press(self): - self.show_start_screen() - + def setup_game(self, tutorial=False): self.number_players = ( self.number_humans_to_be_added + self.number_bots_to_be_added ) @@ -1022,11 +1018,10 @@ class PyGameGUI: min(self.number_humans_to_be_added, num_key_set), self.split_players ) - self.setup_environment() + self.setup_environment(tutorial=tutorial) - self.set_game_size() - self.set_window_size() - log.debug("Pressed start button") + # self.set_game_size() + # self.set_window_size() def back_button_press(self): self.menu_state = MenuStates.Start @@ -1036,11 +1031,6 @@ class PyGameGUI: log.debug("Pressed back button") - def quit_button_press(self): - self.running = False - self.menu_state = MenuStates.Start - log.debug("Pressed quit button") - def reset_button_press(self): if not CONNECT_WITH_STUDY_SERVER: requests.post( @@ -1055,16 +1045,21 @@ class PyGameGUI: # self.websocket.send(json.dumps("reset_game")) # answer = self.websocket.recv() log.debug("Pressed reset button") - def finished_button_press(self): + def stop_game(self, reason: str) -> None: + self.disconnect_websockets() + log.debug(f"Stopping game: {reason}") if not CONNECT_WITH_STUDY_SERVER: requests.post( f"{self.request_url}/manage/stop_env/", json={ "manager_id": self.manager_id, "env_id": self.current_env_id, - "reason": "finish button pressed", + "reason": reason, }, ) + + def finished_button_press(self): + self.stop_game("finished_button_pressed") self.menu_state = MenuStates.PostGame self.reset_window_size() log.debug("Pressed finished button") @@ -1072,6 +1067,7 @@ class PyGameGUI: def fullscreen_button_press(self): self.fullscreen = not self.fullscreen self.set_window_size() + self.init_ui_elements() self.set_game_size() def reset_gui_values(self): @@ -1169,6 +1165,17 @@ class PyGameGUI: websocket.close() def manage_button_event(self, event): + if event.ui_element == self.quit_button: + self.running = False + self.disconnect_websockets() + self.menu_state = MenuStates.Start + log.debug("Pressed quit button") + + elif event.ui_element == self.fullscreen_button: + self.fullscreen_button_press() + log.debug("Pressed fullscreen button") + + # Filter by shown screen page match self.menu_state: ############################################ case MenuStates.Start: @@ -1182,10 +1189,6 @@ class PyGameGUI: else: self.menu_state = MenuStates.ControllerTutorial - case self.quit_button: - self.quit_button_press() - self.disconnect_websockets() - case self.add_human_player_button: self.number_humans_to_be_added += 1 case self.remove_human_button: @@ -1208,28 +1211,23 @@ class PyGameGUI: else: self.player_minimum = 1 - case self.fullscreen_button: - self.fullscreen_button_press() - ############################################ case MenuStates.ControllerTutorial: match event.ui_element: case self.continue_button: self.menu_state = MenuStates.PreGame - self.disconnect_websockets() - case self.fullscreen_button: - self.fullscreen_button_press() + self.stop_game("tutorial_finished") ############################################ case MenuStates.PreGame: match event.ui_element: case self.continue_button: + self.setup_game() + self.set_game_size() + self.set_window_size() self.menu_state = MenuStates.Game - self.start_button_press() - case self.fullscreen_button: - self.fullscreen_button_press() ############################################ @@ -1245,7 +1243,7 @@ class PyGameGUI: case MenuStates.PostGame: match event.ui_element: case self.retry_button: - self.start_button_press() + self.setup_game() self.menu_state = MenuStates.PreGame case self.next_game_button: @@ -1256,7 +1254,7 @@ class PyGameGUI: log.debug( f"LEVEL: {self.layout_file_paths[self.current_layout_idx]}" ) - self.start_button_press() + self.setup_game() self.menu_state = MenuStates.PreGame case self.finish_study_button: @@ -1266,9 +1264,8 @@ class PyGameGUI: case MenuStates.End: match event.ui_element: - case self.quit_button: - self.quit_button_press() - self.disconnect_websockets() + case other: + pass def start_pygame(self): """Starts pygame and the gui loop. Each frame the game state is visualized and keyboard inputs are read.""" @@ -1281,7 +1278,9 @@ class PyGameGUI: clock = pygame.time.Clock() self.reset_window_size() - self.show_start_screen() + self.init_ui_elements() + + self.update_screen_elements() # Game loop self.running = True @@ -1289,13 +1288,14 @@ class PyGameGUI: try: self.time_delta = clock.tick(self.FPS) / 1000 + # PROCESSING EVENTS for event in pygame.event.get(): if event.type == pygame.QUIT: self.running = False if event.type == pygame_gui.UI_BUTTON_PRESSED: self.manage_button_event(event) - self.update_screen() + self.update_screen_elements() self.update_selection_elements() if event.type in [ @@ -1309,13 +1309,13 @@ class PyGameGUI: self.manager.process_events(event) - # drawing: + # DRAWING self.draw_main_window() except (KeyboardInterrupt, SystemExit): self.running = False - self.disconnect_websockets() + self.stop_game("Program exited") pygame.quit() sys.exit() diff --git a/overcooked_simulator/gui_2d_vis/controller_tutorial.png b/overcooked_simulator/gui_2d_vis/tutorial.png similarity index 52% rename from overcooked_simulator/gui_2d_vis/controller_tutorial.png rename to overcooked_simulator/gui_2d_vis/tutorial.png index 5b36df266fc541df523916dbe3e436d6650f05d4..151f8e85b9a76c30df20d334be4deffd8d4e3d6a 100644 Binary files a/overcooked_simulator/gui_2d_vis/controller_tutorial.png and b/overcooked_simulator/gui_2d_vis/tutorial.png differ diff --git a/overcooked_simulator/gui_2d_vis/visualization.yaml b/overcooked_simulator/gui_2d_vis/visualization.yaml index a0d7989c1c1bf9c2a96fcc28e1baf09bcd96e55e..7c664c1c372923ebec5bffb14a21a9656813389b 100644 --- a/overcooked_simulator/gui_2d_vis/visualization.yaml +++ b/overcooked_simulator/gui_2d_vis/visualization.yaml @@ -109,7 +109,7 @@ ServingWindow: - type: image path: images/bell_gold.png size: 0.5 - center_offset: [ -0.4, 0.1 ] + center_offset: [ -0.2, -0.05 ] rotate_image: False Stove: