cleaned up code.

This commit is contained in:
walterhiggins 2013-01-03 20:16:13 +00:00
parent 11e6c642ff
commit 693b9a3abe

View file

@ -5,22 +5,25 @@ Drone.extend('dancefloor',function(width,length)
width = 5; width = 5;
if (typeof length == "undefined") if (typeof length == "undefined")
length = width; length = width;
//
// create a separate Drone object to lay down disco tiles
//
var disco = new Drone(this.x,this.y, this.z, this.dir); var disco = new Drone(this.x,this.y, this.z, this.dir);
//
// under-floor lighting // under-floor lighting
//
disco.down().box(89,width,1,length).up(); disco.down().box(89,width,1,length).up();
var floorTiles = [35,35,'35:1','35:2','35:3','35:4','35:4','35:4','35:6',20,20]; var floorTiles = [35,35,'35:1','35:2','35:3','35:4','35:4','35:4','35:6',20,20];
// //
// strobe gets called in a java thread // strobe gets called in a java thread
// //
var strobe = function(){ var strobe = function(){
disco.rand(floorTiles,width,1,length);
};
thread = new java.lang.Thread(function(){
while(true){ while(true){
strobe(); disco.rand(floorTiles,width,1,length);
java.lang.Thread.sleep(1000); java.lang.Thread.sleep(1000);
} }
}); };
var thread = new java.lang.Thread(strobe);
thread.start(); thread.start();
return this; return this;
}); });