示例#1
0
    def update(self, dt):
        """
        The update function should contain or call out to all the logic.
        Here is where group.update() should be called for the groups, where
        event handling should be taken care of, etc.
        """
        for event in self.event_handler.get():
            if event['type'] == 'QUIT':
                spyral.quit()
                sys.exit()

        self.group.update(dt)
示例#2
0
 def update(self, dt):
     """
     The update loop receives dt as a parameter, which is the amount
     of time which has passed since the last time update was called.
     """
     self.group.update(dt)
     for event in self.event_handler.get():
         if event['type'] == 'QUIT':
             spyral.director.pop()
             return
         if event['type'] == 'KEYDOWN':
             # press any key to continue...
             spyral.quit()
             return
示例#3
0
    def update(self, dt):
        for event in self.event_handler.get():
            if event['type'] == 'QUIT':
                spyral.quit()
                sys.exit()
            if event['type'] == 'KEYDOWN':
                if event['ascii'] == 'p':
                    self.previous()
                elif event['ascii'] == 'n':
                    self.next()
                elif event['ascii'] == 'q':
                    spyral.quit()
                    sys.exit()

        self.group.update(dt)
示例#4
0
 def update(self, dt):
     for event in self.event_handler.get():
         if event['type'] == 'QUIT':
             spyral.quit()
             sys.exit()
         if event['type'] == 'KEYDOWN':
             if event['ascii'] == 'p':
                 self.previous()
             elif event['ascii'] == 'n':
                 self.next()
             elif event['ascii'] == 'q':
                 spyral.quit()
                 sys.exit()
                 
     self.group.update(dt)
示例#5
0
        ("fullscreen:", "True" if options.fullscreen else "False"),
        ("Max FPS:", str(options.fps)),
        ("Locale:", options.locale),
        ("Profiling:", "Enabled" if options.profile else "Disabled")
        ]
    if options.profile:
        output.append(("Profile output:", output_dir))
    format_columns("CISC374 Launcher", output)
    
    if not options.profile:
        try:
            spyral.director.init(options.res, fullscreen = options.fullscreen, max_fps = options.fps)
            launch()
            spyral.director.run()
        except KeyboardInterrupt:
            spyral.quit()
        spyral.quit()
        sys.exit()

    # We now handle if profiling is enabled.
    import cProfile
    import envoy
    from collections import defaultdict
    scenes = defaultdict(lambda: 0)
    files = []
    
    try:
        os.mkdir(output_dir)
    except OSError:
        pass
示例#6
0
              ("fullscreen:", "True" if options.fullscreen else "False"),
              ("Max FPS:", str(options.fps)), ("Locale:", options.locale),
              ("Profiling:", "Enabled" if options.profile else "Disabled")]
    if options.profile:
        output.append(("Profile output:", output_dir))
    format_columns("CISC374 Launcher", output)

    if not options.profile:
        try:
            spyral.director.init(options.res,
                                 fullscreen=options.fullscreen,
                                 max_fps=options.fps)
            launch()
            spyral.director.run()
        except KeyboardInterrupt:
            spyral.quit()
        spyral.quit()
        sys.exit()

    # We now handle if profiling is enabled.
    import cProfile
    import envoy
    from collections import defaultdict
    scenes = defaultdict(lambda: 0)
    files = []

    try:
        os.mkdir(output_dir)
    except OSError:
        pass