New spiral staircase - to demo use of Drone.PLAYER_STAIRS_FACING
This commit is contained in:
parent
03ec3a6ae0
commit
6445ed166d
1 changed files with 45 additions and 0 deletions
45
src/main/javascript/drone/spiral_stairs.js
Normal file
45
src/main/javascript/drone/spiral_stairs.js
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
load(__folder + "drone.js");
|
||||||
|
/************************************************************************
|
||||||
|
Drone.spiral_stairs() method
|
||||||
|
============================
|
||||||
|
Constructs a spiral staircase with slabs at each corner.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
|
||||||
|
* stairBlock - The block to use for stairs, should be one of the following...
|
||||||
|
- 'oak'
|
||||||
|
- 'spruce'
|
||||||
|
- 'birch'
|
||||||
|
- 'jungle'
|
||||||
|
- 'cobblestone'
|
||||||
|
- 'brick'
|
||||||
|
- 'stone'
|
||||||
|
- 'nether'
|
||||||
|
- 'sandstone'
|
||||||
|
- 'quartz'
|
||||||
|
* flights - The number of flights of stairs to build.
|
||||||
|
|
||||||
|
![Spiral Staircase](img/spiralstair1.png)
|
||||||
|
|
||||||
|
Example
|
||||||
|
-------
|
||||||
|
To construct a spiral staircase 5 floors high made of oak...
|
||||||
|
|
||||||
|
spiral_stairs('oak', 5);
|
||||||
|
|
||||||
|
***/
|
||||||
|
Drone.extend("spiral_stairs",function(stairBlock, flights){
|
||||||
|
this.chkpt('spiral_stairs');
|
||||||
|
|
||||||
|
for (var i = 0; i < flights; i++){
|
||||||
|
this
|
||||||
|
.box(blocks.stairs[stairBlock] + ':' + Drone.PLAYER_STAIRS_FACING[this.dir])
|
||||||
|
.up().fwd()
|
||||||
|
.box(blocks.stairs[stairBlock] + ':' + Drone.PLAYER_STAIRS_FACING[this.dir])
|
||||||
|
.up().fwd()
|
||||||
|
.box(blocks.slab[stairBlock])
|
||||||
|
.turn().fwd();
|
||||||
|
}
|
||||||
|
return this.move('spiral_stairs');
|
||||||
|
});
|
Reference in a new issue