コード例 #1
0
    def __init__(self):

        # Setting up pygame
        pygame.init()
        info = pygame.display.Info()
        self.clock = pygame.time.Clock()
        client.utils.screen_size = (info.current_w, info.current_h)

        self.screen = pygame.display.set_mode((info.current_w, info.current_h), pygame.RESIZABLE)
        self.running = True

        # Setting up pymunk
        self.draw_options = pymunk.pygame_util.DrawOptions(self.screen)
        self.dt = 1/120
        self.stepping = False

        # Loading Resources
        ResourcesManager.load_from_disk()

        # Setting up scenes and choosing first
        App.scenes["Menu"] = MainMenuScene(self.screen)
        App.scenes["MultiSetup"] = SetupScene(self.screen, multi=True)
        App.scenes["SingleSetup"] = SetupScene(self.screen, multi=False)
        App.scenes["About"] = AboutScene(self.screen)
        App.scenes["Score"] = ScoreScene(self.screen)
        App.scenes["Game"] = GameScene()
        App.current_scene = App.scenes["Menu"]
コード例 #2
0
    def __init__(self):
        # Setting up pygame
        pygame.init()
        info = pygame.display.Info()

        self.screen = pygame.display.set_mode((info.current_w, info.current_h),
                                              pygame.RESIZABLE)

        # Loading Resources
        ResourcesManager.load_from_disk()

        self.scene = EditorScene((info.current_w, info.current_h))
        self.running = True

        # Setting up pymunk
        self.draw_options = pymunk.pygame_util.DrawOptions(self.screen)
        self.dt = 1 / 80
        self.stepping = False