diff --git a/overcooked_simulator/gui_2d_vis/overcooked_gui.py b/overcooked_simulator/gui_2d_vis/overcooked_gui.py index 74b305860c86880c728164fd4072767f140126ae..404a73d8cb122959134dea2c806e25bff9e90316 100644 --- a/overcooked_simulator/gui_2d_vis/overcooked_gui.py +++ b/overcooked_simulator/gui_2d_vis/overcooked_gui.py @@ -262,8 +262,8 @@ class PyGameGUI: if abs(axis_up_down) > tolerance_threshold: move_vec[1] += axis_up_down - if np.linalg.norm(move_vec) != 0: - move_vec = move_vec / np.linalg.norm(move_vec) + # if np.linalg.norm(move_vec) != 0: + # move_vec = move_vec / np.linalg.norm(move_vec) action = Action( current_player_name, @@ -312,7 +312,6 @@ class PyGameGUI: event: Pygame event for extracting the button action. joysticks: list of joysticks """ - for key_set in self.key_sets: current_player_name = str(key_set.current_player) # if a joystick is connected for current player @@ -879,6 +878,7 @@ class PyGameGUI: def draw_tutorial_screen_frame(self): self.handle_keys() + self.handle_joy_stick_input(joysticks=self.joysticks) state = self.request_state() self.vis.draw_gamescreen( @@ -896,6 +896,7 @@ class PyGameGUI: self.last_state = self.request_state() self.handle_keys() + self.handle_joy_stick_input(joysticks=self.joysticks) if self.last_state["ended"]: self.menu_state = MenuStates.PostGame @@ -1485,10 +1486,7 @@ class PyGameGUI: ]: self.handle_key_event(event) - if ( - event.type in [pygame.JOYBUTTONDOWN, pygame.JOYBUTTONUP] - and self.menu_state == MenuStates.Game - ): + if event.type in [pygame.JOYBUTTONDOWN, pygame.JOYBUTTONUP] and self.menu_state in [MenuStates.Game, MenuStates.ControllerTutorial]: self.handle_joy_stick_event(event, joysticks=self.joysticks) self.manager.process_events(event)