def isGameOver(self): if self.isLearning: keys = Display.getKeys() if 'q' in keys: self.userThread.quit = True return True return self.iteration > Const.TRAIN_ITERATIONS if self.userThread.quit: return True if self.userThread.victory: return True return self.userThread.hasCollided()
def freezeFrame(self): while True: keys = Display.getKeys() if 'q' in keys: return Display.graphicsSleep(0.1)