Merge pull request #18 from twalling/master
Add temple generation script
This commit is contained in:
commit
3bdb9b1390
1 changed files with 24 additions and 0 deletions
24
scripts/temple.js
Normal file
24
scripts/temple.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
load($SCRIPT_DIR + "/drone.js");
|
||||
//
|
||||
// constructs a mayan temple
|
||||
//
|
||||
Drone.extend('temple', function(side) {
|
||||
if (!side) {
|
||||
side = 20;
|
||||
}
|
||||
var stone = '98:1';
|
||||
var stair = '109:' + Drone.PLAYER_STAIRS_FACING[this.dir];
|
||||
|
||||
this.chkpt('temple');
|
||||
|
||||
while (side > 4) {
|
||||
var middle = Math.round((side-2)/2);
|
||||
this.chkpt('corner')
|
||||
.box(stone, side, 1, side)
|
||||
.right(middle).box(stair).right().box(stair)
|
||||
.move('corner').up().fwd().right();
|
||||
side = side - 2;
|
||||
}
|
||||
|
||||
return this.move('temple');
|
||||
});
|
Reference in a new issue