evenin' all.
It's been a while since I done any 20 liners, so... I decided to do a no media graphical demo. This one fits into just 8 lines :o
*TIP (likes 1024x768x32 in fulscreen exclusive mode @ 60hz)
backdrop on : color backdrop rgb(0,0,0) : hide mouse :autocam off : sync on : sync rate 60 : position camera 240,320,160 : pitch camera down 90 : set directional light 0,1,-1,0 : fog on : fog color rgb(0,0,0) : fog distance 380
wamp# = 12.0 : wac# = 0.0 : was# = 36.0 : wbc# = 0.0 : wbs# = 48.0 : wcc# = 0.0 : wcs# = 32.0 : wdc# = 0.0 : wds# = 16.0 : aox# = 160.0 : aoy# = 90.0 : asx# = 1.0 : asy# = 1.25 : acx# = 0.0 : acy# = 0.0
p$="000000000000001100000001001000001111110001221122100011111100001100110000100001000100000010000000000" : for j = 1 to 100 : make object sphere j,15 : color object j,rgb(0,0,32) : set object ambient j,0 : set object specular j,rgb(255,255,255)
set object fog j,0 : l$ = mid$(p$,j) : if l$="1" : color object j,rgb(64,0,255) : endif : if l$="2" : color object j,rgb(255,255,255) : endif : next j : box 0,0,31,31,rgb(128,255,0),rgb(128,255,0),rgb(128,255,0),rgb(128,255,0)
box 2,2,29,29,rgb(0,0,0),rgb(0,0,0),rgb(0,0,0),rgb(0,0,0) : get image 1,0,0,31,31,1 : make matrix 1,480,320,48,32 : prepare matrix texture 1,1,1,1 : update matrix 1 : do : wac# = wrapvalue(wac#+3.0) : wacc# = wac# : wbc# = wrapvalue(wbc#+2.0)
wbcc# = wbc# : wcc# = wrapvalue(wcc#+4.0) : wccc# = wcc# : wdc# = wrapvalue(wdc#+3.0) : wdcc# = wdc# : for y = 0 to 32 : for x = 0 to 48 : xh# = sin(wacc#+(x*was#))*wamp# : yh# = cos(wbcc#+(y*wbs#))*wamp# : xm# = sin(wccc#+(x*wcs#))*wamp#
ym# = cos(wdcc#+(y*wds#))*wamp# : set matrix height 1,x,y,xh#+xm#+yh#+ym# : next x : next y : update matrix 1 : acx# = wrapvalue(acx#+asx#) : acy# = wrapvalue(acy#+asy#) : ax# = 185.0+(sin(acx#)*aox#) : ay# = 110.0+(cos(acy#)*aoy#) : co = 0
for j = 1 to 10 : for k = 1 to 10 : inc co,1 : ox# = ax# + (k*10.0) : oy# = ay# + (j*10.0) : gh# = get ground height (1,ox#,oy#) : position object co,ox#,gh#+2.0,oy# : next k : next j : sync : loop
enjoy
Ohd Chinese Ploverb say : Wise Eskimo, not eat yerrow snow.