当前位置: 首页>>代码示例>>Python>>正文


Python Engine.clean_up方法代码示例

本文整理汇总了Python中engine.Engine.clean_up方法的典型用法代码示例。如果您正苦于以下问题:Python Engine.clean_up方法的具体用法?Python Engine.clean_up怎么用?Python Engine.clean_up使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在engine.Engine的用法示例。


在下文中一共展示了Engine.clean_up方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: start

# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import clean_up [as 别名]
    def start(self):

        self.engine = Engine(1200, 700)

        self.engine.game = self

        screen = pygame.display.set_mode((1200, 700), pygame.HWSURFACE, 32)
        title_screen = pygame.image.load("assets/images/gui/title_screen.png").convert()

        x = 1200/2 - title_screen.get_width()/2
        y = 700/2 - title_screen.get_height()/2

        # show title screen
        exit_title_screen = False
        while not exit_title_screen:

            for event in pygame.event.get():
                if event.type == QUIT:
                    Engine.clean_up()

                if event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_RETURN:
                        exit_title_screen = True

            screen.fill((0, 0, 0))
            screen.blit(title_screen, (x, y))

            pygame.display.update()

        self.main_room = PlatformWorld()
        self.maze_room = Maze()
        self.fib_room = FibWorld()

        self.engine.worlds.append(self.main_room)
        self.engine.worlds.append(self.maze_room)
        self.engine.worlds.append(self.fib_room)

        self.engine.set_world(self.main_room)
        self.engine.run()
开发者ID:Unit978,项目名称:luminescence_standalone,代码行数:41,代码来源:main.py

示例2: go_to_end

# 需要导入模块: from engine import Engine [as 别名]
# 或者: from engine.Engine import clean_up [as 别名]
    def go_to_end(self):
        screen = pygame.display.set_mode((1200, 700), pygame.HWSURFACE, 32)
        title_screen = pygame.image.load("assets/images/gui/end_screen.png").convert()

        x = 1200/2 - title_screen.get_width()/2
        y = 700/2 - title_screen.get_height()/2

        # show title screen
        exit_title_screen = False
        while not exit_title_screen:

            for event in pygame.event.get():
                if event.type == QUIT:
                    Engine.clean_up()

                if event.type == pygame.KEYDOWN:
                    if event.key == pygame.K_RETURN:
                        exit_title_screen = True

            screen.fill((0, 0, 0))
            screen.blit(title_screen, (x, y))

            pygame.display.update()
        self.start()
开发者ID:Unit978,项目名称:luminescence_standalone,代码行数:26,代码来源:main.py


注:本文中的engine.Engine.clean_up方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。