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

// Cloned by Leonard Alphonso on 21 Sep 2023 from World "One Cube World (Three.js)" by Starter user 
// Please leave this clone trail here.
 

const skycolor          = 'cyan';           
const boxcolor          = 'red';


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

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

const MUSICFILE = '/uploads/starter/SuspenseStrings.mp3';


// Define the parameters for the dome
var radius = 100; // Radius of the dome
var widthSegments = 32; // Number of horizontal segments
var heightSegments = 16; // Number of vertical segments
var phiStart = 0; // Starting angle for the vertical segments
var phiLength = Math.PI; // Angle to cover for the vertical segments

var geometry = new THREE.SphereGeometry(radius, widthSegments, heightSegments, phiStart, phiLength);
var material = new THREE.MeshBasicMaterial({ color: boxcolor.toLowerCase() });
var theobject = new THREE.Mesh(geometry, material);


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

AB.world.newRun = function() 
{
    
     AB.backgroundMusic ( MUSICFILE );

    
     const texturefile  = '/uploads/leonard/lwallpaperflare.com_wallpaper.jpg';
     var   loader       = new THREE.TextureLoader();
 
    loader.load ( texturefile, function ( thetexture ) 
    // this defines a function to be called whenever the file is loaded 
    {			 
        thetexture.minFilter  = THREE.LinearFilter;
        theobject.material    = new THREE.MeshBasicMaterial ( { map: thetexture } );
    }); 

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

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


};

AB.world.nextStep = function()
{
   //theobject.position.x = theobject.position.x + AB.randomIntAtoB ( -30, 30 );         


};