Thanks, but i actually have something very simular. Let me post some code here:
self.accept("space", self.setKey, ["jump",1])
self.accept("arrow_left", self.setKey, ["left",1])
self.accept("arrow_right", self.setKey, ["right",1])
self.accept("arrow_up", self.setKey, ["forward",1])
self.accept("arrow_down", self.setKey, ["back",1])
self.accept("a", self.setKey, ["cam-left",1])
self.accept("s", self.setKey, ["cam-right",1])
self.accept("enter", self.setKey, ["cam-snap",1])
self.accept("space-up", self.setKey, ["jump",0])
self.accept("arrow_left-up", self.setKey, ["left",0])
self.accept("arrow_right-up", self.setKey, ["right",0])
self.accept("arrow_up-up", self.setKey, ["forward",0])
self.accept("arrow_down-up", self.setKey, ["back",0])
self.accept("a-up", self.setKey, ["cam-left",0])
self.accept("s-up", self.setKey, ["cam-right",0])
self.accept("enter-up", self.setKey, ["cam-snap",0])
That’s to accept them, nothing new here.
def setKey(self, key, value):
self.keyMap[key] = value
That’s to put them in the array exactly like in the Ralph demo.
And the jump and move task are two different tasks. I don’t need to read them out both at once, i just need them to be in the array as a 1 when they are pressed. That’s not happening right now. With space, it’s only right and up at the same time that doesn’t work, the rest does (i.e. right and down).