Well I’m to the point that logic bricks alone will not cut it for my games.
It’s time to learn Python
I’m starting from scratch here and I’m stuck already.
All I’m trying to do at the moment is rotate a plane.
I have a plane and a camera in my scene.
I’ve set up 4 sensors: UpSen, DownSen, LeftSen, RightSen, each being a keyboard sensor for the arrow keys.
Then I’ve got them all wired to a Python controller which is wired to a motion actuator called actRotate.
My Python controller fires up my first script:
import GameLogic contr=GameLogic.getCurrentController() owner=contr.getOwner() sensors=contr.getSensors() actRotate=contr.getActuator("actRotate") if UpSen.isPositive(): actRotate.setDRot(0.0,1,0.0) elif DownSen.isPositive(): actRotate.setDRot(0.0,-1,0.0) elif RightSen.isPositive(): actRotate.setDRot(1,0.0,0.0) elif LeftSen.isPositive(): actRotate.setDRot(-1,0.0,0.0) else: actRotate.setDRot(0.0,0.0,0.0)
I know this is an uber noob attempt, but it’s the best I have for now.
Any tips on how to do this the right way?