<!-- CODERS100 · part 20 -->
 'accessor', primitiveDef.indices ).then( function ( accessor ) {

				geometry.setIndex( accessor );

			} );
			pending.push( accessor );

		}

		assignExtrasToUserData( geometry, primitiveDef );
		computeBounds( geometry, primitiveDef, parser );
		return Promise.all( pending ).then( function () {

			return primitiveDef.targets !== undefined ? addMorphTargets( geometry, primitiveDef.targets, parser ) : geometry;

		} );

	}
	/**
 * @param {BufferGeometry} geometry
 * @param {Number} drawMode
 * @return {BufferGeometry}
 */


	function toTrianglesDrawMode( geometry, drawMode ) {

		let index = geometry.getIndex(); // generate index if not present

		if ( index === null ) {

			const indices = [];
			const position = geometry.getAttribute( 'position' );

			if ( position !== undefined ) {

				for ( let i = 0; i < position.count; i ++ ) {

					indices.push( i );

				}

				geometry.setIndex( indices );
				index = geometry.getIndex();

			} else {

				console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );
				return geometry;

			}

		} //


		const numberOfTriangles = index.count - 2;
		const newIndices = [];

		if ( drawMode === THREE.TriangleFanDrawMode ) {

			// gl.TRIANGLE_FAN
			for ( let i = 1; i <= numberOfTriangles; i ++ ) {

				newIndices.push( index.getX( 0 ) );
				newIndices.push( index.getX( i ) );
				newIndices.push( index.getX( i + 1 ) );

			}

		} else {

			// gl.TRIANGLE_STRIP
			for ( let i = 0; i < numberOfTriangles; i ++ ) {

				if ( i % 2 === 0 ) {

					newIndices.push( index.getX( i ) );
					newIndices.push( index.getX( i + 1 ) );
					newIndices.push( index.getX( i + 2 ) );

				} else {

					newIndices.push( index.getX( i + 2 ) );
					newIndices.push( index.getX( i + 1 ) );
					newIndices.push( index.getX( i ) );

				}

			}

		}

		if ( newIndices.length / 3 !== numberOfTriangles ) {

			console.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );

		} // build final geometry


		const newGeometry = geometry.clone();
		newGeometry.setIndex( newIndices );
		return newGeometry;

	}

	THREE.GLTFLoader = GLTFLoader;

} )();


===== FILE: public/coders100/coders100.js =====
/* CODERS100 — all codes, organized properly. Intricate. */
(function(){
'use strict';

/* ===== THE LAW: Minimum 0.13 ===== */
window.MINIMUM = 0.13;
window.applyMinimum = function(obj){
  if(!obj) return obj;
  var box = new THREE.Box3().setFromObject(obj);
  var size = new THREE.Vector3(); box.getSize(size);
  var s = Math.min(size.x, size.y, size.z);
  if(s > 0 && s < window.MINIMUM) obj.scale.multiplyScalar(window.MINIMUM / s);
  return obj;
};

/* ===== SCENE ===== */
var canvas = document.getElementById('view');
var renderer = new THREE.WebGLRenderer({canvas: canvas, antialias: true});
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));
var scene = new THREE.Scene();
scene.background = new THREE.Color(0x4a0e0e);
scene.fog = new THREE.Fog(0x87ceeb, 200, 800);
var camera = new THREE.PerspectiveCamera(60, window.innerWidth/window.innerHeight, 0.1, 2000);

var sun = new THREE.DirectionalLight(0xffffff, 1.2);
sun.position.set(100, 200, 100);
scene.add(sun);
scene.add(new THREE.AmbientLight(0xffffff, 0.5));

var groundY = 0;
var ground = new THREE.Mesh(
  new THREE.PlaneGeometry(2000, 2000),
  new THREE.MeshStandardMaterial({color: 0x0a1a4a, roughness: 0.9})
);
ground.rotation.x = -Math.PI/2;
scene.add(ground);

var grid = new THREE.GridHelper(2000, 100, 0xd8a920, 0x8a6a1c);
grid.position.y = 0.1;
grid.material.opacity = 0.3;
grid.material.transparent = true;
scene.add(grid);

/* ===== MATERIALS ===== */
var goldMat = new THREE.MeshStandardMaterial({color: 0xffd700, emissive: 0xffd700, emissiveIntensity: 0.5, roughness: 0.3, metalness: 0.7});
var roadMat = new THREE.MeshStandardMaterial({color: 0x2a2a2a, roughness: 0.8});

/* ===== CAMERA ===== */
var camYaw = 0, camPitch = 0.5, camDist = 20;
var kingPos = new THREE.Vector3(0, 0, 0);
var playerBody = null;
function updateCamera(){
  camera.position.set(
    kingPos.x + Math.cos(camYaw) * Math.cos(camPitch) * camDist,
    kingPos.y + Math.sin(camPitch) * camDist + 2,
    kingPos.z + Math.sin(camYaw) * Math.cos(camPitch) * camDist
  );
  camera.lookAt(kingPos.x, kingPos.y + 2, kingPos.z);
}
var lTX=0, lTY=0, touching=false;
var cameraMode = false; /* Camera toggle controls this */
canvas.addEventListener('touchstart', function(e){ touching=true; lTX=e.touches[0].clientX; lTY=e.touches[0].clientY; }, {passive:true});
canvas.addEventListener('touchmove', function(e){
  if(!touching) return;
  /* Camera drag always live (right joystick also works) */
  camYaw -= (e.touches[0].clientX - lTX) * 0.005;
  camPitch = Math.max(0.1, Math.min(1.4, camPitch + (e.touches[0].clientY - lTY) * 0.005));
  lTX=e.touches[0].clientX; lTY=e.touches[0].clientY;
}, {passiv