Exemple #1
0
    def __init__(self, pygame_events):
        Publisher.__init__(self)
        pygame_events.subscribe(self.process_pygame)

        self.state = {
            'up': False,
            'down': False,
            'left': False,
            'right': False,
            'action1': False,
            'action2': False,
        }

        self.keys = {}
        for key in ('up', 'down', 'left', 'right', 'action1', 'action2'):
            self.keys[config.getint('Keys', key)] = key
        debug('key mapping = %s', self.keys)
Exemple #2
0
	def __init__(self, pygame_events):
		Publisher.__init__(self)
		pygame_events.subscribe(self.process_pygame)

		self.state = {
			'up':      False,
			'down':    False,
			'left':    False,
			'right':   False,
			'action1': False,
			'action2': False,
		}

		self.keys = {}
		for key in ('up','down','left','right','action1','action2'):
			self.keys[config.getint('Keys', key)] = key
		debug('key mapping = %s', self.keys)
	def __init__(self, clock, exception_on_quit=True):
		Publisher.__init__(self)
		clock.subscribe(self.poll)
		self.handle_quit = exception_on_quit
	def __init__(self):
		Publisher.__init__(self)
		self.source = pygame.time.Clock()
		self.max_framerate = settings.getint('Graphics', 'framerate')