From 3fffb788b241b7baa4247c1e630d83a7210ddc2e Mon Sep 17 00:00:00 2001 From: Anna Date: Sat, 21 Jan 2017 17:37:17 +0100 Subject: [PATCH] Default controls are set to 'yes' on game start. --- src/controlSettingScreen.py | 5 ++--- src/controller.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controlSettingScreen.py b/src/controlSettingScreen.py index 621f2fb..19c5ba6 100644 --- a/src/controlSettingScreen.py +++ b/src/controlSettingScreen.py @@ -66,7 +66,7 @@ def __init__(self, screen): #Selection icon self.selectedIm = pygame.sprite.Sprite() self.selectedIm.image = pygame.image.load("data/ui_selected.png").convert_alpha() - self.selectedIm.rect = self.selectedIm.image.get_rect(center = (70, 199)) + self.selectedIm.rect = self.selectedIm.image.get_rect(center = (590, 399)) #default controls self.icon_list.add(self.selectedIm) #Jump icon self.jumpIm = pygame.sprite.Sprite() @@ -126,7 +126,6 @@ def __init__(self, screen): self.defaultIm.image = pygame.image.load("data/ui_default.png").convert() self.defaultIm.rect = self.defaultIm.image.get_rect(center = (590, 399)) self.icon_list.add(self.defaultIm) - self.toggle_default_btn() #Done icon self.doneIm = pygame.sprite.Sprite() self.doneIm.image = pygame.Surface([214, 64]) @@ -134,7 +133,7 @@ def __init__(self, screen): self.doneIm.image.set_alpha(0) self.doneIm.rect = self.doneIm.image.get_rect(center = (666, 522)) self.icon_list.add(self.doneIm) - self.currently_selected = SelectedUI.JUMP + self.currently_selected = SelectedUI.USE_DEFAULT_CONTROLS def hit_ui_element(self, (x, y)): """Returns enum of hit UI element or none if mouse hits no UI. diff --git a/src/controller.py b/src/controller.py index 7decec3..13f7ff4 100644 --- a/src/controller.py +++ b/src/controller.py @@ -96,7 +96,7 @@ def __init__(self, screen, event_manager): self.use_mouse_to_aim_and_fire = False self.use_hat_to_aim = -1 self.use_hat_to_move = -1 - self.use_default_controls = False + self.use_default_controls = True self.controls_ready = False self.control_setting_screen = controlSettingScreen.ControlSettingScreen(screen) #Register game pads that are connected