Rotating entity continuously

Blitz3D Forums/Blitz3D Beginners Area/Rotating entity continuously

hey, new question involving the rotating of an entity. What I want, is to push a button and my entity to get moving and rotate with a push of a button, and not have to hold the button down while it's moving or turning. I've created 2 functions for this, however neither of them work, could you take a look and see what I'm doing wrong?

should I put the keydowns in the main loop with the rest of my keyhits and keydowns? Should i move somethings around or not use functions at all?

Thanks,
Chad


; Vehicle controlls 
Function StearSub() 

;Turn sub 
If KeyDown(27) 
ty#=ty#+2.1 ; Turn right 
Else If KeyDown(26) 
ty#=ty#-2.1 ; Turn left 
Else If KeyDown(40) 
ty#=0 ; Rudder midship 
End If 

ty#=ty#+1 

RotateEntity conn,tx,ty,tz 
TurnEntity conn,tx,1,tz ;

End Function 

; Function to move the vehicle 

Function MoveSub() 

MoveEntity conn,mx,my,mz 
TurnEntity conn,tx,ty,tz 

End Function