do
paste image 10,object screen x(10),object screen y(10)
ink RGB(150,60,60),0
set cursor object screen x(10)+40,object screen y(10)+30:print health
paste image 11,object screen x(10)-30,object screen y(10),1
ink RGB(100,150,80),0
set cursor object screen x(10)-40,object screen y(10)-10:print rounds
paste image 12,400,200,1
set cursor 0,0
print screen fps()
print
print " ";px#
print " ";pz#
print " ";height#
a=wrapvalue(a-1)
color backdrop RGB(0,0,0)
hide mouse
oldmx=mousex()
oldmy=mousey()
px#=object position x(10)
pz#=object position z(10)
if leftkey()=1 then yrotate object 10,wrapvalue(object angle y(10)-5)
if rightkey()=1 then yrotate object 10,wrapvalue(object angle y(10)+5)
if upkey()=1 then move object 10,1
if downkey()=1 then move object 10,-1
print mousemovex()
cs=100001-intersect object(1,camera position x(),100000,camera position z(),camera position x(),-100000,camera position z())
if mousemovex() < 0 then yrotate object 10,wrapvalue(object angle y(10)-20):mousemovex()=0
if mousemovex() > 0 then yrotate object 10,wrapvalue(object angle y(10)+20):mousemovex()=0
if mousemovey() < 0 then ch=ch+1
if mousemovey() > 0 then ch=ch-1
if ch > 20 then ch=20
if ch < cs then ch=cs
if mouseclick()=2 then move object 10,1
if spacekey()=2 then move object 10,-1
px#=object position x(10)
pz#=object position z(10)
sm=100001-intersect object(1,px#,100000,pz#,px#,-100000,pz#)
if sm < -7 then swim=1
if sm = -7 then swim = 1
if sm > -7 then swim = 0
if swim=1
height#=-7
endif
if swim=0
height#=100001-intersect object(1,px#,100000,pz#,px#,-100000,pz#)
endif
print swim
position object 10,px#,height#,pz#
set camera to follow px#,height#+3,pz#,object angle y(10),12,ch,5,0
point camera px#,height#+4,pz#
set light to object position 1,10
position light 1,px#,height+2,py#
scroll object texture 5000,0.0001,0.0001
scroll object texture 2,0.01,0.001
scroll object texture 4,0.01,0.01
scroll object texture 6,0,-0.05
fastsync
loop
AIPX Rocks