Update docs per new way to require('drone')

This commit is contained in:
walterhiggins 2015-01-11 00:29:43 +00:00
parent ecc2d91ea2
commit 2e7dfb2453
4 changed files with 20 additions and 14 deletions

View file

@ -3432,6 +3432,7 @@ Alternatively if you provide just a function as a parameter, then the function n
#### Example 1 Using name and function as parameters
// submitted by [edonaldson][edonaldson]
var Drone = require('drone');
Drone.extend('pyramid', function( block,height) {
this.chkpt('pyramid');
for ( var i = height; i > 0; i -= 2) {
@ -3442,6 +3443,7 @@ Alternatively if you provide just a function as a parameter, then the function n
#### Example 2 Using just a named function as a parameter
var Drone = require('drone');
function pyramid( block,height) {
this.chkpt('pyramid');
for ( var i = height; i > 0; i -= 2) {

View file

@ -936,15 +936,16 @@ var myskyscraper = function(floors) {
}
this.chkpt('myskyscraper'); // saves the drone position so it can return there later
for ( i = 0; i < floors; i++ ) {
this.box(blocks.iron,20,1,20)
this
.box(blocks.iron,20,1,20)
.up()
.box0(blocks.glass_pane,20,3,20)
.up(3);
}
return this.move('myskyscraper'); // return to where we started
this.move('myskyscraper'); // return to where we started
};
var Drone = require('../drone/drone').Drone;
Drone.extend('myskyscraper',myskyscraper);
var Drone = require('drone');
Drone.extend( myskyscraper );
```
... so this takes a little explaining. First I create a new function

View file

@ -894,15 +894,16 @@ var myskyscraper = function(floors) {
}
this.chkpt('myskyscraper'); // saves the drone position so it can return there later
for ( i = 0; i < floors; i++ ) {
this.box(blocks.iron,20,1,20)
this
.box(blocks.iron,20,1,20)
.up()
.box0(blocks.glass_pane,20,3,20)
.up(3);
}
return this.move('myskyscraper'); // return to where we started
this.move('myskyscraper'); // return to where we started
};
var Drone = require('../drone/drone').Drone;
Drone.extend('myskyscraper',myskyscraper);
var Drone = require('drone');
Drone.extend( myskyscraper );
```
... so this takes a little explaining. First I create a new function

View file

@ -210,6 +210,7 @@ Alternatively if you provide just a function as a parameter, then the function n
#### Example 1 Using name and function as parameters
// submitted by [edonaldson][edonaldson]
var Drone = require('drone');
Drone.extend('pyramid', function( block,height) {
this.chkpt('pyramid');
for ( var i = height; i > 0; i -= 2) {
@ -220,6 +221,7 @@ Alternatively if you provide just a function as a parameter, then the function n
#### Example 2 Using just a named function as a parameter
var Drone = require('drone');
function pyramid( block,height) {
this.chkpt('pyramid');
for ( var i = height; i > 0; i -= 2) {