Challenge:
Version:
1
Winner?:
No
Code Snippet:
set display mode 1024,768,32 hide mouse sync on ground=1 face=20 balls=19 target=3 friction#=0.998 grid=100 tiles=40 make matrix ground,grid,grid,tiles,tiles position matrix ground,0,0,0 create bitmap ground,20,20 ink rgb(128,128,128),0 line 0,10,19,10 line 10,0,10,19 get image ground,0,0,19,19 delete bitmap ground prepare matrix texture ground,ground,1,1 for x=1 to tiles for y=1 to tiles read height set matrix height ground,x,y,height next y next x update matrix ground for ball=1 to balls make object sphere ball,1 color object ball,rgb(0,0,255) hide object ball next ball ball=1 dim bx#(balls) dim by#(balls) dim bz#(balls) dim x#(balls) dim y#(balls) dim z#(balls) dim bfuse#(balls) dim bmove(balls) dim boom(balls) fx#=72.5 fy#=7.0 fz#=65 datatoimage(face) create bitmap 1,128,128 ink rgb(255,255,255),0 box 0,0,127,127 paste image face,32,32,1 get image target,0,0,128,128 delete bitmap 1 make object sphere face,5 scale object face,100,100,10 texture object face,target yrotate object face,45.0 position object face,fx#,fy#,fz# swing#=30.0 bottom#=10.0 pole#=bottom#+10.0 position camera 5,pole#,5 point camera 100,0,100 camang#=camera angle y() move=0 while not escapekey() if leftkey() if camera angle y() > camang#-swing# yrotate camera camera angle y()-0.5 endif endif if rightkey() if camera angle y() < camang#+swing# yrotate camera camera angle y()+0.5 endif endif if upkey() pole#=pole#+0.5 endif if downkey() if pole#>bottom# pole#=pole#-0.5 endif endif for x=1 to balls if bfuse#(x)>0.0 if bx#(x)<=grid and bz#(x)<=grid xs#=(get ground height(ground,bx#(x)-0.5,bz#(x))-get ground height(ground,bx#(x)+0.5,bz#(x)))/150.0 zs#=(get ground height(ground,bx#(x),bz#(x)-0.5)-get ground height(ground,bx#(x),bz#(x)+0.5))/150.0 by#(x)=get ground height(ground,bx#(x),bz#(x))+1.0 else x#(x)=0.0 z#(x)=0.0 y#(x)=-0.1 bmove(x)=0 endif x#(x)=x#(x)*friction#+xs# z#(x)=z#(x)*friction#+zs# bx#(x)=bx#(x)+x#(x) bz#(x)=bz#(x)+z#(x) by#(x)=by#(x)+y#(x) position object x, bx#(x),by#(x),bz#(x) if object collision(x,face) if object position x(x)>object position x(face) hit_face#=-10.0 else hit_face#=10.0 endif endif bfuse#(x)=bfuse#(x)-0.01 else if bmove(x)=1 ghost object on x bmove(x)=2 endif if bmove(x)=2 set matrix height ground,int(object position x(x)/2.5),int(object position z(x)/2.5),get matrix height(ground,int(object position x(x)/2.5),int(object position z(x)/2.5))-0.05 set matrix height ground,int(object position x(x)/2.5)+1,int(object position z(x)/2.5),get matrix height(ground,int(object position x(x)/2.5)+1,int(object position z(x)/2.5))-0.03 set matrix height ground,int(object position x(x)/2.5)-1,int(object position z(x)/2.5),get matrix height(ground,int(object position x(x)/2.5)-1,int(object position z(x)/2.5))-0.03 set matrix height ground,int(object position x(x)/2.5),int(object position z(x)/2.5)+1,get matrix height(ground,int(object position x(x)/2.5),int(object position z(x)/2.5)+1)-0.03 set matrix height ground,int(object position x(x)/2.5),int(object position z(x)/2.5)-1,get matrix height(ground,int(object position x(x)/2.5),int(object position z(x)/2.5)-1)-0.03 update matrix ground inc boom(x) inc boom(x) scale object x,boom(x)*4,boom(x)*4,boom(x)*4 fade object x,200-boom(x) if boom(x)=200 bmove(x)=0 hide object x endif endif endif next x yrotate object face,object angle y(face)+hit_face# hit_face#=hit_face#*0.99 if abs(hit_face#)<0.001 then hit_face#=0.0 position object face,object position x(face),get ground height(ground,object position x(face),object position z(face))+2.5,object position z(face) tmp#=camera angle y() position camera 5,pole#,5 point camera 100,0,100 yrotate camera tmp# if spacekey() if move=0 move=1 fuse#=0.0 endif if move=1 fuse#=fuse#+0.1 ink rgb(255,64,64),0 circle 512,728,20 circle 512,728,19 line 512,728,512+sin(fuse#*-45)*18,728+cos(fuse#*-45)*18 endif endif if not spacekey() if move=1 move=0 gosub setup endif endif gosub textbox sync endwhile end setup: inc ball if ball>balls then ball=1 bx#(ball)=5.0 by#(ball)=1.0 bz#(ball)=5.0 x#(ball)=sin(camera angle y())*0.5 y#(ball)=0.0 z#(ball)=cos(camera angle y())*0.5 bfuse#(ball)=fuse# bmove(ball)=1 boom(ball)=100 position object ball,bx#(ball),by#(ball),bz#(ball) fade object ball,100 scale object ball,100,100,100 ghost object off ball color object ball,rgb(0,0,255) show object ball return textbox: ink rgb(200,0,0),0 box 0,0,1024,90 ink rgb(100,0,0),0 box 5,5,1019,85 ink rgb(255,255,255),0 set text transparent text 10,10,"Use left,right arrow keys to rotate the camera" text 10,25,"Use up, down arrow keys to raise, lower the camera" text 10,40,"Press space bar and hold to set fuse on bomb. Release spacebar to roll bomb." text 10,55,"Try and sink the smiley face into the ground" return data 1,1,1,1,1,1,5,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10 data 1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,10 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1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,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,10 data 10,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,10 data 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10 function datatoimage(image) memblock=1 read size make memblock 1,size read sx `as dword read sy `as dword read depth `as dword write memblock dword 1,0,sx write memblock dword 1,4,sy write memblock dword 1,8,depth for x=0 to sx-1 for y=0 to sy-1 pos=(y*sx+x)*4+12 read b `as byte read g `as byte read r `as byte read a `as byte write memblock byte 1,pos,b write memblock byte 1,pos+1,g write memblock byte 1,pos+2,r write memblock byte 1,pos+3,a next y next x make image from memblock image,1 endfunction data 16396 data 64 data 64 data 32 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,217,217,219,1,231,231,231,13,246,246,246,13,237,242,247,19,234,241,246,44,160,206,225,46,82,157,201,46,74,177,225,46,66,212,255,33,59,207,255,13,54,200,250,13,52,185,231,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,181,183,222,1,222,222,244,19,246,243,248,54,248,248,248,105,247,247,247,164,245,250,255,206,252,252,252,209,236,242,247,215,230,236,239,241,142,185,208,242,85,133,178,242,77,166,213,242,69,210,255,229,61,211,255,209,55,209,255,206,49,206,255,168,43,203,255,135,38,198,255,77,33,191,248,25,32,176,227,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,212,241,6,202,202,243,63,220,220,247,156,247,250,255,212,250,251,251,242,249,249,249,255,248,252,255,255,254,254,254,255,239,244,249,255,228,234,231,255,175,202,217,255,97,150,188,255,88,140,184,255,79,176,223,255,71,214,255,255,63,212,255,255,56,210,255,255,50,208,255,255,44,205,255,255,39,200,255,251,34,196,253,219,30,192,250,164,27,188,247,98,23,182,242,36,27,156,205,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,234,234,251,6,226,226,251,63,217,217,248,168,217,217,249,241,245,245,253,255,253,253,253,255,252,255,255,255,250,250,250,255,255,255,255,255,242,243,243,255,233,238,242,255,194,213,217,255,110,167,197,255,100,146,186,255,90,168,212,255,81,210,255,255,73,214,255,255,65,212,255,255,58,210,255,255,51,208,255,255,46,207,255,255,40,203,255,255,35,198,255,255,31,195,252,255,27,190,250,254,24,186,246,226,21,181,242,142,18,176,238,43,20,154,206,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,251,251,254,1,247,247,255,57,240,240,255,168,232,232,253,241,223,223,251,255,241,241,254,255,254,254,255,255,254,254,254,255,253,255,253,255,251,254,251,255,246,249,246,255,238,241,238,255,214,224,223,255,145,185,207,255,112,154,191,255,102,161,202,255,92,202,245,255,83,217,255,255,75,215,255,255,67,213,255,255,59,210,255,255,53,209,255,255,47,207,255,255,41,205,255,255,36,201,255,255,32,196,255,255,28,193,251,255,24,188,248,255,21,183,244,255,19,179,240,228,17,175,237,142,15,171,233,43,20,138,184,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,10,255,255,255,108,251,251,255,231,244,244,255,255,236,236,254,255,236,236,254,255,254,254,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,244,247,244,255,230,235,232,255,186,204,218,255,125,169,200,255,114,160,198,255,104,190,230,255,94,219,255,255,85,218,255,255,76,215,255,255,68,213,255,255,60,211,255,255,54,209,255,255,47,207,255,255,42,206,255,255,37,203,255,255,32,198,255,255,28,194,253,255,25,189,249,255,22,186,245,255,19,181,242,255,17,178,239,255,15,173,236,228,13,168,232,108,12,159,219,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,31,255,255,255,158,255,255,255,249,255,255,255,255,247,247,255,255,239,239,255,255,250,250,255,255,255,255,255,255,255,255,255,255,255,255,255,255,253,255,253,255,255,255,255,255,240,244,248,255,220,224,232,255,