I'm pretty new to the bge, which I'm using for a school project and right now I'm having a problem with my movements.py script. I know this question is quite 'noobish' but I just can't find the problem. The 'player' object is just a cube with character physics and actor enabled but won't move when I start the game simulation and press the different keys.
import bge
def main():
cont = bge.logic.getCurrentController()
player = cont.owner
keyboard = bge.logic.keyboard
if keyboard.events[bge.events.WKEY] == bge.logic.KX_INPUT_ACTIVE:
player.applyMovement((0, .2, 0), True)
if keyboard.events[bge.events.SKEY] == bge.logic.KX_INPUT_ACTIVE:
player.applyMovement((0,-.2, 0), True)
if keyboard.events[bge.events.AKEY] == bge.logic.KX_INPUT_ACTIVE:
player.applyMovement((-.2, 0, 0), True)
if keyboard.events[bge.events.DKEY] == bge.logic.KX_INPUT_ACTIVE:
player.applyMovement((.2, 0, 0), True)
main()