The code:
` (C) Attila Switzerland - 50 lines contest 2007
set display mode 640,480,16:sync on:autocam off:set text font "Arial":set text size 12:set text transparent:set text to bold:hide mouse:a$ =str$(timer()):a1=val( mid$(a$,5) ):randomize a1:position camera 900,80,900:point camera 1000,0,1000:fog on:fog distance 600:fog color rgb(128,128,255):MakeBitmap("GROUND",1):MakeBitmap("CAMO",2):MakeBitmap("IRON1",3):MakeBitmap("WATER",4):MakeBitmap("IRON2",6):MakeIntro("WATER",5)
global MaxObjects=15
global nlink=0
dim link#(MaxObjects,5):dim LinkName$(MaxObjects):make matrix 1, 2000,2000,20,20:prepare matrix texture 1,1,1,1:set matrix wireframe off 1:randomize matrix 1,7:update matrix 1
make matrix 2, 2000,2000,20,20:prepare matrix texture 2,4,1,1:set matrix wireframe off 2:ghost matrix on 2:position matrix 2,0,2,0
make object box 100,50,5,50:texture object 100,3:position object 100,1000,3,1000:make object box 101,50,8,50:texture object 101,6:position object 101,1800,6,1800:set object collision on 101
make object box 1, 2,2,2:position object 1, 0.,1.,0.:texture object 1,2:make object box 10, 7,5,7::position object 10, 0.,5.,0.:texture object 10,2
befestigen(1,10,"Kabine"):texture object 10,2:set object collision off 10:make object box 2, 1,2,16:position object 2, 0.,6.5,10.:befestigen(1,2,"Schwanz"):texture object 2,2:set object collision off 2
make object sphere 3,8:scale object 3,100,70,100:position object 3, 0,3,-5.:befestigen(1,3,"Bug"):texture object 3,2:set object collision off 3
make object sphere 4, 5:scale object 4, 100,50,100:position object 4, 0,7.5,0.:befestigen(1,4,"Engine"):texture object 4,2:set object collision off 4
make object triangle 5, 0,0,0, 0,4,3, 0,0,3:position object 5, 0,6,16:befestigen(1,5,"Schwanzflosse"):texture object 5,2:set object collision off 5
make object box 6, 2,2,2:position object 6, 0,8,0.:befestigen(1,6,"Rotor1"):color object 6,rgb(64,0,0):set object collision off 5:make object cylinder 7,1:position object 7, 0,9.1,0.:befestigen(1,7,"Achse"):color object 6,rgb(64,0,0):set object collision off 6
make object sphere 8,1.5:position object 8,0,9.6,0:scale object 8,100,50,100:color object 8,rgb(64,0,0):set object collision off 8:make object box 9,34,.1,.5:position object 9,0,9.6,0:color object 9,rgb(0,0,96):set object collision off 9:befestigen(8,9,"Prop"):befestigen(1,8,"Propeller")
color object 9,rgb(0,0,64):color backdrop rgb(128,128,255):r#=0:rp#=0:heli=1:r2#=0:xneu#=1000.0:yneu#=10.0:zneu#=1000.0:position object 1,xneu#,yneu#,zneu#:yrotate object 1,r#:bewegen(1):sync:suspend for key:delete sprite 5:delete image 5
do
oldx#=object position x(1):oldy#=object position y(1):oldz#=object position z(1):nx#=oldx#:nz#=oldz#:ny#=yneu#:speed#=0:a$="":up=0:a=scancode():r2#=r2#+2:ny#=oldy#-.05
if a=201:r2#=r2#+3:ny#=oldy#+.2:up=1:endif:if a=209:r2#=r2#+1:ny#=oldy#-.2:endif:yrotate object 8,r2#:bewegen(8):if rightkey():ny#=oldy#+.01:r2#=r2#+2:r#=r#+.2:endif:if leftkey():ny#=oldy#+.01:r2#=r2#+2:r#=r#-.2:endif:speed#=0:if upkey():ny#=oldy#+.01:r2#=r2#+2:speed#=-.1:endif:if downkey():ny#=oldy#+.01:r2#=r2#+1:speed#=.05:endif:if r#>360:r#=r#-360:endif:if r#<0:r#=r#+360:endif
dx#=sin(r#):dz#=cos(r#):nx#=nx#+Speed#*dx#:nz#=nz#+Speed#*dz#:xneu#=nx#:yneu#=ny#:zneu#=nz#:position object 1,xneu#,yneu#,zneu#:ink 0,0
c=object collision(1,0):if c=101 then set text size 32:ink rgb(255,255,255),0:center text 320,220,"You made it":sync:wait 4000:end
yb#=get ground height(1,xneu#,zneu#):if c>10 or ((yb#+5)>yneu#):position object 1,oldx#,oldy#,oldz#:endif:bewegen(1):yrotate object 1,r#
cr#=r#+15:if cr# > 360:cr#=cr#-360:endif:if cr# < 0:cr#=cr#+360:endif:cx#=xneu#+35*sin(cr#):cz#=zneu#+35*cos(cr#):cy#=yneu#+10:position camera cx#,cy#,cz#:point camera xneu#,yneu#,zneu#:text 1,1,"Frames:" +str$(screen fps()):sync
loop:end
function befestigen(o1,o2,n$)
linkname$(nlink)=n$:link#(nlink,0)=o1:link#(nlink,1)=o2:rxz#=atanfull(object position x(o2)-object position x(o1),object position z(o2)-object position z(o1)):if rxz# < 0 then rxz#=rxz#+360:a2#=(object position x(o2)-object position x(o1))*(object position x(o2)-object position x(o1))
b2#=(object position z(o2)-object position z(o1))*(object position z(o2)-object position z(o1)):Dist#=sqrt(a2#+b2#):link#(nlink,2)=rxz#:dy#=object position y(o2)-object position y(o1):link#(nlink,3)=dy#:link#(nlink,4)=dist#:link#(nlink,5)=object angle y(o2):nlink=nlink+1
endfunction
function bewegen(o1)
ox#=object position x(o1):oy#=object position y(o1):oz#=object position z(o1):or#=object angle y(o1):for h=0 to nlink:if link#(h,0)=o1:on#=link#(h,1):dy#=link#(h,3):d#=link#(h,4):pr#=link#(h,2):dr#=pr#+or#:dz#=cos(dr#)*d#:dx#=cos(90-dr#)*d#:rn#=atanfull(object position x(on#)-object position x(o1),object position z(on#)-object position z(o1)):px#=dx#:pz#=dz#:py#=oy#+dy#:position object on#,px#+ox#,py#,pz#+oz#:yrotate object on#,dr#+pr#:endif:next h
endfunction
function MakeBitmap(N$,nr)
create bitmap nr,128,128:set current bitmap nr
if n$="GROUND":ink rgb(0,128,0),0:box 0,0,128,128:for h=1 to 1500:ink rgb(200,200,0),0:px=rnd(128):py=rnd(128):dot px,py:ink rgb(160,160,0),0:dot px-.5,py-.5:next h:endif
if n$="WATER":ink rgb(0,0,164),0:box 0,0,128,128:for h=1 to 600:ink rgb(196,196,255),0:px=rnd(128):py=rnd(128):line px,py,px+4,py+3:ink rgb(0,0,32),0:line px-1,py+1,px+3,py+4:next h:endif
if n$="IRON1" or n$="IRON2":ink rgb(64,64,68),0:box 0,0,128,128:for h=1 to 2000:ink rgb(196,196,196),0:px=rnd(128):py=rnd(128):dot px,py:ink rgb(32,32,32),0:dot px+1,py+1:next h:
if n$="IRON1":ink rgb(255,255,32),0:else:ink rgb(255,64,64),0:endif:for r=55 to 63:circle 64,64,r:next r:endif
if n$="CAMO":ink rgb(0,64,0),0:box 0,0,128,128:for h=1 to 20:ink rgb(214,189,115),0:px=rnd(128):py=rnd(128):for h1=1 to 10:circle px,py,h1:next h1:next h
for h=1 to 20:ink rgb(189,120,36),0:px=rnd(128):py=rnd(128):for h1=1 to 10:circle px,py,h1:next h1:next h:endif
get image nr,0,0,128,128:set current bitmap 0:sync
endfunction
function MakeIntro(N$,nr)
create bitmap nr,640,480:set current bitmap nr:ink rgb(32,32,255),0:box 0,0,640,480
for h=1 to 6000:ink rgb(250,250,255),0:px=rnd(640):py=rnd(480):line px,py,px+4,py+3:ink rgb(0,0,32),0:line px-1,py+1,px+3,py+4:next h:set text size 24:set text to bold:ink rgb(128,128,255),0
center text 320,100,"Medialess Copter-Simmulation":ink rgb(64,64,64),0:center text 322,102,"Medialess Copter-Simmulation":ink rgb(255,255,0),0:center text 321,101,"Medialess Copter-Simmulation"
set text size 18:ink rgb(128,128,255),0:center text 320,130,"(C) 2007 by Attila":ink rgb(64,64,64),0:center text 322,132,"(C) 2007 by Attila":ink rgb(255,255,0),0:center text 321,131,"(C) 2007 by Attila"
ink rgb(128,128,255),0:center text 319,189,"use arrowskey to control direction":ink rgb(64,64,64),0:center text 321,191,"use arrowskey to control direction":ink rgb(255,255,0),0:center text 320,190,"use arrowskey to control direction"
ink rgb(128,128,255),0:center text 319,229,"use pgup/pgdown to go up and down":ink rgb(64,64,64),0:center text 321,231,"use pgup/pgdown to go up and down":ink rgb(255,255,0),0:center text 320,230,"use pgup/pgdown to go up and down"
ink rgb(128,128,255),0:center text 319,289,"objective: fly from the yellow plattform to the red plattform":ink rgb(64,64,64),0:center text 321,291,"objective: fly from the yellow plattform to the red plattform":ink rgb(255,255,255),0:center text 320,290,"objective: fly from the yellow plattform to the red plattform"
set text size 18:ink rgb(128,128,255),0:center text 320,400,"Press any key":ink rgb(64,64,64),0:center text 322,402,"Press any key":ink rgb(255,255,0),0:center text 321,401,"Press any key":get image nr,0,0,640,480:set current bitmap 0:set text size 12:sprite nr,0,0,nr:sync
endfunction
Here is the
http://www.infralog.com/dyndatabase/gtest/dl/helo.zip
link:
http://www.infralog.com/dyndatabase/gtest/dl/helo.zip
Sorry but the code and the has disappeared from the post.