// Cloned by tuitef2 on 6 Nov 2018 from World "One Cube World" by Starter user
// Please leave this clone trail here.
const skycolor = 'lightblue'; // sky color
const startRadius = 480; // distance from centre we start the camera at
const maxRadius = startRadius * 40; // maximum distance from camera we render things
const skycolorObject = new THREE.Color ( skycolor.toLowerCase() );
function World()
{
var theobject;
var theobject1;
var theobject2;
var theobject3;
var theobject4;
this.newRun = function()
{
ABWorld.init3d ( startRadius, maxRadius, skycolorObject );
var objLoader = new THREE.OBJLoader();
objLoader.setPath("/uploads/tuitef2/");
objLoader.load("butterfly.obj", function(mesh){
theobject = mesh;
ABWorld.scene.add(theobject);
});
objLoader.load("butterfly.obj", function(mesh){
mesh.position.set(10,20,30);
theobject1 = mesh;
ABWorld.scene.add(theobject1);
});
objLoader.load("butterfly.obj", function(mesh){
mesh.position.set(10,40,50);
theobject2 = mesh;
ABWorld.scene.add(theobject2);
});
objLoader.load("butterfly.obj", function(mesh){
mesh.position.set(10,60,50);
theobject3 = mesh;
ABWorld.scene.add(theobject3);
});
objLoader.load("butterfly.obj", function(mesh){
mesh.position.set(10,50,30);
theobject4 = mesh;
ABWorld.scene.add(theobject4);
});
};
this.nextStep = function()
{
theobject.position.x = theobject.position.x + AB.randomIntAtoB ( -30, 30 );
theobject1.position.x = theobject1.position.x + AB.randomIntAtoB ( -30, 30 );
theobject2.position.x = theobject2.position.x + AB.randomIntAtoB ( -30, 30 );
theobject3.position.x = theobject3.position.x + AB.randomIntAtoB ( -30, 30 );
theobject.position.y = theobject.position.y + AB.randomIntAtoB ( -30, 30 );
theobject1.position.y = theobject.position.y + AB.randomIntAtoB ( -40, 10 );
theobject2.position.y = theobject.position.y + AB.randomIntAtoB ( -30, 30 );
theobject3.position.y = theobject.position.y + AB.randomIntAtoB ( -15, 30 );
theobject4.position.y = theobject.position.y + AB.randomIntAtoB ( -30, 30 );
theobject.position.z = theobject.position.z + AB.randomIntAtoB ( -30, 30 );
theobject1.position.z = theobject1.position.z + AB.randomIntAtoB ( -10, 10 );
theobject2.position.z = theobject1.position.z + AB.randomIntAtoB ( -40, 30 );
theobject3.position.z = theobject1.position.z + AB.randomIntAtoB ( -10, 10 );
theobject4.position.z = theobject1.position.z + AB.randomIntAtoB ( -20, 30 );
};
}