This entry is a combination of sound, graphics, matrices, speed and doing the impossible! Inside, you walk to the background sound of crickets and the occational hooting of an owl over a 200x200, grass-textured, randomized landscape at a constant 38+ FPS. In Dark BASIC version 1.06.
Here's the code:
load sound "ambience.wav",1 : loop sound 1 : load sound "owl.wav",2 : sync on : s = 100000
d = 200 : Dim Heightmap#(d,d) : p = s / d : Hide Mouse : fog on
fog color rgb(0,100,255) : fog distance 1500 : curx = d/2 : cury = d/2 : make matrix 1,p*10,p*10,10,10
speed#=0.0 : color backdrop rgb(0,100,255) : for x = 0 to d : for y = 0 to d : Heightmap#(x,y)=rnd(500)
next y : next x : load image "grass.bmp",1 : prepare matrix texture 1,1,1,1 : fill matrix 1,0,1
for x = 0 to 10 : for y = 0 to 10 : set matrix height 1,x,y,Heightmap#(x+curx,y+cury) : next y : next x : update matrix 1
do : position mouse 320,240 : cx#=wrapvalue(cx#+mousemovey()) : cy#=wrapvalue(cy#+mousemovex()) : rotate camera cx#,cy#,cz#
if MouseClick()=1 : speed#=5.0 : else : speed#=0.0 : If MouseClick() = 2 Then speed#=-5.0 : endif
sx# = NewXValue(sx#,cy#,0-speed#) : sz# = NewZValue(sz#,cy#,0-speed#) : if rnd(500)=0 then play sound 2
if sx#=p : curx=curx-1 : gosub _updmat : shift matrix right 1 : sx#=sx#-p : endif
if sz#=p : cury=cury-1 : gosub _updmat : shift matrix down 1 : sz#=sz#-p : endif
cpx#=Camera Position X() : cpz# = Camera Position Z() : position camera cpx#,Get Ground Height(1,cpx#-sx#,cpz#-sz#)+150,cpz#
text 0,0,str$(Screen FPS()) : position matrix 1,sx#,0,sz# : sync : loop
_updmat:
for x = 0 to 10 : for y = 0 to 10 step 10 : set matrix height 1,x,y,Heightmap#(x+curx,y+cury) : next y : next x : for x = 0 to 10 step 10
for y = 0 to 10 : set matrix height 1,x,y,Heightmap#(x+curx,y+cury) : next y : next x : update matrix 1 : return
Now, if anyone wants to debate about there being more than 5 commands in a line, let me remind them; "if...else...endif" is a single command, as is "for...next" and "do...loop".
To download my entire entry (87k zip\198k unzip):
[url]www.geocities.com/kwg88ca/TorianFinalEntry.zip[/url]
To download the executable file (508k zip\1366k unzip):
[url]www.geocities.com/kwg88ca/final_exec.zip[/url]
Enjoy!
Torian