コード例 #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)
コード例 #2
0
ファイル: key.py プロジェクト: MatMoore/Pyweek-13--Mutant
	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)
コード例 #3
0
	def __init__(self, clock, exception_on_quit=True):
		Publisher.__init__(self)
		clock.subscribe(self.poll)
		self.handle_quit = exception_on_quit
コード例 #4
0
	def __init__(self):
		Publisher.__init__(self)
		self.source = pygame.time.Clock()
		self.max_framerate = settings.getint('Graphics', 'framerate')