def __init__(self, gameInstance):
BaseController.__init__(self, gameInstance)
keys = ( \
pygame.K_LEFT, #left
pygame.K_RIGHT,#right
pygame.K_UP, #acc
pygame.K_DOWN, #brake
pygame.K_LCTRL,#reverse
pygame.K_r, #restart
#pygame.K_ESC, #endGame
pygame.K_RCTRL,
#pygame.K_SPACE,
\
)
self.keyToAction = dict()
for key, action in zip(keys, self.gameInterface.gameInstance.actionsList):
self.keyToAction.update({key: action})
self.keyToAction[pygame.K_RCTRL] = self.keyToAction[pygame.K_LCTRL]
评论列表
文章目录