def __init__(self, screen, font): '''Init game state, player score, game count, etc...''' self.screen = screen self.font = font self.gfx = gfx.Gfx(screen, font) self.state = menu.Menu(self) self.choose_minigame() self.difficulty = 0 self.players = [player.Player(), player.Player()] self.active_player = 0 self.second_turn = False
def __init__(self, border, font, outputs): '''Init game state, player score, game count, etc...''' self.border = border self.screen = border.subsurface( Rect((Game.BORDER_SIZE, Game.BORDER_SIZE), (Game.SCREEN_WIDTH - 2 * Game.BORDER_SIZE, Game.SCREEN_HEIGHT - 2 * Game.BORDER_SIZE))) self.font = font self.gfx = gfx.Gfx(self.screen, font) self.state = menu.Menu(self) self.outputs = outputs self.init()
def run(self): self.running = True while self.running: self.state.run() pygame.display.update() self.timer.tick(Game.FPS) if pygame.event.get([pygame.QUIT]) or pygame.key.get_pressed( )[pygame.K_ESCAPE] or pygame.key.get_pressed()[pygame.K_BACKSPACE]: pygame.quit() break elif pygame.key.get_pressed()[pygame.K_TAB]: self.state = menu.Menu(self)
def __init__(self, display, inputs): self.display = display self.timer = Clock() self.state = menu.Menu(self) self.inputs = inputs self.reset_data()