-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlayerInputManager.py
More file actions
35 lines (29 loc) · 1.05 KB
/
PlayerInputManager.py
File metadata and controls
35 lines (29 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from ActionPlayer import *
from PlayerInputController import *
class PlayerInputManager(object):
'''
classdocs
'''
inputList = []
#buildActionPlayer - acts as a player factory
@staticmethod
def buildActionPlayer( upKey, downKey, leftKey, rightKey,
action1Key, action2Key, key1, key2, key3,
xPos, yPos,
width, height,
vx, vy):
player = ActionPlayer(xPos, yPos, width, height, vx, vy)
input = PlayerInputController(upKey, downKey, leftKey, rightKey,
action1Key, action2Key,
key1, key2, key3,
player)
PlayerInputManager.inputList.append(input)
return player
@staticmethod
def update(keyboard):
for input in PlayerInputManager.inputList:
input.update(keyboard)
def __init__(self, params):
'''
Constructor
'''