Make Pyramid by Hacktank28th Jun 2009 4:29
|
---|
Summary Makes a pyramid of cubes Description This function makes a pyramid of cubes. Paramiters: Code ` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com function makepyramid(x# as float,y# as float,z# as float,perx as integer,pery as integer,cubesize# as float) for teir = 1 to max(perx,pery) for i = 1 to pery for ii = 1 to max(perx,pery) if (teir < i+1) and (teir < ii+1) id = find free object() if teir > 1 then xmod# = i*(cubesize#/2) else xmod# = 0 make object cube id,cubesize# position object id,x#+(i*(cubesize#)-(teir*(cubesize#/2))),y#-(cubesize#/2)+(cubesize#*teir)-0.5,z#+(ii*cubesize#)-(teir*(cubesize#/2)) set object id,1,0,1 color object id,rgb(rnd(255),rnd(255),rnd(255)) endif next ii next i next teir endfunction |