window.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pycraft 作者: traverseda 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号