rem Setup display
set display mode 800,600,32
hide mouse
autocam off
rem Make floor texture
cls
ink rgb(0,255,0),0
box 0,0,32,32
get image 1,0,0,32,32
rem Make terrain
make matrix 1,1000,1000,35,35
prepare matrix texture 1,1,1,1
randomize matrix 1,500
for s=1 to 3
for x=1 to 34
for z=1 to 34
a#=get matrix height(1,x,z)
b#=get matrix height(1,x-1,z-1)
c#=get matrix height(1,x-1,z)
d#=get matrix height(1,x-1,z+1)
e#=get matrix height(1,x,z-1)
f#=get matrix height(1,x+1,z-1)
g#=get matrix height(1,x+1,z-1)
h#=get matrix height(1,x+1,z)
i#=get matrix height(1,x+1,z+1)
av#=(a#+b#+c#+d#+e#+f#+g#+h#+i#)/9.0
set matrix height 1,x,z,av#
next z
next x
for x=0 to 35
set matrix height 1,x,0,get matrix height(1,x,1)
set matrix height 1,x,35,get matrix height(1,x,34)
next z
for z=0 to 35
set matrix height 1,0,z,get matrix height(1,1,z)
set matrix height 1,35,z,get matrix height(1,34,z)
next z
next s
for z=1 to 34
for x=1 to 34
h8#=get matrix height(1,x,z-1)
h4#=get matrix height(1,x-1,z)
h#=get matrix height(1,x,z)
h2#=get matrix height(1,x,z)
x1#=(x-1)*25.0 : y1#=h#
x2#=(x+0)*25.0 : y2#=h4#
dx#=x2#-x1#
dy#=y2#-y1#
ax#=atanfull(dx#,dy#)
ax#=wrapvalue(90-ax#)
z1#=(z-1)*25.0 : y1#=h2#
z2#=(z+0)*25.0 : y2#=h8#
dz#=z2#-z1#
dy#=y2#-y1#
az#=atanfull(dz#,dy#)
az#=wrapvalue(90-az#)
nx#=sin(ax#)
ny#=cos(ax#)
nz#=sin(az#)
set matrix normal 1,x,z,nx#,ny#,nz#
next x
next z
update matrix 1
rem Make gun
make object cylinder 1,100
disable object zdepth 1
scale object 1,3,15,3
xrotate object 1,90
fix object pivot 1
set object cull 1,0
rem Make an opponent
make object box 2,50,50,50
color object 2,rgb(255,0,0)
rem Start off variables
x#=0.0
y#=25.0
z#=0.0
ang#=0.0
ex#=1000.0
ey#=25.0
ez#=1000.0
eang#=0.0
rem Setup manual synchronisation
sync on
sync rate 0
rem Start the main loop
do
rem Control input
ang#=wrapvalue(ang#+mousemovex())
if upkey()=1
x#=newxvalue(x#,ang#,1)
z#=newzvalue(z#,ang#,1)
endif
if downkey()=1
x#=newxvalue(x#,ang#,-1)
z#=newzvalue(z#,ang#,-1)
endif
if rightkey()=1
x#=newxvalue(x#,ang#+90,1)
z#=newzvalue(z#,ang#+90,1)
endif
if leftkey()=1
x#=newxvalue(x#,ang#-90,1)
z#=newzvalue(z#,ang#-90,1)
endif
y#=get ground height(1,x#,z#)+25.0
rem AI
point object 2,x#,ey#,z#
Temp#=object angle y(2)
eang#=curveangle(Temp#,eang#,150)
ex#=newxvalue(ex#,eang#,1)
ez#=newzvalue(ez#,eang#,1)
ey#=get ground height(1,ex#,ez#)+25.0
rem Update opponent
position object 2,ex#,ey#,ez#
rotate object 2,0,eang#,0
rem Update camera and gun
position camera x#,y#,z#
rotate camera 0,ang#,0
position object 1,newxvalue(x#,ang#,20),y#-10,newzvalue(z#,ang#,20)
rotate object 1,0,ang#,0
rem Update the screen
sync
rem End the main loop
loop
That is what I got after about 5 minutes of coding. I just realised that I don't really know what you want help with. What part of the AI do you want help with?