OK i am trying to get my movement and camera controls set the way i want them and been having problems.. I am not sure if this is the best way to do it.
I added comeents to the code to show what not working..
sync rate 60
sync on
hide mouse
`autocam off
make matrix 1,500,500,60,60
randomize matrix 1,6
update matrix 1
make camera 1
' -----------------temporary object------------
make object cube 1,2
position object 1, 20, 4, 30
' ---------------------
angle = 0
dist = 20
height = 10
smooth = 1
do
set cursor 0,0
Print angle
print angleX
position object 1, object position x(1), get ground height(1,object position x(1), object position z(1))+1, object position z(1)
set camera to follow 1,object position x(1), object position y(1), object position z(1), angle, dist, height, smooth, 1
` If i have this in the function it doesn't move the cam..
` may goal is to have it in the function aswell
IF SCANCODE() then Control()
If KEYSTATE(18) then angle = angle + 1
If KEYSTATE(19) then angle = angle - 1
If keystate(17) then angle = angle + 45
if Keystate(20) then angle = angle - 45
sync
loop
Function Control()
` i am trying to keep it so when the cam moves up is always up.
` but it doesn't update anglex
If KEYSTATE(207) then angleX = angleX + 1
If KEYSTATE(19) then angleX = angleX - 1
If keystate(17) then angleX = angleX + 45
if Keystate(20) then angleX = angleX - 45
if KEYSTATE(200)
yrotate object 1,0 + angleX
move object 1,1
endif
if KEYSTATE(208)
yrotate object 1,180 + angleX
move object 1,1
endif
if KEYSTATE(203)
yrotate object 1,-90 + angleX
move object 1,1
endif
if KEYSTATE(205)
yrotate object 1,90 + angleX
move object 1,1
endif
If KEYSTATE(205)
If KEYSTATE(200)
yrotate object 1,45 + angleX
endif
endif
If KEYSTATE(203)
If KEYSTATE(200)
yrotate object 1,-45 + angleX
endif
endif
If KEYSTATE(205)
If KEYSTATE(208)
yrotate object 1,135 + angleX
endif
endif
If KEYSTATE(203)
If KEYSTATE(208)
yrotate object 1,-135 + angleX
endif
endif
EndFunction
thanks for any help with this..