Code viewer for World: One Cube World (Three.js) ...

// Cloned by Mathieee on 13 Jun 2019 from World "One Cube World (Three.js)" by Starter user 
// Please leave this clone trail here.
 

const skycolor          = 'MarineBlue';          // sky color

const objectsize        = 500;                  // size of object   

const startRadius       = 1000;                 // distance from centre we start the camera at

const maxRadius         = startRadius * 10;     // maximum distance from camera we render things 


// the object is a triangle (each dimension equal): 

ABWorld.drawCameraControls = false;



	var clock = new THREE.Clock();
    var ball, box, tube, ground, donut;



AB.world.newRun = function()

 var shape, cover;
 
 // set up a 3D scene:
 ABWorld.init3d ( startRadius, maxRadius, skycolorObject ); 

 AB.msg ( " <p> Drag and zoom the camera (built-in). </p> " ); 


 var flat = {flatShading: true};
 
 var light = new THREE.AmbientLight('white', 0.8);
 ABWorld.scene.add( light );
  
shape = new THREE.SphereGeometry(100, 20, 15);
   cover = new THREE.MeshNormalMaterial(flat);
   ball = new THREE.Mesh(shape, cover);
 ABWorld.scene.add(ball);
 ball.position.set(-250,250,-250);

shape = new THREE.PlaneGeometry(100, 100);
   cover = new THREE.MeshNormalMaterial(flat);
   ground = new THREE.Mesh(shape, cover);
 ABWorld.scene.add(ground);
 ground.rotation.set(0.5, 0, 0);
 ground.position.set(-250, -250, -250);
 
    shape = new THREE.CylinderGeometry(1, 100, 100, 4);
   cover = new THREE.MeshNormalMaterial(flat);
   tube = new THREE.Mesh(shape, cover);
 ABWorld.scene.add(tube);
 tube.rotation.set(0.5, 0, 0);
 tube.position.set(250, -250, -250);


// Define what the World does at the start of a run: 

AB.world.newRun = function() 

    // start a 3D scene: 
    ABWorld.init3d ( startRadius, maxRadius, skycolor ); 

    // add the object to the scene:
    ABWorld.scene.add ( theobject );


 var shape, cover;