Challenge:
Winner?:
No
Code Snippet:
if check display mode(1024,768,32)=1 then set display mode 1024,768,32 sync on sync rate 60 autocam off hide mouse ink rgb(120,160,185),0 box 0,0,97,97 get image 1,0,0,100,100 make matrix 1, 1000, 1000, 20, 20 position matrix 1,-500,0,-500 prepare matrix texture 1, 1, 1, 1 ghost matrix on 1,3 update matrix 1 color backdrop 0 set ambient light 0 make light 1 set light range 1,2000 hide light 0 make object sphere 100,20 set object light 100,0 global a# global cxa# global cx# global cy# global cz# cz#=-400 global theta# make_objects() DO move_light() update_shadow() camera_stuff() sync LOOP function camera_stuff() oldcx#=cx# oldcz#=cz# speed# = 5 if shiftkey() then speed# = 10 if upkey()=1 cx#=newxvalue(cx#,a#,speed#) cz#=newzvalue(cz#,a#,speed#) endif if downkey()=1 cx#=newxvalue(cx#,a#,-speed#) cz#=newzvalue(cz#,a#,-speed#) endif if leftkey()=1 cx#=newxvalue(cx#,wrapvalue(a#-90.0),speed#) cz#=newzvalue(cz#,wrapvalue(a#-90.0),speed#) endif if rightkey()=1 cx#=newxvalue(cx#,wrapvalue(a#+90.0),speed#) cz#=newzvalue(cz#,wrapvalue(a#+90.0),speed#) endif a#=wrapvalue(a#+(mousemovex()/3.0)) cxa#=cxa#+(mousemovey()/3.0) if cxa#<-90.0 then cxa#=-90.0 if cxa#>90.0 then cxa#=90.0 cy# = get ground height(1,cx#,cz#) position camera cx#,cy#+50,cz# rotate camera wrapvalue(cxa#),a#,0 endfunction function make_objects() ink rgb(155,155,255),0 box 0,0,10,10 get image 2,0,0,10,10 make object sphere 1,50,30,30 texture object 1,2 set object specular power 1,30 set object specular 1,rgb(250,150,150) set object smoothing 1,100 set object diffuse 1,rgb(200,170,140) position object 1,-100,25,0 make object sphere 2,50,20,20 make mesh from object 2,2 add limb 1,1,2 delete object 2 delete mesh 2 color limb 1,1,0 ink rgb(0,255,0),0 box 0,0,10,10 get image 4,0,0,10,10 make object cylinder 5,50 texture object 5,4 set object specular power 5,30 set object specular 5,rgb(250,150,150) set object smoothing 5,100 set object diffuse 5,rgb(200,170,140) position object 5,0,25,0 make object cylinder 6,50 xrotate object 6,90 fix object pivot 6 make mesh from object 2,6 add limb 5,1,2 delete object 6 delete mesh 2 color limb 5,1,0 ink rgb(255,0,0),0 box 0,0,10,10 get image 3,0,0,10,10 make object cone 3,50 texture object 3,3 set object specular power 3,30 set object specular 3,rgb(250,150,150) set object smoothing 3,100 set object diffuse 3,rgb(200,170,140) position object 3,100,25,0 make object cone 4,50 xrotate object 4,90 fix object pivot 4 make mesh from object 2,4 add limb 3,1,2 delete object 4 delete mesh 2 color limb 3,1,0 make object sphere 101,50 texture object 101,2 fade object 101,30 position object 101,-100,-25,0 xrotate object 101,-180 make object cone 103,50 texture object 103,3 fade object 103,60 position object 103,100,-25,0 xrotate object 103,-180 make object cylinder 105,50 texture object 105,4 fade object 105,30 position object 105,0,-25,0 xrotate object 105,-180 endfunction function move_light() lightx#=260*sin(theta#) lightz#=150*cos(theta#) lighty#=180+150*cos(theta#/1.4) inc theta# position light 1,lightx#,lighty#,lightz# position object 100,lightx#,lighty#,lightz# endfunction function update_shadow() for object=1 to 5 step 2 horizontal_distance#=sqrt((light position x(1)-object position x(object))^2+(light position z(1)-object position z(object))^2) vertical_distance#=light position y(1)-object position y(object) offset#=24+(horizontal_distance#/vertical_distance#) offset limb object,1,0,-25,offset# scale limb object,1,100,2,100+2*offset# bearing#=atanfull(light position x(1)-object position x(object),light position z(1)-object position z(object)) rotate object object,0,bearing#-180,0 next object endfunction