def __init__(self): pygame.init() pygame.display.set_caption("Floppy Birdie") self.clock = pygame.time.Clock() self.game_state = GameState() self.move_command = None self.cell_size = GlobalVars.get_cell_size() self.game_window = pygame.display.set_mode( (int(self.cell_size.x * self.game_state.world_size.x), int(self.cell_size.y * self.game_state.world_size.y)) ) self.running = True self.game_status = GameStatus.START_MENU self.window_size = self.game_state.world_size.elementwise() * self.cell_size self.game_menu = Menu(self.start_game, self.quit_game)
def get_collision_box(self): return self.sprite.get_bounding_rect(min_alpha=1).move(self.location.elementwise() * GlobalVars.get_cell_size()) # return Rect( # (self.location + Vector2(1.3, 0)).elementwise() * GlobalVars.get_cell_size(), # (self.texture_rect.size[0] * 0.375, self.texture_rect.size[1] * 0.9) # )
def get_collision_box(self): return self.bird_sprite.get_bounding_rect(min_alpha=1).move(self.bird_position.elementwise() * GlobalVars.get_cell_size())