set display mode 1024,768,32
hide mouse
hide light 0
set ambient light 20
make light 1
autocam off
color backdrop 0
for colour=100 to 255
ink rgb(colour-30,colour-60,colour),0
line 0,colour,155,colour
next colour
get image 1,0,100,155,255
box 0,0,100,100,rgb(255,0,0),rgb(255,0,0),rgb(0,0,250),rgb(0,0,250)
get image 2,0,0,100,100
box 0,0,100,100,rgb(255,100,0),rgb(0,0,0),rgb(255,100,0),rgb(0,0,0)
get image 3,0,0,100,100
cls
ink rgb(0,255,0),0
box 0,0,10,10
ink 0,0
box 0,0,9,9
get image 4,0,0,10,10
cls
ink rgb(255,0,0),0
set text font "arial"
set text to bold
set text size 20
text 0,20,"CHECKPOINT"
get image 5,0,0,120,60
cls
ink rgb(0,0,255),0
box 0,0,10,10
ink 0,0
box 0,0,9,9
get image 7,0,0,10,10
get image 1000000,0,0,1,1
ink rgb(255,255,0),0
box 0,0,1,1
get image 2000000,0,0,1,1
cls
make object sphere 1000000,1,30,30
ghost object on 1000000
set object specular power 1000000,50
set object specular 1000000,rgb(200,200,200)
position light 1,0,-1,2
position object 1000000,0,0,3
texture object 1000000,2000000
a=int(screen width()/3.0)
b=int(screen height()/3.0)
c=int(screen width()*2/3.0)
d=int(screen height()*2/3.0)
make object sphere 2000000,0.3
position object 2000000,0,-0.2,3
ghost object on 2000000
`texture object 2000000,1000000
`make object triangle 3000000,0,0,2,20,10,2,20,-10,2
`texture object 3000000,1000000
sync
get image 20,a,b,c,d
delete object 1000000
delete object 2000000
`delete object 3000000
`position camera 0,500,-500
sync on
sync rate 50
make object sphere 1,0.8,20,20
make object sphere 2,1,20,20
scale object 2,110,60,300
glue object to limb 2,1,0
make object cone 3,1
scale object 3,105,250,50
xrotate object 3,90
glue object to limb 3,1,0
position object 3,0,0,1.3
make object cone 4,1.5
scale object 4,20,140,100
zrotate object 4,-75
xrotate object 4,-35
position object 4,0.85,0.2,-1
glue object to limb 4,1,0
make object cone 5,1.5
scale object 5,20,140,100
zrotate object 5,75
xrotate object 5,-35
position object 5,-0.85,0.2,-1
glue object to limb 5,1,0
make object cone 6,0.2
set object cull 6,0
scale object 6,100,100,100
xrotate object 6,90
position object 6,0,0,-1.5
glue object to limb 6,1,0
make object cone 7,0.5
scale object 7,20,140,100
zrotate object 7,-110
xrotate object 7,-40
position object 7,0.3,-0.05,-1.3
glue object to limb 7,1,0
make object cone 8,0.5
scale object 8,20,140,100
zrotate object 8,110
xrotate object 8,-40
position object 8,-0.3,-0.05,-1.3
glue object to limb 8,1,0
for object=3 to 8
texture object object,2
set object smoothing object,100
set object specular power object,1
set object specular object,rgb(100,100,155)
next object
texture object 1,1
set object specular power 1,1
set object specular 1,rgb(100,100,155)
texture object 2,2
ghost object on 1,4
make object cone 9,0.5
set object cull 9,0
xrotate object 9,90
ghost object on 9,5
texture object 9,3
scale object texture 9,1,2
set object texture 9,2,1
set object light 9,0
position object 9,0,-0.05,-15
scale object 9,400,6000,100
glue object to limb 9,1,0
make object plain 10,3.03,0.52
position object 10,0,0.5,1.5
set object light 10,0
disable object zdepth 10
make object plain 11,3.0,0.5
position object 11,0,0.5,1.495
set object light 11,0
disable object zdepth 11
texture object 11,1000000
make object plain 12,3.0,0.5
position object 12,0,0.5,1.494
set object light 12,0
disable object zdepth 12
texture object 12,2000000
randomize timer()
 
fog on
fog distance 1000
position object 1,0,2,0
set object collision on 1
for object=1 to 4
set object collision to boxes object
next object
make object plain 200,1000,1000
texture object 200,4
set object light 200,0
xrotate object 200,90
scale object texture 200,40,40
make object plain 300,20,1000
texture object 300,7
set object specular power 300,1
set object specular 300,rgb(200,200,200)
set object emissive 300,rgb(250,100,150)
scale object texture 300,40,40
xrotate object 300,90
position object 300,0,0.1,0
make object plain 400,1000,40
position object 400,-25,0,0
yrotate object 400,90
set object light 400,0
make object plain 401,1000,40
position object 401,25,0,0
yrotate object 401,90
set object light 401,0
texture object 400,7
texture object 401,7
scale object texture 400,40,1
scale object texture 401,40,1
make object plain 402,40,1000
position object 402,25,0,0
xrotate object 402,-90
set object light 402,0
texture object 402,7
scale object texture 402,50,1
position object 402,0,20,0
 
numberofobjects=20
dim opponentspeed#(numberofobjects+20)
for object=20 to 20+numberofobjects
random=rnd(1)
if random=0 then x=50:y=1
if random=1 then x=1:y=50
make object box object,x,y,1
color object object,rgb(0,0,250)
ghost object on object
set object collision on object
yrotate object object,180
position object object,rnd(8)-4,rnd(8),1000-rnd(1000)
opponentspeed#(object)=rnd(10)/10.0+0.4
next object
numberofsigns=99
sign=1
polarity=1
for object=100 to 100+numberofsigns
make object plain object,5,5
ghost object on object
texture object object,20
`set object light object,0
set object transparency object,5
`set object emissive object,rgb(255,255,255)
polarity=polarity*-1
position object object,10*polarity,10,sign*1000/numberofsigns
inc sign
next object
make object cube 2000,14
set object collision on 2000
texture object 2000,5
ghost object on 2000
set object transparency 2000,5
set object light 2000,0
make object cube 2001,14
set object collision on 2001
hide object 2001
set text font "arial"
set text size 30
ink rgb(80,80,250),0
startagain:
position camera 0,15,-100
hide object 10
hide object 11
hide object 12
for object=20 to 20+numberofobjects
position object object,rnd(8)-4,rnd(8),1000-rnd(1000)
opponentspeed#(object)=rnd(10)/10.0+0.4
next object
position object 2000,0,4,2000
position object 2001,0,4,2100
position light 1,object position x(1),object position y(1)+20,object position z(1)
addedtocountdown=0
exclusionflag=0
addtime=0
crash=0
skid=0
restart=0
score=0
speed#=0
maxspeed#=0.25
numberofloops=0
do
text screen width()/2-30,screen height()/2-20,"Get ready....."
position camera 0,curvevalue(4,camera position y(0),60),curvevalue(-6,camera position z(0),60)
if camera position z()>-6.1 then exit
sync
loop
show object 10
show object 11
show object 12
position camera 0,4,-6
starttime=timer()
do
if numberofloops<30
text screen width()/2-10,screen height()/2+10,"GO!"
inc numberofloops
endif
position light 1,object position x(1),object position y(1)+20,object position z(1)
scroll object texture 9,0,-0.03
time=(timer()-starttime)/1000
countdown=35-time+addedtocountdown
ink rgb(250,0,0),0
text screen width()/2-20,0,str$(countdown)
ink rgb(80,80,250),0
text screen width()/2-20,30,"Score: "+str$(score)
for object=20 to 20+numberofobjects
position object object,object position x(object),object position y(object),object position z(object)-speed#*15+opponentspeed#(object)
if object position z(object)<0
  position object object,rnd(8)-4,rnd(8),1000
  if crash=0 and skid=0
    inc score
  endif
endif
if object position z(object)>1000 then position object object,4,6,0
next object
for object=100 to 100+numberofsigns
position object object,object position x(object),object position y(object),object position z(object)-speed#*15
if object position z(object)<0 then position object object,object position x(object),object position y(object),1000
if object position z(object)>1000 then position object object,object position x(object),object position y(object),0
next object
for object=2000 to 2001
position object object,object position x(object),object position y(object),object position z(object)-speed#*15
if object position z(object)<0 then position object object,object position x(object),1,2500
next object
if mouseclick()=1 and speed#<maxspeed# then inc speed#,0.0002
if mouseclick()=2 and speed#>0 then dec speed#,0.002
xmousemove#=mousemovex()
ymousemove#=mousemovey()
if speed#>0
  speedy#=curvevalue(ymousemove#/10,speedy#,30)
  speedx#=curvevalue(xmousemove#/10,speedx#,30)
  xrotate object 1,curveangle(-ymousemove#*40,object angle x(1),40)
  zrotate object 1,curveangle(-xmousemove#*40,object angle z(1),40)
endif
if xmousemove#=0
  zrotate object 1,curveangle(0,object angle z(1),20)
  speedx#=curvevalue(0,speedx#,20)
endif
if ymousemove#=0
  xrotate object 1,curveangle(0,object angle x(1),20)
  speedy#=curvevalue(0,speedy#,20)
endif
if object position x(1)<-4 then position object 1,-4,object position y(1),object position z(1)
if object position x(1)>4 then position object 1,4,object position y(1),object position z(1)
if object position y(1)<0 then position object 1,object position x(1),0,object position z(1)
if object position y(1)>8 then position object 1,object position x(1),8,object position z(1)
if crash=0
position object 1,object position x(1)+speedx#,object position y(1)+speedy#,0
endif
scroll object texture 200,0,speed#
scroll object texture 300,0,speed#
scroll object texture 400,speed#,0
scroll object texture 401,speed#,0
scroll object texture 402,0,0.01
for test=1 to 4
collisionnumber=object collision(test,0)
if collisionnumber>=20 and collisionnumber<=20+numberofobjects and crash=0
   skid=1
   crash=1
   yspeed#=speed#/1.5
   gravity#=0.002
   spin#=speed#*50.0
   goto getout
endif
next test
getout:
if collisionnumber=2000 then addtime=1
if addtime=1 and exclusionflag=0
  inc addedtocountdown,20
  exclusionflag=1
endif
if collisionnumber=2001 then exclusionflag=0:addtime=0
if skid=1
   rotate object 1,curveangle(-40,object angle x(1),15),object angle y(1)-spin#,curveangle(90,object angle z(1),10)
   position object 1,object position x(1),object position y(1),0
   `dec spin#,0.0001
   if speed#<=0
     restart=1
     skid=0
     speed#=0
     crash=0
     position object 1,object position x(1),1,0
   endif
endif
if crash=1
   position object 1,object position x(1),object position y(1)+yspeed#,object position z(1)
   dec yspeed#,gravity#
   if object position y(1)<=1
     position object 1,object position x(1),1,0
     yspeed#=yspeed#*-0.4
     dec speed#,0.04
   endif
endif
if restart=1
   rotate object 1,0,0,0
   restart=0
endif
if countdown=<0
  text screen width()/2-30,screen height()/2-20,"Game Over"
  sync
  wait 2000
  text screen width()/2-100,screen height()/2+20,"Press any key to restart"
  sync
  wait key
  goto startagain
endif
scale object 12,100*speed#/maxspeed#,100,100
position object 12,-1.5*(1.0-(speed#/maxspeed#)),object position y(12),object position z(12)
sync
loop