Updated docs

This commit is contained in:
walterhiggins 2013-02-09 10:24:55 +00:00
parent 6445ed166d
commit a4eccad4bd
3 changed files with 125 additions and 3 deletions

View file

@ -456,6 +456,67 @@ Once the method is defined (it can be defined in a new pyramid.js file) it can b
[edonaldson]: https://github.com/edonaldson [edonaldson]: https://github.com/edonaldson
Drone Constants
===============
Drone.PLAYER_STAIRS_FACING
--------------------------
An array which can be used when constructing stairs facing in the Drone's direction...
var d = new Drone();
d.box(blocks.stairs.oak + ':' + Drone.PLAYER_STAIRS_FACING[d.dir]);
... will construct a single oak stair block facing the drone.
Drone.PLAYER_SIGN_FACING
------------------------
An array which can be used when placing signs so they face in a given direction.
This is used internally by the Drone.sign() method.
Drone.PLAYER_TORCH_FACING
-------------------------
Used when placing torches so that they face the same way as the drone.
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);
Blocks Module
=============
You hate having to lookup [Data Values][dv] when you use ScriptCraft's Drone() functions. So do I.
So I created this blocks object which is a helper object for use in construction.
Examples
--------
box( blocks.oak ); // creates a single oak wood block
box( blocks.sand, 3, 2, 1 ); // creates a block of sand 3 wide x 2 high x 1 long
box( blocks.wool.green, 2 ); // creates a block of green wool 2 blocks wide
Drone.blocktype() method Drone.blocktype() method
======================== ========================
Creates the text out of blocks. Useful for large-scale in-game signs. Creates the text out of blocks. Useful for large-scale in-game signs.

View file

@ -1,3 +1,17 @@
/************************************************************************
Blocks Module
=============
You hate having to lookup [Data Values][dv] when you use ScriptCraft's Drone() functions. So do I.
So I created this blocks object which is a helper object for use in construction.
Examples
--------
box( blocks.oak ); // creates a single oak wood block
box( blocks.sand, 3, 2, 1 ); // creates a block of sand 3 wide x 2 high x 1 long
box( blocks.wool.green, 2 ); // creates a block of green wool 2 blocks wide
***/
var blocks = { var blocks = {
air: 0, air: 0,
stone: 1, stone: 1,
@ -70,7 +84,6 @@ var blocks = {
mushroom_red: 40, mushroom_red: 40,
gold: 41, gold: 41,
iron: 42, iron: 42,
slab: 44,
tnt: 46, tnt: 46,
bookshelf: 47, bookshelf: 47,
moss_stone: 48, moss_stone: 48,
@ -113,7 +126,6 @@ var blocks = {
torch_redstone: 75, torch_redstone: 75,
torch_redstone_active: 76, torch_redstone_active: 76,
stone_button: 77, stone_button: 77,
slab_snow: 78,
ice: 79, ice: 79,
snow: 80, snow: 80,
cactus: 81, cactus: 81,
@ -163,7 +175,35 @@ var blocks = {
dragon_egg: 122, dragon_egg: 122,
redstone_lamp: 123, redstone_lamp: 123,
redstone_lamp_active: 124, redstone_lamp_active: 124,
slab_wood: 126, slab: {
snow: 78,
stone: 44,
sandstone: '44:1',
wooden: '44:2',
cobblestone: '44:3',
brick: '44:4',
stonebrick: '44:5',
netherbrick:'44:6',
quartz: '44:7',
oak: 126,
spruce: '126:1',
birch: '126:2',
jungle: '126:3',
upper: {
stone: '44:8',
sandstone: '44:9',
wooden: '44:10',
cobblestone: '44:11',
brick: '44:12',
stonebrick: '44:13',
netherbrick:'44:14',
quartz: '44:15',
oak: '126:8',
spruce: '126:9',
birch: '126:10',
jungle: '126:11',
}
},
cocoa: 127, cocoa: 127,
emerald_ore: 129, emerald_ore: 129,
enderchest: 130, enderchest: 130,

View file

@ -520,6 +520,27 @@ Once the method is defined (it can be defined in a new pyramid.js file) it can b
[edonaldson]: https://github.com/edonaldson [edonaldson]: https://github.com/edonaldson
Drone Constants
===============
Drone.PLAYER_STAIRS_FACING
--------------------------
An array which can be used when constructing stairs facing in the Drone's direction...
var d = new Drone();
d.box(blocks.stairs.oak + ':' + Drone.PLAYER_STAIRS_FACING[d.dir]);
... will construct a single oak stair block facing the drone.
Drone.PLAYER_SIGN_FACING
------------------------
An array which can be used when placing signs so they face in a given direction.
This is used internally by the Drone.sign() method.
Drone.PLAYER_TORCH_FACING
-------------------------
Used when placing torches so that they face the same way as the drone.
***/ ***/
// //