Merge pull request #49 from freerunnering/patch-1

More efficient box0()
This commit is contained in:
Walter Higgins 2013-01-30 17:15:18 -08:00
commit 2392922c01

View file

@ -431,7 +431,18 @@ var Drone = Drone || {
return this.cuboidX(bm[0],bm[1],w,h,d); return this.cuboidX(bm[0],bm[1],w,h,d);
}; };
Drone.prototype.cuboid0 = function(block,w,h,d){ Drone.prototype.cuboid0 = function(block,w,h,d){
return this.cuboid(block,w,h,d).fwd().right().cuboid(0,w-2,h,d-2).back().left(); this.chkpt('start_point');
// Front wall
this.cuboid(block, w, h, 1);
// Left wall
this.cuboid(block, 1, h, d);
// Right wall
this.right(w-1).cuboid(block, 1, h, d).left(w-1);
// Back wall
this.fwd(d-1).cuboid(block, w, h, 1);
return this.move('start_point');
}; };
Drone.prototype.door = function(door){ Drone.prototype.door = function(door){
if (typeof door == "undefined"){ if (typeof door == "undefined"){