<!-- RUBY-BACKUP · part 108 -->
{} }, 7000);
setTimeout(function(){ try{ buildOutpost(); }catch(e){} }, 8000);
/* THE CITY: around the corner from where you landed — PROVOLTA is there */
var CITY_CENTER = null;
function getCityCenter(){
  try{
    if(CITY_CENTER) return CITY_CENTER;
    var site = (typeof getLandingSite==='function' ? getLandingSite() : {x:0, z:0});
    CITY_CENTER = {x: site.x + 25, z: site.z - 10};
    return CITY_CENTER;
  }catch(e){ return {x:25, z:-10}; }
}
var CITY_BUILT = false;
function buildCity(){
  try{
    if(CITY_BUILT) return;
    var cc = getCityCenter();
    var cityGroup = new THREE.Group();
    var bldgMat = new THREE.MeshStandardMaterial({color:0x4a4a5a, roughness:0.8});
    var winMat = new THREE.MeshStandardMaterial({color:0xffd700, emissive:0xffd700, emissiveIntensity:0.8});
    var towers = [
      {x:-8, z:-5, w:4, h:12, d:4},
      {x:6, z:-8, w:5, h:18, d:5},
      {x:-3, z:7, w:3, h:8, d:3},
      {x:10, z:5, w:4, h:14, d:4}
    ];
    towers.forEach(function(t){
      var b = new THREE.Mesh(new THREE.BoxGeometry(t.w, t.h, t.d), bldgMat);
      b.position.set(cc.x + t.x, t.h/2, cc.z + t.z);
      cityGroup.add(b);
      for(var wy=2; wy<t.h-1; wy+=3){
        var win = new THREE.Mesh(new THREE.BoxGeometry(t.w+0.1, 0.8, t.d+0.1), winMat);
        win.position.set(cc.x + t.x, wy, cc.z + t.z);
        cityGroup.add(win);
      }
    });
    var plaza = new THREE.Mesh(
      new THREE.CylinderGeometry(8, 8, 0.3, 24),
      new THREE.MeshStandardMaterial({color:0x3a3a4a, roughness:0.9})
    );
    plaza.position.set(cc.x, 0.15, cc.z);
    cityGroup.add(plaza);
    if(typeof scene!=='undefined') scene.add(cityGroup);
    CITY_BUILT = true;
  }catch(e){}
}
/* THE OUTPOST — black towers with gold stripes, the ship, the little robot */
function buildOutpost(){
  try{
    var g = new THREE.Group();
    var blackMat = new THREE.MeshStandardMaterial({color:0x0a0a0a, roughness:0.6});
    var goldMat = new THREE.MeshStandardMaterial({color:0xffd700, emissive:0xffd700, emissiveIntensity:0.9});
    var orangeMat = new THREE.MeshStandardMaterial({color:0xff6600, emissive:0xff6600, emissiveIntensity:0.7});
    var tealMat = new THREE.MeshStandardMaterial({color:0x4dd0c4, roughness:0.3, metalness:0.5});
    var redMat = new THREE.MeshStandardMaterial({color:0xff0000, emissive:0xff0000, emissiveIntensity:1.0});
    /* three black towers with gold stripes */
    var towers = [{x:-12,z:0,h:20},{x:0,z:-4,h:26},{x:12,z:0,h:18}];
    towers.forEach(function(t){
      var tw = new THREE.Mesh(new THREE.BoxGeometry(4, t.h, 4), blackMat);
      tw.position.set(t.x, t.h/2, t.z);
      g.add(tw);
      for(var sy=3; sy<t.h-1; sy+=5){
        var stripe = new THREE.Mesh(new THREE.BoxGeometry(4.2, 1, 4.2), goldMat);
        stripe.position.set(t.x, sy, t.z);
        g.add(stripe);
      }
    });
    /* the spaceship — black hull, orange thrusters, teal dome, pointed nose */
    var ship = new THREE.Group();
    ship.name = 'spaceship';
    var hull = new THREE.Mesh(new THREE.BoxGeometry(8, 1.5, 3), blackMat);
    hull.name = 'hull';
    ship.add(hull);
    var nose = new THREE.Mesh(new THREE.ConeGeometry(1.5, 3, 4), blackMat);
    nose.name = 'nose';
    nose.rotation.z = -Math.PI/2;
    nose.position.set(5.5, 0, 0);
    ship.add(nose);
    for(var ti=0; ti<2; ti++){
      var thr = new THREE.Mesh(new THREE.CylinderGeometry(0.7, 0.7, 1.5, 12), orangeMat);
      thr.name = 'thruster-' + (ti+1);
      thr.rotation.z = Math.PI/2;
      thr.position.set(-4.5, -0.3 + ti*0.6, ti===0 ? -0.8 : 0.8);
      ship.add(thr);
    }
    var dome = new THREE.Mesh(new THREE.SphereGeometry(1.2, 16, 12, 0, Math.PI*2, 0, Math.PI/2), tealMat);
    dome.name = 'dome';
    dome.position.set(1, 0.75, 0);
    ship.add(dome);
    var beacon = new THREE.Mesh(new THREE.SphereGeometry(0.3, 8, 8), redMat);
    beacon.name = 'beacon';
    beacon.position.set(0, -1, 0);
    ship.add(beacon);
    ship.position.set(0, 2, 12);
    g.add(ship);
    /* the little robot — black box, red eyes, red antennae */
    var bot = new THREE.Group();
    var body = new THREE.Mesh(new THREE.BoxGeometry(1.5, 1.5, 1.5), blackMat);
    bot.add(body);
    for(var ei=0; ei<2; ei++){
      var eye = new THREE.Mesh(new THREE.BoxGeometry(0.4, 0.3, 0.1), redMat);
      eye.position.set(-0.3 + ei*0.6, 0.2, 0.76);
      bot.add(eye);
    }
    for(var ai=0; ai<2; ai++){
      var ant = new THREE.Mesh(new THREE.CylinderGeometry(0.05, 0.05, 0.8, 6), blackMat);
      ant.position.set(-0.3 + ai*0.6, 1.1, 0);
      bot.add(ant);
      var tip = new THREE.Mesh(new THREE.SphereGeometry(0.12, 8, 8), redMat);
      tip.position.set(-0.3 + ai*0.6, 1.5, 0);
      bot.add(tip);
    }
    bot.position.set(-6, 0.75, 12);
    g.add(bot);
    /* the pavilion house — open sides, column roof, a house like a pavilion */
    var pav = new THREE.Group();
    var floorMat = new THREE.MeshStandardMaterial({color:0x2a2a2a, roughness:0.8});
    var colMat = new THREE.MeshStand