Hi NeoHavic!
I have a piece of code here that might help you.
These lines controls your movement whit the cursorkeys:
IF UPKEY() = 1
Player_X#=NEWXVALUE(Player_X#,Camera_AngleY#,+0.5)
Player_Z#=NEWZVALUE(Player_Z#,Camera_AngleY#,+0.5)
ENDIF
IF DOWNKEY() = 1
Player_X#=NEWXVALUE(Player_X#,Camera_AngleY#,-0.5)
Player_Z#=NEWZVALUE(Player_Z#,Camera_AngleY#,-0.5)
ENDIF
IF LEFTKEY() = 1
Player_X#=NEWXVALUE(Player_X#,WRAPVALUE(Camera_AngleY#-90.0),0.5)
Player_Z#=NEWZVALUE(Player_Z#,WRAPVALUE(Camera_AngleY#-90.0),0.5)
ENDIF
IF RIGHTKEY() = 1
Player_X#=NEWXVALUE(Player_X#,WRAPVALUE(Camera_AngleY#+90.0),0.5)
Player_Z#=NEWZVALUE(Player_Z#,WRAPVALUE(Camera_AngleY#+90.0),0.5)
ENDIF
And these lines to control the camera view whit the mouse:
Camera_AngleY#=WRAPVALUE(Camera_AngleY#+(MOUSEMOVEX()/)) `<- Change to 3.0 to change sensetivity.
Camera_AngleX#=Camera_AngleX#+(MOUSEMOVEY()/3.0) `<- Use a negative value to invert the mouse.
IF Camera_AngleX#<-80.0 THEN Camera_AngleX#=-80.0
IF Camera_AngleX#>80.0 THEN Camera_AngleX#=80.0
`Update the camera and player position
POSITION CAMERA 1,Player_X#,Player_Y#,Player_Z#
ROTATE CAMERA 1,WRAPVALUE(Camera_AngleX#),Camera_AngleY#,0
If you want to use other keys than the cursorkey i suggest that you use the KEYSTATE() command.
Example:
Forward_Key = 17 `<- 17 is the scancode for a key. (w on my keyboard)
IF KEYSTATE(Forward_Key) = 1
Blaha
Blaha
ENDIF
Just replace the UPKEY().
Good Luck fixing the rest of the keys.
- Tywald