-
Notifications
You must be signed in to change notification settings - Fork 1
/
index-minified.html
20 lines (18 loc) · 37.1 KB
/
index-minified.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<!-- a game by Wololoa @2019 -->
<title>Baby please! come back home - JS13K 2019</title>
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
<script src="https://aframe.io/releases/0.9.2/aframe.min.js"></script>
<style>
body{margin:0;padding:0;font-family:"Liberation Sans",Arial,sans;font-size:2vw;text-align:center}:root{--c-p:black;--c-a:red;box-sizing:border-box;cursor:default}.spinner{position:absolute;top:45%;left:45%;animation:spinner 1s linear infinite;border:.5em solid var(--c-p);border-top-color:var(--c-a);border-radius:100%;display:block;height:5em;width:5em}@keyframes spinner{to{transform:rotate(1turn)}}:selection{color:#111;background-color:#c0dc67}body,html{width:100%;height:100%;background-color:#11111b;color:#afd33d;font-size:calc(6.4px + .8125vw)}.error-body{position:relative;width:100%;height:100%;overflow:hidden}.error-body:before{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background-color:#afd33d;mix-blend-mode:overlay;z-index:1}.error-body:after{content:'';position:fixed;top:0;left:0;width:100%;height:100%;background:linear-gradient(90deg,#11111b 21px,transparent 1%) center,linear-gradient(#11111b 21px,transparent 1%) center,#fff;background-size:22px 22px;background-position:center;opacity:.3;z-index:1}.error-body .background{position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;filter:grayscale(1);mix-blend-mode:luminosity}.error-body .message{position:relative;width:100%;height:100%;text-align:center;z-index:3}.error-body .message h1{position:absolute;top:15%;left:0;width:100%;font-size:6em;margin:0;animation:shake .9s ease-in-out infinite alternate;text-shadow:0 0 .07em #afd33d,-.2em 0 2em rgba(175,211,61,.3),.2em 0 2em rgba(175,211,61,.3);user-select:none}.error-body .message h1:before{content:attr(t);position:absolute;left:50%;top:50%;transform:translate(-50%,.34em);height:.8em;line-height:.5em;width:100%;animation:scan .5s ease-in-out infinite alternate 587ms,glitch-anim .3s ease-in-out infinite alternate;overflow:hidden;opacity:.97}.error-body .message h1:after{content:attr(t);position:absolute;top:-10px;left:50%;transform:translate(-50%,.34em);height:.5em;line-height:.1em;width:100%;animation:scan 665ms ease-in-out infinite alternate 443ms,glitch-anim .3s ease-in-out infinite alternate;overflow:hidden;opacity:.8}.error-body .message .bottom{position:absolute;top:55%;left:0;width:100%;font-size:.75em}.error-body .message a,.error-body .message p{font-size:2em;font-family:monospace;text-shadow:0 0 5px #afd33d;font-color:#141414;filter:blur(.5px)}.error-body .message a{position:relative;color:#afd33d;text-decoration:none;font-weight:700;border:2px solid #afd33d;text-transform:uppercase;padding:5px 30px;box-shadow:inset 0 0 0 0 rgba(175,211,61,.2);transition:25ms ease-in-out all 0s;overflow:hidden;animation:attn 3s ease-in-out infinite}.error-body .message a:hover{cursor:crosshair;box-shadow:inset 0 -2em 0 0 rgba(175,211,61,.2);transition:225ms ease-in-out all 225ms;animation:none}.error-body .message a:hover:after,.error-body .message a:hover:before{transform:translate(-50%,0) scale(0,1)}.error-body .message a:active{box-shadow:inset 0 -2em 0 0 rgba(175,211,61,.5);transition:225ms ease-in-out all 225ms}.error-body .message a:after,.error-body .message a:before{content:'';position:absolute;left:50%;transform:translate(-50%,0) scale(1,1);transform-origin:center;background-color:#11111b;width:90%;height:5px;transition:225ms ease-in-out all;mix-blend-mode:hard-light}.error-body .message a:before{top:-4px}.error-body .message a:after{bottom:-4px}@keyframes scan{100%,20%,from{height:0;transform:translate(-50%,.44em)}10%,15%{height:1em;line-height:.2em;transform:translate(-55%,.09em)}}to{text-shadow:0 0 .07em #afd33d,-.2em 0 2em rgba(175,211,61,.3),.2em 0 2em rgba(175,211,61,.3)}30%,35%{opacity:.4}10%{transform:translate(2px,1px)}30%{transform:translate(-3px,2px)}35%{transform:translate(2px,-3px);filter:blur(4px)}45%{transform:translate(2px,2px) skewY(-8deg) scale(.96,1);filter:blur(0)}50%{transform:translate(-3px,1px)}10%{clip:rect(66px,9999px,24px,0)}20%{clip:rect(22px,9999px,97px,0)}30%{clip:rect(65px,9999px,70px,0)}40%{clip:rect(24px,9999px,78px,0)}50%{clip:rect(61px,9999px,19px,0)}60%{clip:rect(60px,9999px,84px,0)}70%{clip:rect(36px,9999px,58px,0)}80%{clip:rect(34px,9999px,4px,0)}90%{clip:rect(83px,9999px,70px,0)}100%{clip:rect(12px,9999px,68px,0)}
</style>
<body>
<section id="loading" class="loading"><div id="intro" class="spinner"></div></section><section id="title" class="error-body" style="display: none;"><div class="message"><h1 t="Baby, please! Come back home">Baby, please! Come back home</h1><div class="bottom"><p>And bring mommy lots of tasty toxic waste rings!</p><br><br><p><a href="#" onclick='go();'>PLAY</a></p></div></div></section><div id="pause" class="error-body" style="display: none;"><div class="message"><h1 t="P A U S E D"><br>P A U S E D</h1><div class="bottom"><a href="#" onclick='unpause();'>CONTINUE</a></div></div></div><div id="over" class="error-body" style="display: none;"><div class="message"><h1 t="O O O P S Y"><br>O o o p s y</h1><div class="bottom"><p id="lol">Looks like you are kinda dead or something :O</p><a href="#" onclick='restart();'>RESURRECT?</a></div></div></div><a-scene game vr-mode-ui="enabled: false" background="color: #211" fog="type: linear; near: 550; far: 1500; color: #020d04" renderer="logarithmicDepthBuffer: true;"><a-assets id="assets"> <canvas id="TSK" width="512" height="256"></canvas> <canvas id="TCD" width="512" height="256"></canvas> <canvas id="TBD" width="1024" height="512"></canvas> <canvas id="TCT" width="256" height="256"></canvas> <canvas id="TCL" width="128" height="64"></canvas> <canvas id="TN0" width="256" height="512"></canvas> <canvas id="TN1" width="256" height="512"></canvas> <canvas id="TN2" width="256" height="512"></canvas> <canvas id="TN3" width="256" height="512"></canvas> <canvas id="TN4" width="256" height="512"></canvas> <canvas id="TN5" width="256" height="512"></canvas> <canvas id="TN6" width="256" height="512"></canvas> <canvas id="TN7" width="256" height="512"></canvas> <canvas id="TN8" width="256" height="512"></canvas> <canvas id="TN9" width="256" height="512"></canvas></a-assets><a-light color="#bf9dae" type="ambient" intensity="0.5" ></a-light><a-sky id="sky" src="#TSK" material="fog: false" radius="3500"></a-sky><a-sky id="clouds" src="#TCD" blending="multiply" material="fog: false;" opacity="0.90" radius="3450"></a-sky> <a-box id="ground" position="-5000 -1 0" rotation="-90 0 0" width="15000" height="15000" deep="2" color="#574d51"></a-box><a-entity id="taxi" position="200 2500 4000" rotation="0 180 0"> <a-camera id="cam" far="4000" position="0 .3 0" look-controls="enabled: false" active rotation="0 0 0" active="false"> <a-light color="#feb94c" position="0 2.5 -3" distance="1550" intensity="15.5" decay="0.9" type="point"></a-light> <a-box id="pb5" src="#TCT" color="#3388ff" repeat="0.06 0.05" position="-0.45 0 -0.25" width=".025" depth=".025" height="1.53" rotation=" 35 0 -15"></a-box> <a-box id="pb5" src="#TCT" color="#3388ff" repeat="0.06 0.05" position=" 0.45 0 -0.25" width=".025" depth=".025" height="1.53" rotation=" 35 0 15"></a-box> <a-entity id="compass" position="0 -1.2 -2.2"><a-box id="c3" position="0 0.07 0.25" width="0.015" height="0.25" depth="0.015" rotation="-45 0 0" material="fog: false; color: #1be21b;"><a-box id="c3" position="0 -0.12 -0.12" width="0.015" height="0.25" depth="0.015" rotation=" 90 0 0" material="fog: false; color: #1be21b;"></a-entity> </a-camera></a-entity></a-scene>
<script>
function rnd(t,e){return Math.random()*(e-t)+t}function rndi(t,e){return parseInt(rnd(t,e))}function rnda(t){return t[Math.floor(Math.random()*t.length)]}function ncol(){return rnda(["#f31","#13f","#f3f","#111"])}function ctex(t,e,n){return{w:window[t].width=e,h:window[t].height=n,ctx:window[t].getContext("2d")}}function cblur(t,e,n){t.shadowBlur=e,t.shadowColor=n}function cbox(t,e,n,a,r,i,o){t.fillStyle=i,t.strokeStyle=i,t.lineJoin="round",t.beginPath(),o?(t.rect(e,n,a,r),t.lineWidth=""+o,t.stroke()):t.fillRect(e,n,a,r)}function ccircle(t,e,n,a,r){t.fillStyle=r,t.beginPath(),t.arc(e,n,a,0,6.28,!1),t.fill()}function cellipse(t,e,n,a,r,i){t.fillStyle=i,t.beginPath(),t.ellipse(e,n,a,r,0,0,6.28),t.fill()}function ctext(t,e,n,a,r,i){t.fillStyle=i,t.font=r+"px Arial",t.textAlign="center",t.fillText(a,e,n)}function rgba(t,e,n,a){return"rgba("+t+","+e+","+n+","+a+")"}var GKEYS=[],GTV={x:1,y:0,z:0},GSCENE=cam.sceneEl,GPA=!1,GEN=!1,GMSX=null,GSL=null;function unpause(){GPA=!1,document.getElementById("pause").style.display="none",GMSX.clock.resume()}function restart(){window.location.reload(!0)}function gameover(t){GMSX.clock.pause(),zzfx(1.5,0,150,1.295,.032,0,18,0,.19),GEN=!1,fx("#fbfbfb",1),zzfx(1,2,10,1.9,.11,0,0,11.7,2.35),document.getElementById("over").style.display="block";var e=1==GPP?"":"s";document.getElementById("lol").innerHTML=t+"<br>You got "+GPP+" waste ring"+e+"!"}window.make=function(t,e,n){var a=document.createElement("a-"+t);for(var r in e)a.setAttribute(r,e[r]);return n?n.appendChild(a):GSCENE.appendChild(a),a},HTMLElement.prototype.make=function(t,e){return make(t,e,this)},window.addEventListener("blur",function(){GPA=!0,GMSX&&GMSX.clock&&GMSX.clock.pause(),document.getElementById("pause").style.display="block"}),window.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},document.addEventListener("keydown",t=>{GKEYS[t.key.toUpperCase()]=!0,t.stopPropagation()}),document.addEventListener("keyup",t=>{GKEYS[t.key.toUpperCase()]=!1,t.stopPropagation()}),zzfx_v=.5,zzfx_x=new AudioContext,zzfx=((t,e,n,a=1,r=.1,i=0,o=0,c=0,u=0)=>{let s=44100,l=Math.PI;n*=2*l/s,n*=1+e*(2*Math.random()-1),i*=1e3*l/s**2,r*=0|(a=0<a?s*(10<a?10:a)|0:1),c*=2*l/s,u*=l,e=[];for(var d=0,f=0,p=0;p<a;++p)e[p]=t*zzfx_v*Math.cos(d*n*Math.cos(f*c+u))*(p<r?p/r:1-(p-r)/(a-r)),d+=1+o*(2*Math.random()-1),f+=1+o*(2*Math.random()-1),n+=i;return t=zzfx_x.createBuffer(1,a,s),n=zzfx_x.createBufferSource(),t.getChannelData(0).set(e),n.buffer=t,n.connect(zzfx_x.destination),n.start(),n}),"function"!=typeof Object.beget&&(Object.beget=function(t){var e=function(){};return e.prototype=t,new e}),mixinTable=function(t,e){for(var n in e)t[n]=e[n]},ZL={},ZL.setFilterType=function(t,e){e=e.toLowerCase(),t.type=e},ZL.setOscType=ZL.setFilterType,Z={},Z.getContext=function(){return AudioContext},Z.hasAPI=function(){var t=Z.getContext();return"function"==typeof t||"object"==typeof t},Z.ctx=void 0,Z.init=function(){Z.hasAPI()&&(Z.ctx=new(Z.getContext()),Z.ctx.listener.setPosition(0,0,0)),Z.generated=Z.initGenerated()},AudioEffect=function(){var t={connect:function(e){t.output.connect(Z.H.getConnectionNode(e))},isSubpatch:!0};return t},CHS=function(){var t=AudioEffect();t.nodes=[],t.top=void 0,t.addNode=function(e,n){t.input.disconnect(),t.input.connect(Z.H.getConnectionNode(n)),t.top?n.connect(Z.H.getConnectionNode(t.top)):n.connect(t.prefaderOutput),t.top=n,t.nodes[e]=n};var e=Z.ctx.createGain(),n=Z.ctx.createGain(),a=Z.ctx.createGain();return e.gain.value=1,t.output=e,n.gain.value=1,t.input=n,a.gain.value=1,t.prefaderOutput=a,n.connect(a),a.connect(e),t.nodes.out=e,t.nodes.in=n,t.nodes.prefaderOutput=a,t},Channel=function(){var t=CHS();return t.event=function(e){var n=MSE(e);return n.node=t.input,n.channel=t.channel,n},t},Bus=function(){return CHS()},MMX=function(){var t={};return t.master=CHS(),t.master.connect(Z.ctx.destination),t.channels=[],t.busses=[],t.sends=[],t.addChannel=function(e){var n=Channel();return n.connect(t.master.input),t.channels[e]=n,n},t.addBus=function(e,n,a){var r=Bus();if(r.connect(t.master.input),t.busses[e]=r,n)t.addSend(e+"-send",n,r.input,a);return r},t.addSend=function(e,n,a,r){r=r||1;var i=Z.ctx.createGain();return n.connect(i),i.connect(a),t.sends[e]=i,i.gain.value=r,i},t},Gen={},Gen.OscillatorBurst=function(t,e,n,a,r,i){i=i||0;var o=Z.ctx.createOscillator();return ZL.setOscType(o,n),Z.H.setParam(o.frequency,a),Z.H.setParam(o.detune,i),o.start(e),o.stop(e+r),Z.H.connectIfNode(o,t),o},Gen.OscillatorStackBurst=function(t,e,n,a,r,i,o){var c=Z.ctx.createGain();c.gain.setValueAtTime(1,e);for(var u=0;u<a.length;u++){var s=Z.ctx.createGain();Z.H.setParam(s.gain,i[u]);Gen.OscillatorBurst(s,e,a[u],n,o,r[u]);s.connect(c)}return Z.H.connectIfNode(c,t),c},Gen.WhiteNoiseBurst=function(t,e,n){var a=Z.ctx.createBufferSource();a.buffer=Z.generated.buffers.whiteNoise,a.loop=!0,Z.H.connectIfNode(a,t);var r=Math.random()*Z.generated.buffers.whiteNoise.duration;return a.start(e,r,n),a.stop(e+n),a},Gen.PercEnv=function(t,e,n,a,r){null==r&&(r=1);var i=Z.ctx.createGain();return i.gain.value=0,i.gain.setValueAtTime(0,e),i.gain.linearRampToValueAtTime(r,e+n),i.gain.linearRampToValueAtTime(0,e+n+a),Z.H.connectIfNode(i,t),i},Gen.EnvGain=function(t,e){var n=Z.ctx.createGain();return Z.H.setParam(n.gain,e),Z.H.connectIfNode(n,t),n},Gen.FilterSweep=function(t,e,n,a,r,i,o){o=o||1;var c=Z.ctx.createBiquadFilter();return ZL.setFilterType(c,n),c.Q.value=o,c.frequency.value=a,c.frequency.setValueAtTime(a,e),c.frequency.linearRampToValueAtTime(r,e+i),Z.H.connectIfNode(c,t),c},FX={},FX.PanPot=function(t,e){var n=AudioEffect();e=e||0;var a=Z.ctx.createPanner();return a.panningModel="equalpower",n.setPan=function(t){var e=Math.sin(.5*Math.PI*t),n=-Math.cos(.5*Math.PI*t);a.setPosition(e,0,n)},n.setPan(e),n.input=a,n.output=a,Z.H.connectIfNode(a,t),n},FX.FeedbackDelay=function(t,e,n){var a=AudioEffect(),r=Z.ctx.createDelay(2*e);r.delayTime.value=e;var i=Z.ctx.createGain();return i.gain.value=n,r.connect(i),i.connect(r),a.feedback=i.gain,a.delayTime=r.delayTime,a.input=r,a.output=r,Z.H.connectIfNode(r,t),a},FX.Filter=function(t,e,n,a){var r=AudioEffect();a=a||1,n=n||350;var i=Z.ctx.createBiquadFilter();return ZL.setFilterType(i,e),r.freq=i.frequency,r.Q=i.Q,r.freq.value=n,r.Q.value=a,r.input=i,r.output=i,Z.H.connectIfNode(i,t),r},FX.WaveShaper=function(t,e,n,a){var r=AudioEffect(),i=Z.ctx.createGain();i.gain.value=e;var o=Z.ctx.createGain();o.gain.value=n;var c=Z.ctx.createWaveShaper();return c.curve=a,i.connect(c),c.connect(o),r.output=o,r.input=i,Z.H.connectIfNode(r.output,t),r.preGain=i.gain,r.postGain=o.gain,r},FX.Compressor=function(t,e,n,a,r,i,o){var c=AudioEffect();e=e||-12,n=n||30,a=a||12,i=i||.003,o=o||2;var u=Z.ctx.createDynamicsCompressor();return u.threshold.value=e,u.knee.value=n,u.ratio.value=a,u.attack.value=i,u.release.value=o,c.output=u,c.input=u,Z.H.connectIfNode(c.output,t),c};var Env={BaseClass:function(){var t={isEnv:!0,canApplyFunction:!0};return t},DoBaseClass:function(){var t={isParamSetter:!0,canApplyFunction:!0};return t},NLine:function(t,e,n,a){var r=Env.BaseClass();return r.create=function(r){return Env.DoNLine(t,e,r.startTime,r.startTime+n,a)},r},XLine:function(t,e,n){return"object"==Z.H.getType(t)?Env.XLine(t.startValue,t.stopValue,t.length).create(t).set(t.param):Env.NLine(t,e,n,"exponentialRampToValueAtTime")},DoNLine:function(t,e,n,a,r){var i=Env.DoBaseClass();return i.applyFunction=function(i){return Env.DoNLine(i(t),i(e),n,a,r)},i.set=function(i){i.setValueAtTime(t,n),i[r](e,a)},i.length=a-n,i},Custom:function(t,e,n){if("object"==Z.H.getType(t))return Env.Custom(t.values,t.times,t.types).create(t).set(t.param);var a=Env.BaseClass();return a.create=function(a){return Env.DoCustom(t,e,n,a.startTime)},a},DoCustom:function(t,e,n,a){var r=Env.DoBaseClass();r.set=function(r){var i=a;r.setValueAtTime(t[0],i);for(var o=0;o<t.length-1;o++)i+=e[o],"exp"==n[o]?r.exponentialRampToValueAtTime(t[o+1],i):r.linearRampToValueAtTime(t[o+1],i)};for(var i=0,o=0;o<e.length;o++)i+=e[o];return r.length=i,r},Perc:function(t,e,n,a){return"object"==Z.H.getType(t)?Env.Perc(t.attackTime,t.releaseTime,t.level,t.baseLevel).create(t).set(t.param):(n=n||1,a=a||0,Env.Custom([a,n,a],[t,e],["lin","lin"]))}};EventAgent=function(t,e){var n={};return t=t||4,e=e||Z.defaultQuantClock,n.quant=t,n.clock=e,n.finished=!1,n.nextPollTime=e.nextQuant(t),n.update=function(){},n.emit=function(){},n.poll=function(){return e.currentBeats()<n.nextPollTime||n.finished?void 0:n.emit()},n},NOPAgent=function(t,e){var n=EventAgent(t,e);return n.nextPollTime=1/0,n.poll=function(){},n},AgentProxy=function(t,e,n){var a=EventAgent(e,n);return a.agent=t,a.nextAgent=void 0,a.poll=function(){return a.agent.poll()},a.update=function(){a.nextAgent&&(a.nextAgent.update(),a.nextAgent.nextPollTime<=a.agent.nextPollTime&&(a.agent=a.nextAgent,a.nextAgent=void 0)),t.update(),a.nextPollTime=a.agent.nextPollTime},a.replace=function(t){a.nextAgent=t},a},FuncAgent=function(t,e,n){var a=EventAgent(e,n);return a.emit=function(){var e=MSE({clock:a.clock,start:a.nextPollTime});if(e=t(e))return a.nextPollTime=a.nextPollTime+e.dur,e},a},PatternAgent=function(t,e,n){e=t.quant||e;var a=EventAgent(e,n),r={};for(key in t)r[key]=Z.patterns.H.buildStream(t[key]);return a.emit=function(){var t;r.channel?t=r.channel.next().event({clock:a.clock,start:a.nextPollTime}):t=MSE({clock:a.clock,start:a.nextPollTime});for(key in r){var e=r[key].next(t);t[key]=e}return a.nextPollTime=a.nextPollTime+t.dur,t},a},AgentManager=function(){var t={agents:[],addAgent:function(e,n){t.agents[e]=n},update:function(){for(key in t.agents){var e=t.agents[key];for(e.update();;){var n=e.poll();if(!n)break;n.play()}}}};return t},Z.initGenerated=function(){that={},that.buffers={},that.arrays={};var t=44100;that.sampleRate=44100,that.noiseSize=176400,that.lOscBaseFreq=400,that.buffers.whiteNoise=Z.ctx.createBuffer(1,176400,t);for(var e=that.buffers.whiteNoise.getChannelData(0),n=0;n<176400;n++)e[n]=2*Math.random()-1;that.buffers.lfsaw=Z.ctx.createBuffer(1,176400,t);var a=that.buffers.lfsaw.getChannelData(0),r=1/220.5,i=0;for(n=0;n<176400;n++)(i+=r)>1&&(i-=2),a[n]=i;that.buffers.lftri=Z.ctx.createBuffer(1,176400,t);var o=that.buffers.lftri.getChannelData(0);for(r=1/110.25,i=0,n=0;n<176400;n++)i+=r,Math.abs(i)>1&&(r*=-1,i>1&&(i=1),i<-1&&(i=-1)),o[n]=i;that.buffers.lfpulse=Z.ctx.createBuffer(1,176400,t);var c=that.buffers.lfpulse.getChannelData(0),u=(i=1,220.5),s=0;for(n=0;n<176400;n++)c[n]=i,(s+=1)>u&&(s=0,i*=-1);that.buffers.lfnoise=Z.ctx.createBuffer(1,176400,t);var l=that.buffers.lfnoise.getChannelData(0);for(i=Math.random(),u=441/8,s=0,n=0;n<176400;n++)l[n]=i,(s+=1)>=u&&(s=0,i=2*Math.random()-1);that.buffers.silent=Z.ctx.createBuffer(1,4096,t);for(a=that.buffers.silent.getChannelData(0),n=0;n<4096;n++)a[n]=0;that.arrays.sine=new Float32Array(176400);for(n=0;n<176400;n++)that.arrays.sine[n]=Math.sin(Math.PI*n/176400);that.arrays.tanh=new Float32Array(176400);for(n=0;n<176400;n++){var d=n/176400*10-5;that.arrays.tanh[n]=(Math.exp(d)-Math.exp(-d))/(Math.exp(d)+Math.exp(-d))}that.arrays.logistic=new Float32Array(176400);for(n=0;n<176400;n++){d=n/176400*12-6;that.arrays.logistic[n]=1/(1+Math.exp(-n))}return that},Z.H={},Z.H.getType=function(){var t={undefined:"undefined",number:"number",boolean:"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},e=Object.prototype.toString;return function(n){return t[typeof n]||t[e.call(n)]||(n?"object":"null")}}(),Z.H.mixinObject=function(t,e){for(var n in e)t[n]=e[n]},Z.H.getConnectionNode=function(t){return t.isSubpatch?t.input:t},Z.H.connectIfNode=function(t,e){e&&(e=Z.H.getConnectionNode(e),t.connect(e))},Z.H.setParam=function(t,e){e.isParamSetter?e.set(t):t.value=e},Z.H.tryApplyFunction=function(t,e){return"object"==typeof e&&e.canApplyFunction?e.applyFunction(t):t(e)},Instr={},Instrument=function(t,e){var n=AudioEffect();if(n.output=Z.ctx.createGain(),n.input=n.output,n.output.gain.value=t.amp,t.pan){var a=FX.PanPot(n.input,t.pan);n.input=a.input}if(t.node&&n.output.connect(t.node),e)for(key in e)void 0===t[key]&&(t[key]=e[key]);return null!=t.env&&null!=t.env.length&&(t.len=t.env.length),n},Instr.WNHat=function(t){var e=Instrument(t,{fltrStart:12e3,fltrStop:5e3,fltrLen:.05,fltrQ:5}),n=Gen.PercEnv(e,t.startTime,1e-5,t.len),a=Gen.FilterSweep(n,t.startTime,"HIGHPASS",t.fltrStart,t.fltrStop,t.fltrLen,t.fltrQ);return Gen.WhiteNoiseBurst(a,t.startTime,t.len),e},Instr.OSCStackFilter=function(t){var e,n=Instrument(t,{types:["SAWTOOTH","SQUARE","SAWTOOTH"],detunes:[0,10,14],amps:[.5,.3,.2],attack:1e-4,decay:.2,filter:Env.XLine(100,2e3,.1).create(t),filterQ:10,filterType:"LOWPASS",env:Env.Perc(.001,t.len-.001).create(t)});t.filter?(e=FX.Filter(n,t.filterType,100,t.filterQ),Z.H.setParam(e.freq,t.filter)):lfltrpf=n;var a=Gen.EnvGain(e,t.env);return Gen.OscillatorStackBurst(a,t.startTime,t.freq,t.types,t.detunes,t.amps,t.attack+t.decay),n},Instr.LFOscillator=function(t){var e=Instrument(t,{env:Env.Perc(.001,t.len-.001).create(t)}),n=Gen.EnvGain(e,t.env),a=Z.ctx.createBufferSource();a.buffer=t.buffer,a.loop=!0,a.start(t.startTime),a.stop(t.startTime+t.len);var r=Z.H.tryApplyFunction(function(t){return t/Z.generated.lOscBaseFreq*(Z.generated.noiseSize/Z.generated.sampleRate)},t.freq);return Z.H.setParam(a.playbackRate,r),Z.H.connectIfNode(a,n),e},Z.patterns={},Z.patterns.H=function(){var t={buildStream:function(t){return"object"==Z.H.getType(t)&&t.isPattern?t.asStream():Z.patterns.Pconst(t).asStream()},buildStreamArray:function(e){for(var n=[],a=0;a<e.length;a++)n.push(t.buildStream(e[a]));return n}};return t}();var Pattern=function(){var t={isPattern:!0,trace:function(e){return Z.patterns.Ptrace(t,e)},mul:function(e){return Z.patterns.Pmul(t,e)}};return t},PatternStream=function(t){var e={isStream:!0};return e};Z.patterns.Pconst=function(t){var e=Pattern();return e.asStream=function(){var n=PatternStream(e);return n.next=function(e){return t},n},e},Z.patterns.Place=function(t,e){e=e||1/0;var n=Pattern();return n.asStream=function(){var a=PatternStream(n),r=Z.patterns.H.buildStreamArray(t),i=-1;return a.next=function(t){if((i+=1)<e*r.length)return r[i%r.length].next()},a},n},Z.patterns.PbinOp=function(t,e,n){var a=Pattern();return a.asStream=function(){var r=PatternStream(a),i=Z.patterns.H.buildStream(t),o=Z.patterns.H.buildStream(e);return r.next=function(t){switch(n){case"*":return i.next(t)*o.next(t)}},r},a},Z.patterns.Pmul=function(t,e){return Z.patterns.PbinOp(t,e||1,"*")},Z.patterns.Pwhite=function(t,e){var n=Pattern();return n.asStream=function(){var a=PatternStream(n);return a.next=function(n){return t+Math.random()*(e-t)},a},n},QuantClock=function(t,e,n,a){void 0===n&&(n=!0),t=t||120,e=e||.2;var r={},i=0;r.isPaused=!1,r.setTempo=function(t){r.bpm=t,r.bps=t/60},r.setTempo(t),r.update=function(t){r.isPaused||(r.currentTime=t||Z.ctx.currentTime+e,r.currentClientTime=r.currentTime-e+.035,r.currentClientBeatTime=r.currentClientTime-i,r.currentClientBeat=r.currentClientBeatTime*r.bps)},r.rebase=function(t){t=t||0,r.startTime=Z.ctx.currentTime-t/r.bps,r.update()},r.rebase(0),r.relativeStartTime=function(){return r.startTime+i},r.nextDivision=function(t,e){return t=t||1,e=e||r.currentBeats(),Math.ceil(e*t)/t},r.audioTime=function(t){return r.relativeStartTime()+t/r.bps},r.absoluteAudioClientBeatTime=function(t){return r.startTime+t/r.bps-e+.035},r.nextBar=function(){return r.nextDivision(.25)},r.nextBeat=function(){return r.nextDivision(1)},r.currentBeats=function(){return(r.currentTime-r.relativeStartTime())*r.bps},r.nextQuant=function(t,e){var n=Quant(t);return r.nextDivision(1/n.quant,e)+n.phase+n.offset};var o=0;return r.pause=function(t){o=Z.ctx.currentTime,r.isPaused=!0},r.resume=function(t){i+=Z.ctx.currentTime-o,r.isPaused=!1},n&&(window.addEventListener("blur",r.pause),window.addEventListener("focus",r.resume)),Z.defaultQuantClock&&!a||(Z.defaultQuantClock=r),r};var Quant=function(t,e,n){return t.isQuant?t:{quant:t,phase:e=e||0,offset:n=n||0,isQuant:!0}},MSEHelpers=function(){var t={},e={major:[0,2,4,5,7,9,11],minor:[0,2,3,5,7,8,10],minorPentatonic:[0,3,5,7,10],majorPentatonic:[0,2,4,7,9],blues:[0,3,5,6,7,10]};return t.degree2midi=function(t){t.midi=Z.H.tryApplyFunction(function(n){var a=e[t.scale],r=12*t.octave+t.root+a[n%a.length];return n>=a.length&&(r+=12*Math.floor(n/a.length)),r},t.degree)},t.midi2freq=function(t){t.freq=Z.H.tryApplyFunction(function(e){return Math.pow(2,(e-69)/12)*t.standard_pitch},t.midi)},t.processKeys=function(e){null!=e.dur&&null==e.len&&(e.len=e.dur*e.sustain/e.clock.bps),null==e.midi&&t.degree2midi(e),null==e.freq&&null!=e.midi&&t.midi2freq(e),e.start=e.start+e.offset,null==e.startTime&&(e.startTime=e.clock.audioTime(e.start))},t}();function msx(){if(Z.init(),void 0!==Z.ctx.createOscillator){var t=Z.ctx.createOscillator(),e=Z.ctx.createGain();e.gain.value=0,t.connect(e),t.start(0),e.connect(Z.ctx.destination)}GMSX=AcidProto(),function t(){GMSX.update(),requestAnimationFrame(t,1e3/60)}()}function go(){GEN=!0,document.getElementById("title").style.display="none",zzfx(1,0,550,.25,0,.015,.1,0,.25),zzfx(.05,2,1112,33.8,.23,.1,2.6,0,.14),msx()}function fx(t,e){GSCENE.setAttribute("fog","color",t),e&&GSCENE.setAttribute("fog","near",e)}MSE=function(){var t={root:0,scale:"minor",octave:3,standard_pitch:440,degree:0,amp:1,sustain:1,dur:1,offset:0};return function(e){var n=Object.beget(t);return e&&Z.H.mixinObject(n,e),n.clock=Z.defaultQuantClock,n.process=function(){return MSEHelpers.processKeys(n),n},n.play=function(t){for(key in e.quant&&(t=e.quant),t&&(n.start=n.clock.nextQuant(t,n.start)),!n.node&&n.channel&&(n.node=n.channel.input),n.process(),n)"object"==typeof n[key]&&n[key].isEnv&&(n[key]=n[key].create(n));1!=n.rest&&n.action(n)},n}}(),MBKick=function(t){var e=Instrument(t,{attack:1e-4,decay:.17,fmul:4}),n=Gen.PercEnv(e,t.startTime,t.attack,t.decay);Gen.OscillatorBurst(n,t.startTime,"SINE",t.freq,t.attack+t.decay);return e},AcidProto=function(){var t={},e=QuantClock(120,.1,!1);fd=AcidProtoState(t,16,12),mx=MMX(),t.clock=e,t.fd=fd,function(){mx.master.addNode("filter",FX.Filter(!1,"HIGHPASS",10,4)),mx.master.addNode("comp",FX.Compressor(!1)),mx.addChannel("kick"),mx.channels.kick.addNode("filter",FX.Filter(!1,"LOWPASS",8e3,1.5)),mx.channels.kick.output.gain.value=1,mx.channels.kick.addNode("dist",FX.WaveShaper(!1,.53,.85,Z.generated.arrays.tanh)),mx.addChannel("hat"),mx.channels.hat.output.gain.value=.7;var t=mx.addBus("hatBus",mx.channels.hat,.4),e=mx.addBus("bassBus",mx.channels.bass,.5),n=mx.addBus("noiseBus",mx.channels.noise,1),a=mx.addBus("revBus");t.addNode("fb",FX.FeedbackDelay(!1,.375,.2)),t.addNode("filter",FX.Filter(!1,"LOWPASS",2e3)),mx.addChannel("snare"),mx.channels.snare.output.gain.value=.6,mx.addChannel("bass"),mx.channels.bass.addNode("dist",FX.WaveShaper(!1,.4,.75,Z.generated.arrays.tanh)),mx.channels.bass.addNode("lpf",FX.Filter(!1,"LOWPASS",8e3,1)),e.addNode("fb",FX.FeedbackDelay(!1,.25,.35)),e.addNode("filter",FX.Filter(!1,"HIGHPASS",1e3)),mx.addChannel("noise"),mx.channels.noise.addNode("lpf",FX.Filter(!1,"LOWPASS",12e3,5)),n.addNode("fb",FX.FeedbackDelay(!1,.1875,.45)),n.addNode("filter",FX.Filter(!1,"LOWPASS",4e3)),a.addNode("filter",FX.Filter(!1,"LOWPASS",6e3)),mx.addSend("hatRev",mx.channels.hat.prefaderOutput,a.input,.2),mx.addSend("snareRev",mx.channels.snare.prefaderOutput,a.input,.05),mx.addSend("bassRev",mx.channels.bass.prefaderOutput,a.input,.1)}(),t.mx=mx;var n=AgentManager(),a=e.currentClientBeatTime;t.update=function(){e.update();var r=e.currentClientBeatTime-a;a=e.currentClientBeatTime,fd.update(r),fd.count>38&&(fd.count=0),fd.count%6==0?t.ctrl("kick","wildKick"):fd.count%13==0&&t.ctrl("kick","rest"),fd.count%6==0?t.ctrl("snare","discoSnare"):fd.count%14!=0&&31!=fd.count||t.ctrl("snare","rest"),fd.count%8==0?t.ctrl("hat","discoHats"):fd.count%18==0?t.ctrl("hat","quarterHats"):fd.count%10==0&&t.ctrl("hat","rest"),fd.count%8==0&&t.ctrl("filter",""+rndi(1,5)),n.update()},t.pat={},t.pat.fourOnFloor={channel:mx.channels.kick,action:MBKick,freq:Env.XLine(240,60,.02),amp:1.2},t.pat.rest={dur:1,rest:!0},t.pat.discoHats={action:Instr.WNHat,sustain:.32,fltrStart:Z.patterns.Pwhite(8e3,6e3),fltrLen:.15,dur:.5,rest:Z.patterns.Place([!0,!1]),channel:mx.channels.hat,quant:Quant(4)},t.pat.discoSnare={action:Instr.LFOscillator,buffer:Z.generated.buffers.lfnoise,env:Env.Perc(.01,.04),channel:mx.channels.snare,freq:Env.XLine(4e3,1e3,.055),amp:.8,dur:2,rate:1.7,quant:Quant(4,1)},t.pat.quarterHats={action:Instr.WNHat,sustain:Z.patterns.Place([.2,.15,.3,.15]).mul(.85),pan:Z.patterns.Place([Z.patterns.Pwhite(-.5,.5),Z.patterns.Pwhite(-.5,.5),0,Z.patterns.Pwhite(-.5,.5)]),fltrStart:Z.patterns.Pwhite(9e3,12e3),fltrLen:.05,dur:.25,amp:1,channel:mx.channels.hat},t.pat.quarterHatsDisco={action:Instr.WNHat,sustain:Z.patterns.Place([.3,.05,.9,.05]),pan:Z.patterns.Place([Z.patterns.Pwhite(-.5,.5),Z.patterns.Pwhite(-.5,.5),0,Z.patterns.Pwhite(-.5,.5)]),fltrStart:Z.patterns.Pwhite(9e3,12e3),fltrLen:.05,dur:.25,channel:mx.channels.hat},t.pat.wildKick={dur:Z.patterns.Place([.75,.25,1,1,1,1,1,1,.5,.25,.25,1,1,1,1,1,1,.25,.25,.5,1,1,1,1,1,1,1,1,.5,.25,.25]),amp:Z.patterns.Place([1,.25,1,1,1,1,1,1,1,1,.7,1,1,.75,.25,1,1,1,.25,.25,.5,1,1,1,1,1,1,1,1,.5,.25,.25]),channel:mx.channels.kick,action:MBKick,freq:Env.XLine(240,60,.02),amp:1.2};var r=t.pat.fourOnFloor;return r=t.pat.rest,n.addAgent("bass",AgentProxy(FuncAgent(fd.visit,4,e))),n.addAgent("kick",AgentProxy(PatternAgent(r))),n.addAgent("hat",AgentProxy(NOPAgent())),n.addAgent("snare",AgentProxy(NOPAgent())),t.ctrl=function(e,a){"filter"!=e?n.agents[e].replace(PatternAgent(t.pat[a])):level=parseInt(a)},t.ctrl("kick","fourOnFloor"),t},AcidProtoState=function(t,e,n){var a={},r=0,i=0;a.state=[],a.main=t,a.lastHit=1/0,a.loop=a.count=0;for(var o=0;o<e;o++)i=rndi(0,3),rnd(0,10)>5&&(i=r),r=i,a.state[o]={value:i,alive:!0,lastPlayed:0,lastPlayedOrJumped:1/0,lastPlayedJump:0,lastAlive:1/0,moved:!1};a.update=function(t){};var c=0,u=0;return a.visit=function(r){var i=a.state[c];r.dur=.25;var o=1;if(i.alive)for(;o<5;){var s=a.state[(c+o)%e];if(!s.alive||s.value!=i.value)break;s.moved=!1,o+=1}r.dur=r.dur*o,mixinTable(r,{action:Instr.OSCStackFilter,channel:t.mx.channels.bass,scale:"minorPentatonic",degree:i.value,attack:5e-5,decay:.3*o,types:["TRIANGLE"],detunes:[0],amps:[1],amp:.1,filter:Env.XLine(500*Math.abs(Math.sin(t.clock.currentTime/5))+200,200,(.2*Math.abs(Math.sin(t.clock.currentTime/4))+.05)*o),filterQ:4}),i.moved&&(r.degree=Env.XLine(u,r.degree,.05*o)),u=i.value,i.lastPlayed=r.clock.absoluteAudioClientBeatTime(r.start),i.lastPlayedJump=o,i.moved=!1;for(var l=c;l<c+o;l++)a.state[l%e].lastPlayedOrJumped=r.clock.absoluteAudioClientBeatTime(r.start);if((c+=o)>=e){if(c%=e,a.loop++,a.count++,a.loop%4==0){var d=rndi(0,n/2),f=0;a.count>6&&a.count<16&&(f=n/2);for(l=0;l<e;l++)a.state[l].value=rndi(f,n-n/a.loop),rnd(0,10)>6&&(a.state[l].value=d),d=a.state[l].value}a.loop>=n&&(a.loop=0)}return r},a},window.onload=function(){function t(t){var{w:e,h:n,ctx:a}=ctex(t,512,256);cbox(a,0,0,e,n,"#003010");t=22;for(var r=222,i=0;i<t;i++)for(var o=0;o<t;o++)r=rnd(122,255),ccircle(a,rnd(50,e-32),rnd(20,n/2-32),rnd(5,35),rgba(r,111,111,.032))}function e(t){var{w:e,h:n,ctx:a}=ctex(t,256,512),r="ハッ그녀녕っ量그日",i=128,o="#ffb3e1",n=rnd(0,9)>6?2:1,c=ncol();cblur(a,30,c),rnd(0,10)>3?(cbox(a,32,32,192,448/n,c,8),cbox(a,32,32,192,448/n,"#fbfbfb",1)):rnd(0,10)>5&&(cbox(a,0,0,e,n/8+8,c),cbox(a,0,504,e,n/2+8,c)),cblur(a,40,"#ffb3e1"),ctext(a,i,128,rnda(r),88,o),ctext(a,i,224,rnda(r),88,o),1==n&&(ctext(a,i,340,rnda(r),88,o),ctext(a,i,440,rnda(r),88,o))}t("TSK"),t("TCD"),(()=>{var{w:t,h:e,ctx:n}=ctex("TCL",128,64),a=rgba(255,52,51,1);cblur(n,t/8,a),cellipse(n,t/2,e/2,44,6,a),cellipse(n,t/2,e/2,42,4,"#F1F1F1")})();for(var n=0;n<9;n++)e("TN"+n);(()=>{var{w:t,h:e,ctx:n}=ctex("TCT",256,256),a=t/8,r=rnd(2,8);cbox(n,0,0,t,e,"rgb("+r+","+r+","+r+")"),cblur(n,2*a,rgba(5,5,5,1));for(var i=0;i<8;i++)for(var o=0;o<8;o++)cbox(n,i*a+1,o*a+1,a+2,a+2,"rgb("+(r=rnd(35,75))+","+r+","+r+", 0.20)")})(),(()=>{var{w:t,h:e,ctx:n}=ctex("TBD",512,1024),a=rnd(72,98),r=24,i=t/r,o=e/r,c=0,u=0,s=0,l=.2,d=!1;cbox(n,0,0,t,e,rgba(a,a,a,1)),cblur(n,6,rgba(5,5,5,1));for(var f=0;f<i;f++){d=rnd(0,10)>3;for(var p=0;p<o;p++){if(a=s=u=rnd(15,44),c=rnd(5,45),g=rnd(5,23),cellipse(n,rnd(0,t),rnd(0,e),rnd(4,10),8*c,rgba(95,15,15,.01)),cellipse(n,rnd(0,t),rnd(0,e),c,rnd(1,10),rgba(15,15,15,.1)),l=rnd(.13,.29),ccircle(n,rnd(0,t),rnd(0,e),rnd(1,4),rgba(2,2,2,l)),1==d){rnd(0,10)>8&&(s=a*rnd(25,95),u=6*a),cbox(n,4+f*r,4+p*r,20,12,rgba(u,s,s,.9)),l=rnd(0,4);for(var m=0;m<l;m++)cbox(n,4+f*r+rnd(2,r),4+p*r,2,12,rgba(a,a,a,.3))}a=rnd(138,233),cbox(n,4+f*r,r+(p+1)*r-12,r-rnd(14,32),18,"rgba("+a+","+a+","+a+"0.4)")}}})()};var cars=[];function Car(t,e,n){var a=make("dodecahedron",{position:`${t} ${e} ${n}`,width:"64",depth:"128",height:"12",radius:"64",material:"src: #TCT; normalMap: #TCT; color: #131313;"});a.make("plane",{position:"0 0 60",width:"128",height:"32",material:"src: #TCL; side: double; blending: additive; opacity: 0.95; emissive: "+ncol()+"; fog: false;"}),a.make("plane",{position:"0 0 -60",width:"128",height:"32",material:"src: #TCL; side: double; blending: additive; opacity: 0.95; emissive: "+ncol()+"; fog: false;"}),a.v=-rnd(550,1850),cars.push(a)}var POI=[],PIX=0,GPP=0,GCC=null;function goal(t,e,n){GCC||(GCC=make("torus",{position:`${t} ${e} ${n}`,radius:"32",height:"32",material:"color: #bffbbf; emissive: #25bf28;"})),GCC.object3D.position.x=t,GCC.object3D.position.y=e,GCC.object3D.position.z=n}function Building(t,e){var n=500+rnd(150,500),a=2500+rnd(1,2500),r=870+rnd(0,130),i=a/2-250,o=(rnd(20,250),make("box",{position:`${t} ${i} ${e}`,width:`${n}`,depth:`${r}`,height:`${a}`,material:"src: #TBD; normalMap: #TBD; roughness: 0.33; metalness: 0.5",class:"solid"}));if(t=0,i=a/2+5,e=0,a=10,o.make("box",{position:`${t} ${i} ${e}`,width:`${n}`,depth:`${r}`,height:`${a}`,material:"src: #TCT; normalMap: #TBD; roughness: 0.33; metalness: 0.5; repeat: 8 8",class:"solid"}),a<4e3&&rnd(0,10)>5){var c=rnd(0,3)>1?256:.01,u=c,s=256==c?.01:256,l=n/2+c/2+2;i/=2,o.make("box",{position:`${t+l} ${i} ${e}`,width:`${u}`,depth:`${s}`,height:"512",material:"src: #TN"+rndi(0,9)+"; blending: additive; opacity: 0.95; emissive: "+ncol()+"; fog: false;",animation:"property: components.material.material.opacity; delay: "+rnd(100,500)+"; from: 1.0; to: 0.15; dur: "+rnd(1500,2500)+"; loop: true; easing: easeInOutElastic"})}return o}function test(t){var e=t.getObject3D("mesh");e.geometry.boundingBox||e.geometry.computeBoundingBox();var n=e.geometry.boundingBox,a=t.getAttribute("position");return pp=taxi.object3D.position,pp.x>=a.x+n.min.x&&pp.x<=a.x+n.max.x&&pp.y>=a.y+n.min.y&&pp.y<=a.y+n.max.y&&pp.z>=a.z+n.min.z&&pp.z<=a.z+n.max.z}AFRAME.registerComponent("game",{init:function(){this.firstTime=!0,this.mCount=0,this.xCount=0,this.wCount=0,taxi.yaw=0,taxi.moveRot=new THREE.Euler(0,0,0),taxi.velocity=new THREE.Vector3(0,0,1),taxi.speed=1,taxi.acc=0;for(var t=0;t<7;t++)for(var e=0;e<7;e++)Building(1250*t-3e3+rnd(1,150),t+1100*e+rnd(1,150));for(t=0;t<7;t++)Car(1250*t-2350,rnd(1500,2e3),-750),rnd(0,9)>1&&Car(1250*t-2350,rnd(2500,3e3),-750),rnd(0,9)>3&&Car(1250*t-2350,rnd(3500,4e3),-750),rnd(0,9)>5&&Car(1250*t-2350,rnd(4500,5e3),-750);for(t=0;t<7;t++){var n={x:1250*t-2350,y:rnd(2200,3500),z:rnd(-500,3500)};POI.push(n)}goal((PIX=rnda(POI)).x,PIX.y,PIX.z),GSL=document.querySelectorAll(".solid")},update:function(t){},getWay:function(){GTV.x>10&&(GTV.x=10),GTV.x<-10&&(GTV.x=-10),GTV.y>10&&(GTV.y=10),GTV.y<-10&&(GTV.y=-10),GTV.z>10&&(GTV.z=10),GTV.z<-10&&(GTV.z=-10);var t={up:GTV.z/10,down:GTV.z/10*-1,left:GTV.y/10*-1,right:GTV.y/10,normal:GTV.x/10,upsideDown:GTV.x/10*-1},e={name:"normal",val:0};for(var n in t)t[n]>e.val&&(e={name:n,val:t[n]});return t.bigger=e.name,t},tick:function(t,e){if(!GPA){if(this.firstTime&&(this.firstTime=!1,document.getElementById("intro").outerHTML="",document.getElementById("title").style.display="block"),GEN){taxi.acc*=.915,GTV.x<10&&(GTV.x+=.2),(GKEYS.ARROWLEFT||GKEYS.A)&&(GTV.y-=.12,GTV.x/=1.2),(GKEYS.ARROWRIGHT||GKEYS.D)&&(GTV.y+=.12,GTV.x/=1.2),(GKEYS.ARROWUP||GKEYS.W)&&(GTV.z+=.12,GTV.x/=1.2),(GKEYS.ARROWDOWN||GKEYS.S)&&(GTV.z-=.12,GTV.x/=1.2),(GKEYS.F||GKEYS.X||GKEYS.CTRL||GKEYS[" "])&&(taxi.acc-=e/1e3*40),Math.abs(GTV.y)>0&&(GTV.y-=GTV.y/100),Math.abs(GTV.z)>0&&(GTV.z-=GTV.z/100),GKEYS.P&&console.log(taxi.object3D.position),taxi.speed=1-taxi.acc;for(var n,a=0;n=GSL[a];a++)if(test(n))return taxi.speed=-.01,gameover("Be careful with buildings!")}this.mCount+=e/1e3,this.xCount+=e/1e3,this.mCount>28&&(this.mCount=0,zzfx(.08,2,1112,33.8,.23,.1,2.6,0,.14));var r=this.getWay();taxi.object3D.rotation.x=.5*(cam.object3D.rotation.x=r.up*-Math.PI/2),taxi.object3D.rotation.y=taxi.yaw,taxi.object3D.rotation.z=.5*(cam.object3D.rotation.z=r.left*Math.PI/2);var i=Math.sin(-cam.object3D.rotation.z);0!=i&&(taxi.yaw+=i/-25),taxi.moveRot=new THREE.Euler(r.up*-Math.PI/2,taxi.yaw,0,"ZYX"),taxi.velocity=new THREE.Vector3(0,0,taxi.speed).applyEuler(taxi.moveRot),taxi.object3D.position.sub(taxi.velocity);var o=taxi.object3D.position;clouds.object3D.position.x=sky.object3D.position.x=o.x,clouds.object3D.position.y=sky.object3D.position.y=o.y,clouds.object3D.position.z=sky.object3D.position.z=o.z,clouds.object3D.rotation.y+=15e-5*e,compass.object3D.lookAt(PIX.x,PIX.y,PIX.z);for(a=0;a<cars.length;a++){cars[a].object3D.position.z-=e/1e3*cars[a].v,cars[a].object3D.position.distanceTo(taxi.object3D.position)<1750&&this.xCount>1.5&&(zzfx(3,.1,77,.8,.65,.1,.5,.1,.22),this.xCount=0),(cars[a].object3D.position.z>=15e3||cars[a].object3D.position.z<=-5500)&&(cars[a].v*=-1)}GCC.object3D.rotation.y+=.0015*e,GEN&&(o.x<-4500||o.x>5500||o.z<-2e3||o.z>9e3||o.y<2e3||o.y>5e3?(this.wCount+=e/1e3,fx("red",50),parseInt(10*this.wCount)%8==0&&zzfx(.15,.1,20,.5,.02,17.1,.5,15.9,.79),this.wCount>3.5&&(this.wCount=0,taxi.speed=-.01,gameover("The wasteland is lethal!"))):(this.wCount=0,fx("#020d04",550)),o.distanceTo(PIX)<=100&&(PIX=rnda(POI),GPP++,goal(PIX.x,PIX.y,PIX.z),zzfx(1.5,0,750,.25,0,.015,.1,0,.25)))}}});
</script>
</body>
</html>