removed unneeded load() calls

This commit is contained in:
walterhiggins 2013-02-10 17:51:27 +00:00
parent 04e1b27e51
commit f3e17b4181
13 changed files with 73 additions and 74 deletions

View file

@ -1,5 +1,26 @@
load(__folder + "drone.js"); /************************************************************************
Drone.blocktype() method
========================
Creates the text out of blocks. Useful for large-scale in-game signs.
Parameters
----------
* message - The message to create - (use `\n` for newlines)
* foregroundBlock (default: black wool) - The block to use for the foreground
* backgroundBlock (default: none) - The block to use for the background
Example
-------
To create a 2-line high message using glowstone...
blocktype("Hello\nWorld",blocks.glowstone);
![blocktype example][imgbt1]
[imgbt1]: img/blocktype1.png
***/
(function(){ (function(){
var bitmaps = { var bitmaps = {
@ -296,29 +317,6 @@ load(__folder + "drone.js");
} }
} }
} }
/************************************************************************
Drone.blocktype() method
========================
Creates the text out of blocks. Useful for large-scale in-game signs.
Parameters
----------
* message - The message to create - (use `\n` for newlines)
* foregroundBlock (default: black wool) - The block to use for the foreground
* backgroundBlock (default: none) - The block to use for the background
Example
-------
To create a 2-line high message using glowstone...
blocktype("Hello\nWorld",blocks.glowstone);
![blocktype example][imgbt1]
[imgbt1]: img/blocktype1.png
***/
// //

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js");
// //
// a castle is just a big wide fort with 4 taller forts at each corner // a castle is just a big wide fort with 4 taller forts at each corner
// //

View file

@ -7,8 +7,6 @@
* width - width of the chessboard * width - width of the chessboard
* height - height of the chessboard * height - height of the chessboard
*/ */
load(__folder + "drone.js");
Drone.extend("chessboard", function(whiteBlock, blackBlock, width, depth) { Drone.extend("chessboard", function(whiteBlock, blackBlock, width, depth) {
this.chkpt('chessboard-start'); this.chkpt('chessboard-start');
width = width || 8; width = width || 8;

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js");
// //
// need to use the drone module to create buildings easily // need to use the drone module to create buildings easily
// it can be done using calls to putBlock(), putSign(), getPlayerPos() and getMousePos() // it can be done using calls to putBlock(), putSign(), getPlayerPos() and getMousePos()

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js")
// //
// Create a floor of colored tiles some of which emit light. // Create a floor of colored tiles some of which emit light.
// The tiles change color every second creating a strobe-lit dance-floor. // The tiles change color every second creating a strobe-lit dance-floor.

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js");
// //
// constructs a medieval fort // constructs a medieval fort
// //

View file

@ -1,7 +1,22 @@
load(__folder + "drone.js"); /************************************************************************
/* Drone.rainbox() method
Creates a Rainbow ======================
*/ Creates a Rainbow.
Parameters
----------
* radius (optional - default:18) - The radius of the rainbow
Example
-------
var d = new Drone();
d.rainbow(30);
![rainbow example](img/rainbowex1.png)
***/
Drone.extend('rainbow', function(radius){ Drone.extend('rainbow', function(radius){
if (typeof radius == "undefined") if (typeof radius == "undefined")
radius = 18; radius = 18;

View file

@ -3,31 +3,30 @@
* function and provide a new drone to it. * function and provide a new drone to it.
* *
* Parameters: * Parameters:
* callback - any function that accepts a drone as its first argument * callback - any function that accepts a drone as its first argument
* probability - chance to invoke your callback on each iteration * probability - chance to invoke your callback on each iteration
* width - width of the region * width - width of the region
* height - (Optional) height of the region, defaults to width * height - (Optional) height of the region, defaults to width
* depth - (Optional) depth of the cube, defaults to width * depth - (Optional) depth of the cube, defaults to width
*/ */
load(__folder + "drone.js");
Drone.extend("rboxcall", function(callback, probability, width, height, depth) { Drone.extend("rboxcall", function(callback, probability, width, height, depth) {
this.chkpt('rboxcall-start'); this.chkpt('rboxcall-start');
for(var i = 0; i < width; ++i) { for(var i = 0; i < width; ++i) {
this.move('rboxcall-start').right(i); this.move('rboxcall-start').right(i);
for(var j = 0; j < depth; ++j) { for(var j = 0; j < depth; ++j) {
this.move('rboxcall-start').right(i).fwd(j); this.move('rboxcall-start').right(i).fwd(j);
for(var k = 0; k < height; ++k) { for(var k = 0; k < height; ++k) {
if(Math.random()*100 < probability) { if(Math.random()*100 < probability) {
callback.call(null, new Drone(this.x, this.y, this.z)); callback.call(null, new Drone(this.x, this.y, this.z));
} }
this.up(); this.up();
} }
} }
} }
this.move('rboxcall-start'); this.move('rboxcall-start');
return this; return this;
}); });

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js");
/************************************************************************ /************************************************************************
Drone.sphere() method Drone.sphere() method
===================== =====================

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js");
/************************************************************************ /************************************************************************
Drone.spiral_stairs() method Drone.spiral_stairs() method
============================ ============================

View file

@ -2,20 +2,18 @@
* Creates a stream of blocks in a given direction until it hits something other than air * Creates a stream of blocks in a given direction until it hits something other than air
* *
* Parameters: * Parameters:
* block - blockId * block - blockId
* dir - "up", "down", "left", "right", "fwd", "back * dir - "up", "down", "left", "right", "fwd", "back
* maxIterations - (Optional) maximum number of cubes to generate, defaults to 1000 * maxIterations - (Optional) maximum number of cubes to generate, defaults to 1000
*/ */
load(__folder + "drone.js");
Drone.extend("streamer", function(block, dir, maxIterations) { Drone.extend("streamer", function(block, dir, maxIterations) {
for(var i = 0; i < maxIterations||1000; ++i) { for(var i = 0; i < maxIterations||1000; ++i) {
this.box(block); this.box(block);
this[dir].call(this); this[dir].call(this);
if(getBlock(this.x, this.y, this.z) !== "0:0") { if(getBlock(this.x, this.y, this.z) !== "0:0") {
break; break;
} }
} }
return this; return this;
}); });

View file

@ -1,4 +1,3 @@
load(__folder + "drone.js")
// //
// constructs a mayan temple // constructs a mayan temple
// //

View file

@ -1,5 +1,3 @@
load (__folder + "drone.js");
Drone.prototype.testHorizontalStrokeWidth = function(){ Drone.prototype.testHorizontalStrokeWidth = function(){
this.arc({ this.arc({
blockType: 42, blockType: 42,