sync on
sync rate 30
hide mouse
set display mode 800,600,16
set camera range 1,3000
autocam off
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem texture matrix
load image "grass14.bmp",1
prepare matrix texture 1,1,1,1
fill matrix 1,0,1
Rem Make player
load object "attack.3ds",1
yrotate object 1,180
scale object 1,50,50,50
position object 1,100,0,100
fix object pivot 1
load object "attack.3ds",2
scale object 2,75,75,75
position object 2,200,10,200
fix object pivot 2
`boxes to mark patrol
Make Object Box 3,10,10,100
Make Object Box 4,10,10,100
`Hide Object 3
`Hide Object 4
Position Object 3,400,0,200
Position Object 4,100,0,200
Point Object 2,Object Position X(3),0,Object Position Z(3)
Position Camera 0,0,180
Point Camera Object Position X(2),Object Position Y(2),Object Position Z(2)
rem Main loop
do
angley# = object angle y(1)
`AI patrol - needs fixing!!
move object 2,5
if object Collision(2,4)>0
yrotate object 2,360
EndIf
If Object Collision(2,3)>0
yrotate Object 2,180
EndIf
`end of AI
if upkey()=1
move object 1,10
endif
if downkey()=1
move object 1,-10
endif
If leftkey()=1 then yrotate object 1,wrapvalue(angley#-5)
If rightkey()=1 then yrotate object 1,wrapvalue(angley#+5)
set object speed 1,75
if controlkey()=1 then play object 1,5,50
while object collision(1,2)>0 and controlkey()=1
wait 500
delete object 2
endwhile
if object collision(1,2)>0
position object 1,x#,0,z#
endif
x# = object position x(1)
z# = object position z(1)
y# = get ground height(1,x#,z#)
position object 1,x#,y#+20,z#
cameraz# = newzvalue(z#,angley#-180,100)
camerax# = newxvalue(x#,angley#-180,100)
cameray# = get ground height(1,camerax#,cameraz#)
position camera camerax#,Cameray#+75,cameraz#
point camera x#,y#+70,z#
rem Refresh Screen
sync
loop
i have set the rotation to 180 degrees and its leaves the block at 90 degrees. y is this happening? all suggestions will be appreciated. the bit that i think needs sorted is just inot the do loop i have marked it
Daedalus