def __init__(self, position, listener, activator, index=0): super(Cursor, self).__init__(position) self.listener = listener self.activator = activator self.index = index self.key = None self.set_image(game.get_image('cursor_block')) self.text = Line((64, 72), self.key, game.get_font('screen_large')) self.text.set_color(pg.Color(62, 255, 4)) self.start_pos = np.array(position) self.state = 'input' self.state_time = 0.0 self.progress_time = 0 self.load_icon = AnimatedActor((64, 64), mode='custom') self.load_icon.set_animation(game.get_animation('load'), (64, 64), 20) self.load_icon_rect = self.load_icon.surface.get_rect() game.key_down.subscribe(self.key_down)
def __init__(self): super(MainMenu, self).__init__() self.title = Line((game.screen_size[0] / 2, game.screen_size[1] / 4), "Houd de knop ingedrukt", game.get_font('title')) self.cursor = Cursor() self.start_button = Button( (game.screen_size[0] / 2, game.screen_size[1] / 2), self.start_button_pressed) game.global_state_changed.subscribe(self.global_state_changed)
def __init__(self): super(Tutorial, self).__init__() self.title = Line((game.screen_size[0] / 2, 150), "Tutorial", game.get_font('title')) self.cursor = Cursor() self.hand_screen = HandScreen( (3 * game.screen_size[0] / 4, game.screen_size[1] / 2)) self.set_letter() game.global_state_changed.subscribe(self.global_state_changed)
def __init__(self, position): super(Button, self).__init__(position) self.button_up_image = game.get_image('screen_empty') self.button_down_image = game.get_image('screen_active') self.set_image(self.button_up_image) self.is_pressed = False self.wait_time = 0 self.hand_surface = pg.Surface((256, 256)) self.hand_rect = self.hand_surface.get_rect() self.label_text = Line((315, 450), '?', game.get_font('screen_small')) self.label_text.set_color(pg.Color(50, 240, 0))
def __init__(self): self.background = pg.Color(20, 20, 20) self.title = Line((screen.get_width() / 2, 100), "This is a state", fonts['title'])