// Cloned by Uzair Ali on 8 Nov 2018 from World "One Cube World" by Starter user
// Please leave this clone trail here.
const skycolor = 'aqua'; // sky color
const rectangleLength = 50; // size of object
const rectangleHeight = 300;
const sphereDim = 80;
const startRadius = 1000; // distance from centre we start the camera at
const maxRadius = startRadius * 10; // maximum distance from camera we render things
const skycolorObject = new THREE.Color ( skycolor.toLowerCase() );
function World()
{
// the object is a cube (each dimension equal):
var sphere = new THREE.SphereGeometry ( sphereDim );
var rectangle = new THREE.BoxGeometry ( rectangleLength, rectangleHeight, rectangleLength );
var sphereObj = new THREE.Mesh ( sphere );
var rectObj = new THREE.Mesh (rectangle );
this.newRun = function()
{
// start a 3D scene:
ABWorld.init3d ( startRadius, maxRadius, skycolorObject );
// add the object to the scene:
ABWorld.scene.add( sphereObj );
ABWorld.scene.add( rectObj );
};
this.nextStep = function()
{
sphereObj.position.x = sphereObj.position.x + AB.randomIntAtoB ( -30, 30 );
sphereObj.position.y = sphereObj.position.y + AB.randomIntAtoB ( -30, 30 );
sphereObj.position.z = sphereObj.position.z + AB.randomIntAtoB ( -30, 30 );
};
}