def __init__(self, ticks_ps, *args, **kwargs):
super(Window, self).__init__(*args, **kwargs)
self.ticks_per_second = ticks_ps
# Whether or not the window exclusively captures the mouse.
self.set_exclusive_mouse(False)
# This call schedules the `update()` method to be called
# ticks_per_second. This is the main game event loop.
pyglet.clock.schedule_interval(self.update, 1.0 / self.ticks_per_second)
config_loader = ConfigurationLoader()
self.config_data = config_loader.load_configuration_file()
# Create the game state manager and set the first state
self.gamestatemanager = GameStateManager()
# This should be changed when we implement the MAINMENU game state
gs_running = GameStateRunning(self.config_data, height=self.height, width=self.width)
self.gamestatemanager.push(gs_running)
评论列表
文章目录