def main(): pygame.init() pygame.display.set_caption("ma-chine") pygame.font.init() if ON_ARCADE: border = pygame.display.set_mode( (0, 0), pygame.FULLSCREEN) #, pygame.FULLSCREEN) inputs = GPIO() # elif WINDOWED: # border = pygame.display.set_mode((1280, 760)) # inputs = Keyboard() else: border = pygame.display.set_mode( (pygame.display.Info().current_w, pygame.display.Info().current_h)) inputs = Keyboard() try: app = game.Game(border, inputs) print("Start game") app.run() print("Game stop") except KeyboardInterrupt: pygame.quit() sys.exit(0)
def _render(self): # Clear terminal buffer #os.system('cls' if os.name == 'nt' else 'clear') print Keyboard.getKeyboardString()
def _update(self, dt): Keyboard._update()
def _processInput(self): if Keyboard.released(Keys.ESCAPE): self._terminate()
def _terminate(self): Keyboard.terminate() self.running = False
def _initialize(self): Keyboard.initialize() self.running = True