diff --git a/051qbx29k1.js b/051qbx29k1.js index fe66f0c..9dcc8fb 100644 --- a/051qbx29k1.js +++ b/051qbx29k1.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/07d28tkvrw.js b/07d28tkvrw.js index fe66f0c..9dcc8fb 100644 --- a/07d28tkvrw.js +++ b/07d28tkvrw.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/080g209iov.js b/080g209iov.js index c506b35..14d7dba 100644 --- a/080g209iov.js +++ b/080g209iov.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -54,8 +54,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemiesSpawned = 0; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -63,7 +63,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); //this.getNextSpawnTime = function() { - /*return GameLib.Utils.GetRandomIntInclusive( + /*return R3.Utils.GetRandomIntInclusive( 1, 1 );*/ @@ -88,10 +88,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -130,15 +130,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -212,7 +212,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -224,8 +224,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === name) { @@ -236,8 +236,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription = null; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -247,8 +247,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { }.bind(this) ); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -301,8 +301,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { smokeParticleEngine.enabled = true; mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -324,15 +324,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -405,8 +405,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { // mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -488,7 +488,7 @@ if (this.mouseIsDown) { } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -530,7 +530,7 @@ if (this.mouseIsDown) { /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -586,7 +586,7 @@ if (this.spawnTime > this.spawnInterval) { if (this.kanister.explodeParticleEngine) { - if (GameLib.Utils.UndefinedOrNull(this.kanister.waiting)) { + if (R3.Utils.UndefinedOrNull(this.kanister.waiting)) { this.kanister.waiting = true; } else { this.kanister.explodeParticleEngine.remove(); @@ -609,7 +609,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { diff --git a/0cw20zm4g7.js b/0cw20zm4g7.js index 57aa965..73b971f 100644 --- a/0cw20zm4g7.js +++ b/0cw20zm4g7.js @@ -6,8 +6,8 @@ if (!this.initialized) { this.initialized = true; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_DOWN, +R3.Event.Emit( + R3.Event.MOUSE_DOWN, { event : { offsetX : data.event.changedTouches[0].clientX, diff --git a/0j2wxrtdf2.js b/0j2wxrtdf2.js index a3ad31a..5880fe3 100644 --- a/0j2wxrtdf2.js +++ b/0j2wxrtdf2.js @@ -6,7 +6,7 @@ if (!this.initialized) { this.initialized = true; } -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); /* var touch = data; @@ -15,37 +15,37 @@ var max = Math.max(touch.left, touch.right, touch.up, touch.down); if (typeof max === 'number') { if (max === touch.left) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_LEFT + keyCode : R3.System.Input.KEY_LEFT } ); } if (max === touch.right) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_RIGHT + keyCode : R3.System.Input.KEY_RIGHT } ); } if (max === touch.up) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_UP + keyCode : R3.System.Input.KEY_UP } ); } if (max === touch.down) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_DOWN + keyCode : R3.System.Input.KEY_DOWN } ); } diff --git a/0krv8dcow2.js b/0krv8dcow2.js index 39d74cd..7dba523 100644 --- a/0krv8dcow2.js +++ b/0krv8dcow2.js @@ -2,12 +2,12 @@ if (!this.entityLoaded) { return; } -var camera = GameLib.EntityManager.Instance.findComponentById('zc2pq229fq'); +var camera = R3.EntityManager.Instance.findComponentById('zc2pq229fq'); camera.lookAt.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025;//(window.clientWidth/ 2) + data.event.x; camera.lookAt.y = (((window.innerHeight / 2 - data.event.y)) * 0.05); camera.updateInstance(); -var cursorCamera = GameLib.EntityManager.Instance.findComponentById('6tr9gzu4oh'); +var cursorCamera = R3.EntityManager.Instance.findComponentById('6tr9gzu4oh'); var mousePosition = new THREE.Vector3( (-1 * (window.innerWidth / 2 - data.event.x)) , @@ -17,14 +17,14 @@ var mousePosition = new THREE.Vector3( mousePosition.unproject(cursorCamera.instance); -var cursor = GameLib.EntityManager.Instance.findComponentById('jl8hpa2pel'); +var cursor = R3.EntityManager.Instance.findComponentById('jl8hpa2pel'); cursor.position.x = mousePosition.x; cursor.position.y = mousePosition.y; //cursor.position.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025; //cursor.position.y = (((window.innerHeight / 2 - data.event.y)) * 0.05); cursor.updateInstance(); -var thrower = GameLib.EntityManager.Instance.findComponentById('y548ddx1ff'); +var thrower = R3.EntityManager.Instance.findComponentById('y548ddx1ff'); thrower.instance.lookAt( new THREE.Vector3( @@ -41,8 +41,8 @@ thrower.instance.lookAt( /** * First we find our crosshair */ -//var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); -var sphere = GameLib.EntityManager.Instance.findComponentById('uhfavijs0s'); +//var crosshair = R3.EntityManager.Instance.findComponentById('oxpg88pgzv'); +var sphere = R3.EntityManager.Instance.findComponentById('uhfavijs0s'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -81,7 +81,7 @@ raycaster.ray = new THREE.Ray( ); var intersects = raycaster.intersectObjects( - GameLib.EntityManager.Instance.queryComponents(GameLib.D3.Mesh).map( + R3.EntityManager.Instance.queryComponents(R3.D3.Mesh).map( function(mesh){ //mesh.instance.visible = true; mesh.instance.material.color.setHex(0xffffff); diff --git a/0qv1aw7ni1.js b/0qv1aw7ni1.js index 05c9bc3..cd8d515 100644 --- a/0qv1aw7ni1.js +++ b/0qv1aw7ni1.js @@ -1,11 +1,11 @@ if (this.parentEntity === data.entity) { console.log('Entity SpoonLib Loaded'); - this.mouseMove = GameLib.EntityManager.Instance.findComponentById('a4hb4ubk5z'); - this.keyUp = GameLib.EntityManager.Instance.findComponentById('hdy358a43e'); - this.camera = GameLib.EntityManager.Instance.findComponentById('a9spj3fs9b'); - this.textCanvas = GameLib.EntityManager.Instance.findComponentById('dlzgvcve2j'); - this.textTexture = GameLib.EntityManager.Instance.findComponentById('3il5afmzsj'); + this.mouseMove = R3.EntityManager.Instance.findComponentById('a4hb4ubk5z'); + this.keyUp = R3.EntityManager.Instance.findComponentById('hdy358a43e'); + this.camera = R3.EntityManager.Instance.findComponentById('a9spj3fs9b'); + this.textCanvas = R3.EntityManager.Instance.findComponentById('dlzgvcve2j'); + this.textTexture = R3.EntityManager.Instance.findComponentById('3il5afmzsj'); this.mouseMove.entityLoaded = this; this.keyUp.entityLoaded = this; diff --git a/0r2manr3lz.js b/0r2manr3lz.js index 57fec39..a9bcfa3 100644 --- a/0r2manr3lz.js +++ b/0r2manr3lz.js @@ -9,64 +9,64 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('ns9hkrr6hz') -this.bull = GameLib.EntityManager.Instance.findComponentById('d06pyg9sg6'); -this.star = GameLib.EntityManager.Instance.findComponentById('vyin26txm9'); -this.burger = GameLib.EntityManager.Instance.findComponentById('s4z8bbuzj1'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('gd0zf7voy9'); -this.santa = GameLib.EntityManager.Instance.findComponentById('d78qs8peri'); -this.camera = GameLib.EntityManager.Instance.findComponentById('khp55pw9iw'); -this.scene = GameLib.EntityManager.Instance.findComponentById('95o4zb6e5j'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('ucwth3264f'); -this.dom = GameLib.EntityManager.Instance.findComponentById('8qy3jhzzi3'); +this.fog = R3.EntityManager.Instance.findComponentById('ns9hkrr6hz') +this.bull = R3.EntityManager.Instance.findComponentById('d06pyg9sg6'); +this.star = R3.EntityManager.Instance.findComponentById('vyin26txm9'); +this.burger = R3.EntityManager.Instance.findComponentById('s4z8bbuzj1'); +this.parcel = R3.EntityManager.Instance.findComponentById('gd0zf7voy9'); +this.santa = R3.EntityManager.Instance.findComponentById('d78qs8peri'); +this.camera = R3.EntityManager.Instance.findComponentById('khp55pw9iw'); +this.scene = R3.EntityManager.Instance.findComponentById('95o4zb6e5j'); +this.cursor = R3.EntityManager.Instance.findComponentById('ucwth3264f'); +this.dom = R3.EntityManager.Instance.findComponentById('8qy3jhzzi3'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('aflvoop0v8'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('mkp84iqx6o'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('zgt96v9ugq'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('ywmpxuerek'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('kuggdh3zx6'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('0az4kqjpg9'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('f4hn9ez7du'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('km72k5786e'); +this.renderer = R3.EntityManager.Instance.findComponentById('aflvoop0v8'); +this.thrower = R3.EntityManager.Instance.findComponentById('mkp84iqx6o'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('zgt96v9ugq'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('ywmpxuerek'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('kuggdh3zx6'); +this.stone1 = R3.EntityManager.Instance.findComponentById('0az4kqjpg9'); +this.stone2 = R3.EntityManager.Instance.findComponentById('f4hn9ez7du'); +this.kanister = R3.EntityManager.Instance.findComponentById('km72k5786e'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('otdhpenx8y'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('2vbzqnvjg1'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('n3o73ffnlv'); +this.leftLight = R3.EntityManager.Instance.findComponentById('otdhpenx8y'); +this.rightLight = R3.EntityManager.Instance.findComponentById('2vbzqnvjg1'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('n3o73ffnlv'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('6w6khff77g'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('qce3j244zw'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('8k5qei9hp3'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('1x9pw7cdhf'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('52bnm6moi7'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('6w6khff77g'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('qce3j244zw'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('8k5qei9hp3'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('1x9pw7cdhf'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('52bnm6moi7'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('l8j2bh0kpx'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('l8j2bh0kpx'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('f8hfy0lj97'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('um7f1tzijv'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('p6aqxjt7ku'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('qlmxy31b2f'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('3u4ivhvl08'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('f8hfy0lj97'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('um7f1tzijv'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('p6aqxjt7ku'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('qlmxy31b2f'); +this.touchMove = R3.EntityManager.Instance.findComponentById('3u4ivhvl08'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -81,8 +81,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.GAME_START, +R3.Event.Subscribe( + R3.Event.GAME_START, function() { this.beforeRender.entityLoaded = this; @@ -91,7 +91,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -101,8 +101,8 @@ GameLib.Event.Subscribe( this.mouse.x = 0; this.mouse.y = 0; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } @@ -110,18 +110,18 @@ GameLib.Event.Subscribe( }.bind(this) ); -GameLib.Event.Subscribe( - GameLib.Event.GAME_RESTART, +R3.Event.Subscribe( + R3.Event.GAME_RESTART, function() { console.log('restarting game'); - GameLib.Event.Emit(GameLib.Event.GAME_OVER); + R3.Event.Emit(R3.Event.GAME_OVER); delete this.beforeRender.initialized; - GameLib.Event.Emit(GameLib.Event.GAME_START); + R3.Event.Emit(R3.Event.GAME_START); }.bind(this) ); -GameLib.Event.Subscribe( - GameLib.Event.GAME_OVER, +R3.Event.Subscribe( + R3.Event.GAME_OVER, function() { this.beforeRender.entityLoaded = null; @@ -130,11 +130,11 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = null; this.touchMove.entityLoaded = null; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); }.bind(this) ); -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +//R3.Event.Emit(R3.Event.MOUSE_UP); /** @@ -934,6 +934,6 @@ mesh.scale.y = 5; mesh.scale.z = 5; mesh.updateInstance(); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/0zv4hsgkky.js b/0zv4hsgkky.js index fde585c..8c1444e 100644 --- a/0zv4hsgkky.js +++ b/0zv4hsgkky.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/182s9odi92.js b/182s9odi92.js index 8a69f51..0295193 100644 --- a/182s9odi92.js +++ b/182s9odi92.js @@ -9,50 +9,50 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('yauacnrf0v'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('yauacnrf0v'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('0ygb0vqp3z'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('0ygb0vqp3z'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('yeun1lve8x'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('yeun1lve8x'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('no3ph5ss6n'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('no3ph5ss6n'); this.mouseMove.entityLoaded = this; /** * Create references to all our 'in game' objects */ -this.bull = GameLib.EntityManager.Instance.findComponentById('pd0l34qtto'); -this.star = GameLib.EntityManager.Instance.findComponentById('vzw9guma86'); -this.burger = GameLib.EntityManager.Instance.findComponentById('nbok9y7a3j'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('ie9f9mjxj6'); +this.bull = R3.EntityManager.Instance.findComponentById('pd0l34qtto'); +this.star = R3.EntityManager.Instance.findComponentById('vzw9guma86'); +this.burger = R3.EntityManager.Instance.findComponentById('nbok9y7a3j'); +this.parcel = R3.EntityManager.Instance.findComponentById('ie9f9mjxj6'); -this.camera = GameLib.EntityManager.Instance.findComponentById('a3g7vuh91k'); -this.scene = GameLib.EntityManager.Instance.findComponentById('ya8btipi67'); +this.camera = R3.EntityManager.Instance.findComponentById('a3g7vuh91k'); +this.scene = R3.EntityManager.Instance.findComponentById('ya8btipi67'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('03zckwzjqd'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('3h0rspolkq'); +this.cursor = R3.EntityManager.Instance.findComponentById('03zckwzjqd'); +this.thrower = R3.EntityManager.Instance.findComponentById('3h0rspolkq'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('e86omxvjap'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('e86omxvjap'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Link some objects for MouseMove component @@ -78,12 +78,12 @@ this.mouseUp.throwerParticleEngine = this.throwerParticleEngine; /** * Plant all our trees */ -var treeSmall = GameLib.EntityManager.Instance.findComponentById('gawrpb43kz'); -var treeMedium = GameLib.EntityManager.Instance.findComponentById('nq79q4ceuf'); -var treeLarge = GameLib.EntityManager.Instance.findComponentById('8tk65umy37'); -var stone1 = GameLib.EntityManager.Instance.findComponentById('9abpoa2mwr'); -var stone2 = GameLib.EntityManager.Instance.findComponentById('n7oo5ej1vc'); -var materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('sk6mimj0r5'); +var treeSmall = R3.EntityManager.Instance.findComponentById('gawrpb43kz'); +var treeMedium = R3.EntityManager.Instance.findComponentById('nq79q4ceuf'); +var treeLarge = R3.EntityManager.Instance.findComponentById('8tk65umy37'); +var stone1 = R3.EntityManager.Instance.findComponentById('9abpoa2mwr'); +var stone2 = R3.EntityManager.Instance.findComponentById('n7oo5ej1vc'); +var materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('sk6mimj0r5'); var mesh = null; var material = null; diff --git a/1cs8fm87ty.js b/1cs8fm87ty.js index 6c559ef..6c75b33 100644 --- a/1cs8fm87ty.js +++ b/1cs8fm87ty.js @@ -1,6 +1,6 @@ //console.log(data); -this.camera = GameLib.EntityManager.Instance.findComponentById('yv62w8sx9r'); +this.camera = R3.EntityManager.Instance.findComponentById('yv62w8sx9r'); var vector = new THREE.Vector3(); diff --git a/1dapoo0bwa.js b/1dapoo0bwa.js index 6fdd920..cdf564c 100644 --- a/1dapoo0bwa.js +++ b/1dapoo0bwa.js @@ -6,28 +6,28 @@ if (this.parentEntity === data.entity) { this.enemies = []; -var particle = GameLib.EntityManager.Instance.findComponentById('ks1yk4yi1n'); +var particle = R3.EntityManager.Instance.findComponentById('ks1yk4yi1n'); particle.instance.visible = false; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('oh07330eg6'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('oh07330eg6'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('jujvqjffqw'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('jujvqjffqw'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('56if6ltmvm'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('56if6ltmvm'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('0krv8dcow2'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('0krv8dcow2'); this.mouseMove.entityLoaded = this; /** diff --git a/1jcd3sg3gh.js b/1jcd3sg3gh.js index 0285382..a2e1281 100644 --- a/1jcd3sg3gh.js +++ b/1jcd3sg3gh.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -var texture = GameLib.EntityManager.Instance.findComponentById('etff15p48k'); +var texture = R3.EntityManager.Instance.findComponentById('etff15p48k'); if (!this.initialized) { texture.offset.x = 0; diff --git a/1n3iofhi8x.js b/1n3iofhi8x.js index 3a65f64..ca2b121 100644 --- a/1n3iofhi8x.js +++ b/1n3iofhi8x.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -var particleEngine = GameLib.EntityManager.Instance.findComponentById('o5xi6s5myj'); +var particleEngine = R3.EntityManager.Instance.findComponentById('o5xi6s5myj'); particleEngine.enabled = false; diff --git a/1xsmsgfx35.js b/1xsmsgfx35.js index 8849658..7f615db 100644 --- a/1xsmsgfx35.js +++ b/1xsmsgfx35.js @@ -2,8 +2,8 @@ data.event.preventDefault(); var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, @@ -13,6 +13,6 @@ GameLib.Event.Emit( } ) -GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +R3.Event.Emit(R3.Event.MOUSE_DOWN); //@ sourceURL=touchStart.js \ No newline at end of file diff --git a/21g30t1e75.js b/21g30t1e75.js index 3c671f8..55f219c 100644 --- a/21g30t1e75.js +++ b/21g30t1e75.js @@ -7,105 +7,105 @@ if (this.parentEntity === data.entity) { /** * Defines */ -GameLib.CustomCode.BODY_TYPE_NORMAL = 0x1; -GameLib.CustomCode.BODY_TYPE_TAIL = 0x2; -GameLib.CustomCode.BODY_TYPE_CORNER = 0x3; +R3.CustomCode.BODY_TYPE_NORMAL = 0x1; +R3.CustomCode.BODY_TYPE_TAIL = 0x2; +R3.CustomCode.BODY_TYPE_CORNER = 0x3; -GameLib.CustomCode.GRID_WIDTH = 11; -GameLib.CustomCode.GRID_HEIGHT = 10; +R3.CustomCode.GRID_WIDTH = 11; +R3.CustomCode.GRID_HEIGHT = 10; -GameLib.CustomCode.GRID_OFFSET_X = 1; -GameLib.CustomCode.GRID_OFFSET_Y = 8; +R3.CustomCode.GRID_OFFSET_X = 1; +R3.CustomCode.GRID_OFFSET_Y = 8; -GameLib.CustomCode.SPEED_INITIAL = 1; +R3.CustomCode.SPEED_INITIAL = 1; -GameLib.CustomCode.ORIENTATION_UP = 0; -GameLib.CustomCode.ORIENTATION_LEFT = 1; -GameLib.CustomCode.ORIENTATION_DOWN = 2; -GameLib.CustomCode.ORIENTATION_RIGHT = 3; +R3.CustomCode.ORIENTATION_UP = 0; +R3.CustomCode.ORIENTATION_LEFT = 1; +R3.CustomCode.ORIENTATION_DOWN = 2; +R3.CustomCode.ORIENTATION_RIGHT = 3; -GameLib.CustomCode.FOOD_SPEED_INITIAL = 3; -GameLib.CustomCode.MAX_FOOD_ITEMS = 6; +R3.CustomCode.FOOD_SPEED_INITIAL = 3; +R3.CustomCode.MAX_FOOD_ITEMS = 6; -GameLib.CustomCode.POWERUP_WAIT_TIME_MIN = 5; -GameLib.CustomCode.POWERUP_WAIT_TIME_MAX = 10; -GameLib.CustomCode.POWERUP_DURATION = 7; -GameLib.CustomCode.POWERUP_SPEED = 0; -GameLib.CustomCode.POWERUP_LIFE = 1; -GameLib.CustomCode.POWERUP_SLOW = 2; -GameLib.CustomCode.MAX_POWERUP_ITEMS = 3; +R3.CustomCode.POWERUP_WAIT_TIME_MIN = 5; +R3.CustomCode.POWERUP_WAIT_TIME_MAX = 10; +R3.CustomCode.POWERUP_DURATION = 7; +R3.CustomCode.POWERUP_SPEED = 0; +R3.CustomCode.POWERUP_LIFE = 1; +R3.CustomCode.POWERUP_SLOW = 2; +R3.CustomCode.MAX_POWERUP_ITEMS = 3; -GameLib.CustomCode.SPEED_GRAIN = 0.8 / 20; -GameLib.CustomCode.POWERUP_SPEED_GRAIN = 0.8 / 5; -GameLib.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN = 8 / 5; +R3.CustomCode.SPEED_GRAIN = 0.8 / 20; +R3.CustomCode.POWERUP_SPEED_GRAIN = 0.8 / 5; +R3.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN = 8 / 5; -GameLib.CustomCode.MAX_SPEED = 0.2; -GameLib.CustomCode.MIN_SPEED = GameLib.CustomCode.SPEED_INITIAL; +R3.CustomCode.MAX_SPEED = 0.2; +R3.CustomCode.MIN_SPEED = R3.CustomCode.SPEED_INITIAL; -GameLib.CustomCode.ANIMATION_SPEED_GRAIN = 8 / 20; -GameLib.CustomCode.MIN_ANIMATION_SPEED = 2; -GameLib.CustomCode.MAX_ANIMATION_SPEED = 10; +R3.CustomCode.ANIMATION_SPEED_GRAIN = 8 / 20; +R3.CustomCode.MIN_ANIMATION_SPEED = 2; +R3.CustomCode.MAX_ANIMATION_SPEED = 10; -GameLib.CustomCode.SPEED_INCREASE_INTERVAL = 5; +R3.CustomCode.SPEED_INCREASE_INTERVAL = 5; -GameLib.CustomCode.FOOD_BACON = 0; -GameLib.CustomCode.FOOD_CHEESE = 1; -GameLib.CustomCode.FOOD_ONION = 2; -GameLib.CustomCode.FOOD_ONION_RING = 3; -GameLib.CustomCode.FOOD_PATTY = 4; -GameLib.CustomCode.FOOD_TOMATO = 5; +R3.CustomCode.FOOD_BACON = 0; +R3.CustomCode.FOOD_CHEESE = 1; +R3.CustomCode.FOOD_ONION = 2; +R3.CustomCode.FOOD_ONION_RING = 3; +R3.CustomCode.FOOD_PATTY = 4; +R3.CustomCode.FOOD_TOMATO = 5; -GameLib.CustomCode.BODY_TYPE_BREAD_BACON = 0; -GameLib.CustomCode.BODY_TYPE_BREAD_CHEESE = 1; -GameLib.CustomCode.BODY_TYPE_BREAD_ONION = 2; -GameLib.CustomCode.BODY_TYPE_BREAD_ONION_RING = 3; -GameLib.CustomCode.BODY_TYPE_BREAD_PATTY = 4; -GameLib.CustomCode.BODY_TYPE_BREAD_TOMATO = 5; -GameLib.CustomCode.BODY_TYPE_BREAD_HEAD = 6; -GameLib.CustomCode.BODY_TYPE_BREAD_TAIL = 7; -GameLib.CustomCode.BODY_TYPE_BREAD_CORNER = 8; +R3.CustomCode.BODY_TYPE_BREAD_BACON = 0; +R3.CustomCode.BODY_TYPE_BREAD_CHEESE = 1; +R3.CustomCode.BODY_TYPE_BREAD_ONION = 2; +R3.CustomCode.BODY_TYPE_BREAD_ONION_RING = 3; +R3.CustomCode.BODY_TYPE_BREAD_PATTY = 4; +R3.CustomCode.BODY_TYPE_BREAD_TOMATO = 5; +R3.CustomCode.BODY_TYPE_BREAD_HEAD = 6; +R3.CustomCode.BODY_TYPE_BREAD_TAIL = 7; +R3.CustomCode.BODY_TYPE_BREAD_CORNER = 8; -GameLib.CustomCode.OBJECT_TYPE_NONE = 0; -GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY = 1; -GameLib.CustomCode.OBJECT_TYPE_FOOD = 2; -GameLib.CustomCode.OBJECT_TYPE_POWERUP = 3; +R3.CustomCode.OBJECT_TYPE_NONE = 0; +R3.CustomCode.OBJECT_TYPE_SNAKE_BODY = 1; +R3.CustomCode.OBJECT_TYPE_FOOD = 2; +R3.CustomCode.OBJECT_TYPE_POWERUP = 3; -this.extendSpeedGrain = (GameLib.CustomCode.SPEED_INITIAL - GameLib.CustomCode.MAX_SPEED) / (GameLib.CustomCode.GRID_WIDTH * GameLib.CustomCode.GRID_HEIGHT); +this.extendSpeedGrain = (R3.CustomCode.SPEED_INITIAL - R3.CustomCode.MAX_SPEED) / (R3.CustomCode.GRID_WIDTH * R3.CustomCode.GRID_HEIGHT); /** * Get runtime */ -this.runtime = GameLib.Utils.GetRuntime(); +this.runtime = R3.Utils.GetRuntime(); /** * Custom Code Components */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('zjq6ach3jt'); -this.keyUp = GameLib.EntityManager.Instance.findComponentById('306204wy29'); -this.touchStart = GameLib.EntityManager.Instance.findComponentById('0cw20zm4g7'); -this.touchEnd = GameLib.EntityManager.Instance.findComponentById('0j2wxrtdf2'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('gzewp2awcf'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('ckplg6wqnl'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('zjq6ach3jt'); +this.keyUp = R3.EntityManager.Instance.findComponentById('306204wy29'); +this.touchStart = R3.EntityManager.Instance.findComponentById('0cw20zm4g7'); +this.touchEnd = R3.EntityManager.Instance.findComponentById('0j2wxrtdf2'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('gzewp2awcf'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('ckplg6wqnl'); /** * Geometries */ -this.geometryBody = GameLib.EntityManager.Instance.findComponentById('8f5q7k5ozp'); +this.geometryBody = R3.EntityManager.Instance.findComponentById('8f5q7k5ozp'); -GameLib.CustomCode.BODY_SCALE_X = this.geometryBody.width; -GameLib.CustomCode.BODY_SCALE_Y = this.geometryBody.height; +R3.CustomCode.BODY_SCALE_X = this.geometryBody.width; +R3.CustomCode.BODY_SCALE_Y = this.geometryBody.height; /** * Meshes */ -this.meshPauseButton = GameLib.EntityManager.Instance.findComponentById('f5xmype7dq'); -this.meshSoundButton = GameLib.EntityManager.Instance.findComponentById('0eo0kat3fb'); -this.meshDownButton = GameLib.EntityManager.Instance.findComponentById('2eva6brga6'); -this.meshUpButton = GameLib.EntityManager.Instance.findComponentById('q3ra6x84d8'); -this.meshRightButton = GameLib.EntityManager.Instance.findComponentById('z0gwmplslj'); -this.meshLeftButton = GameLib.EntityManager.Instance.findComponentById('e69gb1028e'); -this.meshPauseOverlay = GameLib.EntityManager.Instance.findComponentById('gjhshqb1ks'); +this.meshPauseButton = R3.EntityManager.Instance.findComponentById('f5xmype7dq'); +this.meshSoundButton = R3.EntityManager.Instance.findComponentById('0eo0kat3fb'); +this.meshDownButton = R3.EntityManager.Instance.findComponentById('2eva6brga6'); +this.meshUpButton = R3.EntityManager.Instance.findComponentById('q3ra6x84d8'); +this.meshRightButton = R3.EntityManager.Instance.findComponentById('z0gwmplslj'); +this.meshLeftButton = R3.EntityManager.Instance.findComponentById('e69gb1028e'); +this.meshPauseOverlay = R3.EntityManager.Instance.findComponentById('gjhshqb1ks'); this.buttons = [ this.meshPauseButton, @@ -119,42 +119,42 @@ this.buttons = [ /** * Materials */ -this.materialTomato = GameLib.EntityManager.Instance.findComponentById('merwtvkm1t'); -this.materialBacon = GameLib.EntityManager.Instance.findComponentById('x5ffcl6ojc'); -this.materialCheese = GameLib.EntityManager.Instance.findComponentById('0rxqy5eddx'); -this.materialOnionRing = GameLib.EntityManager.Instance.findComponentById('gz8zex5xug'); -this.materialPatty = GameLib.EntityManager.Instance.findComponentById('f7y8nurbcv'); -this.materialOnion = GameLib.EntityManager.Instance.findComponentById('im3tsuzwrp'); -this.materialBreadBacon = GameLib.EntityManager.Instance.findComponentById('wn31yqi6lc'); -this.materialBreadCheese = GameLib.EntityManager.Instance.findComponentById('i22ixqizge'); -this.materialBreadOnion = GameLib.EntityManager.Instance.findComponentById('69sybcj08d'); -this.materialBreadOnionRing = GameLib.EntityManager.Instance.findComponentById('kvesyjtr2v'); -this.materialBreadPatty = GameLib.EntityManager.Instance.findComponentById('k6axym9bu5'); -this.materialBreadTomato = GameLib.EntityManager.Instance.findComponentById('9wxuzzz5co'); -this.materialBreadHead = GameLib.EntityManager.Instance.findComponentById('heu4f7zzuh'); -this.materialBreadTail = GameLib.EntityManager.Instance.findComponentById('mm2yq9rmpf'); -this.materialBreadCorner = GameLib.EntityManager.Instance.findComponentById('ju9r1bw6cb'); -this.materialPowerupSpeed = GameLib.EntityManager.Instance.findComponentById('fb32uutj9q'); -this.materialPowerupLife = GameLib.EntityManager.Instance.findComponentById('6tld70a6zu'); -this.materialPowerupSlow = GameLib.EntityManager.Instance.findComponentById('ulgntj8nta'); +this.materialTomato = R3.EntityManager.Instance.findComponentById('merwtvkm1t'); +this.materialBacon = R3.EntityManager.Instance.findComponentById('x5ffcl6ojc'); +this.materialCheese = R3.EntityManager.Instance.findComponentById('0rxqy5eddx'); +this.materialOnionRing = R3.EntityManager.Instance.findComponentById('gz8zex5xug'); +this.materialPatty = R3.EntityManager.Instance.findComponentById('f7y8nurbcv'); +this.materialOnion = R3.EntityManager.Instance.findComponentById('im3tsuzwrp'); +this.materialBreadBacon = R3.EntityManager.Instance.findComponentById('wn31yqi6lc'); +this.materialBreadCheese = R3.EntityManager.Instance.findComponentById('i22ixqizge'); +this.materialBreadOnion = R3.EntityManager.Instance.findComponentById('69sybcj08d'); +this.materialBreadOnionRing = R3.EntityManager.Instance.findComponentById('kvesyjtr2v'); +this.materialBreadPatty = R3.EntityManager.Instance.findComponentById('k6axym9bu5'); +this.materialBreadTomato = R3.EntityManager.Instance.findComponentById('9wxuzzz5co'); +this.materialBreadHead = R3.EntityManager.Instance.findComponentById('heu4f7zzuh'); +this.materialBreadTail = R3.EntityManager.Instance.findComponentById('mm2yq9rmpf'); +this.materialBreadCorner = R3.EntityManager.Instance.findComponentById('ju9r1bw6cb'); +this.materialPowerupSpeed = R3.EntityManager.Instance.findComponentById('fb32uutj9q'); +this.materialPowerupLife = R3.EntityManager.Instance.findComponentById('6tld70a6zu'); +this.materialPowerupSlow = R3.EntityManager.Instance.findComponentById('ulgntj8nta'); /** * Images */ -this.imagePowerupSpeed = GameLib.EntityManager.Instance.findComponentById('3mly5q145f'); -this.imagePowerupLife = GameLib.EntityManager.Instance.findComponentById('6ezbfrssvx'); -this.imagePowerupSlow = GameLib.EntityManager.Instance.findComponentById('nhd62hn7sa'); -this.imageHeart = GameLib.EntityManager.Instance.findComponentById('oa5xl4n05z'); -this.imageHeartGrey = GameLib.EntityManager.Instance.findComponentById('bh4miaqzwe'); +this.imagePowerupSpeed = R3.EntityManager.Instance.findComponentById('3mly5q145f'); +this.imagePowerupLife = R3.EntityManager.Instance.findComponentById('6ezbfrssvx'); +this.imagePowerupSlow = R3.EntityManager.Instance.findComponentById('nhd62hn7sa'); +this.imageHeart = R3.EntityManager.Instance.findComponentById('oa5xl4n05z'); +this.imageHeartGrey = R3.EntityManager.Instance.findComponentById('bh4miaqzwe'); -this.imagePauseButton = GameLib.EntityManager.Instance.findComponentById('x0ewaqg5fu'); -this.imageSoundButton = GameLib.EntityManager.Instance.findComponentById('w8sppso1z4'); -this.imageDownButton = GameLib.EntityManager.Instance.findComponentById('t0w8hmodl3'); -this.imageUpButton = GameLib.EntityManager.Instance.findComponentById('4v63jgi7t5'); -this.imageRightButton = GameLib.EntityManager.Instance.findComponentById('21o4zucc3c'); -this.imageLeftButton = GameLib.EntityManager.Instance.findComponentById('qkq4gs682q'); +this.imagePauseButton = R3.EntityManager.Instance.findComponentById('x0ewaqg5fu'); +this.imageSoundButton = R3.EntityManager.Instance.findComponentById('w8sppso1z4'); +this.imageDownButton = R3.EntityManager.Instance.findComponentById('t0w8hmodl3'); +this.imageUpButton = R3.EntityManager.Instance.findComponentById('4v63jgi7t5'); +this.imageRightButton = R3.EntityManager.Instance.findComponentById('21o4zucc3c'); +this.imageLeftButton = R3.EntityManager.Instance.findComponentById('qkq4gs682q'); -GameLib.CustomCode.prototype.createButtonAlphas = function(image) { +R3.CustomCode.prototype.createButtonAlphas = function(image) { var pixels = image.getPixelData(); image.alphas = []; for (i = 0; i < pixels.length; i += 4) { @@ -172,20 +172,20 @@ this.createButtonAlphas(this.imageLeftButton); /** * Other Objects (Scene) */ -this.scene = GameLib.EntityManager.Instance.findComponentById('pllp034hsj'); -this.camera = GameLib.EntityManager.Instance.findComponentById('u8eze0uajt'); -this.raycaster = GameLib.EntityManager.Instance.findComponentById('ftkhrkfqnu'); -this.animation = GameLib.EntityManager.Instance.findComponentById('8kb7utb2fn'); -this.animationRotation = GameLib.EntityManager.Instance.findComponentById('z628kythyn'); -this.particleEnginePickle = GameLib.EntityManager.Instance.findComponentById('ddtkiu8aaa'); -this.particlePickle = GameLib.EntityManager.Instance.findComponentById('8lx1d9tnbf'); +this.scene = R3.EntityManager.Instance.findComponentById('pllp034hsj'); +this.camera = R3.EntityManager.Instance.findComponentById('u8eze0uajt'); +this.raycaster = R3.EntityManager.Instance.findComponentById('ftkhrkfqnu'); +this.animation = R3.EntityManager.Instance.findComponentById('8kb7utb2fn'); +this.animationRotation = R3.EntityManager.Instance.findComponentById('z628kythyn'); +this.particleEnginePickle = R3.EntityManager.Instance.findComponentById('ddtkiu8aaa'); +this.particlePickle = R3.EntityManager.Instance.findComponentById('8lx1d9tnbf'); -GameLib.CustomCode.EXPLODE_LIFETIME = this.particlePickle.lifeTime; +R3.CustomCode.EXPLODE_LIFETIME = this.particlePickle.lifeTime; -this.canvasHUD = GameLib.EntityManager.Instance.findComponentById('lrh7junmhm'); -this.textureHUD = GameLib.EntityManager.Instance.findComponentById('zrjg7mqkxi'); +this.canvasHUD = R3.EntityManager.Instance.findComponentById('lrh7junmhm'); +this.textureHUD = R3.EntityManager.Instance.findComponentById('zrjg7mqkxi'); -this.animation.translationSpeed = GameLib.CustomCode.MIN_ANIMATION_SPEED; +this.animation.translationSpeed = R3.CustomCode.MIN_ANIMATION_SPEED; /** * Game objects @@ -193,17 +193,17 @@ this.animation.translationSpeed = GameLib.CustomCode.MIN_ANIMATION_SPEED; this.snake = []; this.grid = [[]]; -this.speed = GameLib.CustomCode.SPEED_INITIAL; +this.speed = R3.CustomCode.SPEED_INITIAL; this.advanceTime = 0; this.foodTime = 0; -this.foodSpeed = GameLib.CustomCode.FOOD_SPEED_INITIAL; +this.foodSpeed = R3.CustomCode.FOOD_SPEED_INITIAL; this.food = []; this.powerupTime = 0; -this.nextPowerupTime = GameLib.Utils.GetRandomIntInclusive( - GameLib.CustomCode.POWERUP_WAIT_TIME_MIN, - GameLib.CustomCode.POWERUP_WAIT_TIME_MAX +this.nextPowerupTime = R3.Utils.GetRandomIntInclusive( + R3.CustomCode.POWERUP_WAIT_TIME_MIN, + R3.CustomCode.POWERUP_WAIT_TIME_MAX ); this.powerups = []; @@ -231,43 +231,43 @@ this.state = { highscore : 0 }; -GameLib.CustomCode.prototype.advanceSpeedTimer = function(delta) { +R3.CustomCode.prototype.advanceSpeedTimer = function(delta) { this.speedTimer += delta; - if (this.speedTimer < GameLib.CustomCode.SPEED_INCREASE_INTERVAL) { + if (this.speedTimer < R3.CustomCode.SPEED_INCREASE_INTERVAL) { return; } this.speedTimer = 0; - this.speed -= GameLib.CustomCode.SPEED_GRAIN; + this.speed -= R3.CustomCode.SPEED_GRAIN; - if (this.speed < GameLib.CustomCode.MAX_SPEED) { - this.speed = GameLib.CustomCode.MAX_SPEED; + if (this.speed < R3.CustomCode.MAX_SPEED) { + this.speed = R3.CustomCode.MAX_SPEED; } - this.animation.translationSpeed += GameLib.CustomCode.ANIMATION_SPEED_GRAIN; + this.animation.translationSpeed += R3.CustomCode.ANIMATION_SPEED_GRAIN; - if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) { - this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED; + if (this.animation.translationSpeed > R3.CustomCode.MAX_ANIMATION_SPEED) { + this.animation.translationSpeed = R3.CustomCode.MAX_ANIMATION_SPEED; } console.log(this.animation.translationSpeed + ':' + this.speed ); }.bind(this) -GameLib.CustomCode.prototype.displayHUD = function() { +R3.CustomCode.prototype.displayHUD = function() { this.canvasHUD.clear(); this.canvasHUD.line(50, 38, 462, 38, 2, "#000000"); - var highscore = GameLib.Utils.PaddedText(5, '0', this.state.highscore + '') + 'cm'; + var highscore = R3.Utils.PaddedText(5, '0', this.state.highscore + '') + 'cm'; this.canvasHUD.text('hiscore ' + highscore, 50, 32, '15px Pixeled', '#ffffff'); - var score = GameLib.Utils.PaddedText(5, '0', this.state.score + '') + 'cm'; + var score = R3.Utils.PaddedText(5, '0', this.state.score + '') + 'cm'; this.canvasHUD.text(score, 356, 32, '15px Pixeled', '#ffffff'); @@ -324,11 +324,11 @@ GameLib.CustomCode.prototype.displayHUD = function() { }.bind(this) -GameLib.CustomCode.prototype.waitReload = function(delta) { +R3.CustomCode.prototype.waitReload = function(delta) { this.explodeTime += delta; - if (this.explodeTime < GameLib.CustomCode.EXPLODE_LIFETIME) { + if (this.explodeTime < R3.CustomCode.EXPLODE_LIFETIME) { return; } @@ -351,8 +351,8 @@ GameLib.CustomCode.prototype.waitReload = function(delta) { this.restore(); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Get Ready' } @@ -415,7 +415,7 @@ GameLib.CustomCode.prototype.waitReload = function(delta) { }.bind(this) -GameLib.CustomCode.prototype.visualizeGrid = function () { +R3.CustomCode.prototype.visualizeGrid = function () { return; @@ -445,41 +445,41 @@ GameLib.CustomCode.prototype.visualizeGrid = function () { x.map( function(object, yIndex) { - if (object.objectType === GameLib.CustomCode.OBJECT_TYPE_NONE) { + if (object.objectType === R3.CustomCode.OBJECT_TYPE_NONE) { this.noneGeometry.vertices.push( new THREE.Vector3( - (xIndex * GameLib.CustomCode.BODY_SCALE_X) + GameLib.CustomCode.GRID_OFFSET_X, - (yIndex * GameLib.CustomCode.BODY_SCALE_Y) + GameLib.CustomCode.GRID_OFFSET_Y, + (xIndex * R3.CustomCode.BODY_SCALE_X) + R3.CustomCode.GRID_OFFSET_X, + (yIndex * R3.CustomCode.BODY_SCALE_Y) + R3.CustomCode.GRID_OFFSET_Y, 5 ) ); } - if (object.objectType === GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY) { + if (object.objectType === R3.CustomCode.OBJECT_TYPE_SNAKE_BODY) { this.snakeGeometry.vertices.push( new THREE.Vector3( - (xIndex * GameLib.CustomCode.BODY_SCALE_X) + GameLib.CustomCode.GRID_OFFSET_X, - (yIndex * GameLib.CustomCode.BODY_SCALE_Y) + GameLib.CustomCode.GRID_OFFSET_Y, + (xIndex * R3.CustomCode.BODY_SCALE_X) + R3.CustomCode.GRID_OFFSET_X, + (yIndex * R3.CustomCode.BODY_SCALE_Y) + R3.CustomCode.GRID_OFFSET_Y, 5 ) ); } - if (object.objectType === GameLib.CustomCode.OBJECT_TYPE_FOOD) { + if (object.objectType === R3.CustomCode.OBJECT_TYPE_FOOD) { this.foodGeometry.vertices.push( new THREE.Vector3( - (xIndex * GameLib.CustomCode.BODY_SCALE_X) + GameLib.CustomCode.GRID_OFFSET_X, - (yIndex * GameLib.CustomCode.BODY_SCALE_Y) + GameLib.CustomCode.GRID_OFFSET_Y, + (xIndex * R3.CustomCode.BODY_SCALE_X) + R3.CustomCode.GRID_OFFSET_X, + (yIndex * R3.CustomCode.BODY_SCALE_Y) + R3.CustomCode.GRID_OFFSET_Y, 5 ) ); } - if (object.objectType === GameLib.CustomCode.OBJECT_TYPE_POWERUP) { + if (object.objectType === R3.CustomCode.OBJECT_TYPE_POWERUP) { this.powerupGeometry.vertices.push( new THREE.Vector3( - (xIndex * GameLib.CustomCode.BODY_SCALE_X) + GameLib.CustomCode.GRID_OFFSET_X, - (yIndex * GameLib.CustomCode.BODY_SCALE_Y) + GameLib.CustomCode.GRID_OFFSET_Y, + (xIndex * R3.CustomCode.BODY_SCALE_X) + R3.CustomCode.GRID_OFFSET_X, + (yIndex * R3.CustomCode.BODY_SCALE_Y) + R3.CustomCode.GRID_OFFSET_Y, 5 ) ); @@ -507,13 +507,13 @@ GameLib.CustomCode.prototype.visualizeGrid = function () { }.bind(this) -GameLib.CustomCode.prototype.createGameMesh = function(material, visible) { +R3.CustomCode.prototype.createGameMesh = function(material, visible) { - if (GameLib.Utils.UndefinedOrNull(visible)) { + if (R3.Utils.UndefinedOrNull(visible)) { visible = true; } - var mesh = new GameLib.D3.Mesh( + var mesh = new R3.D3.Mesh( this.runtime.graphics, { geometry : this.geometryBody, @@ -530,35 +530,35 @@ GameLib.CustomCode.prototype.createGameMesh = function(material, visible) { }.bind(this) /** - * GameLib.CustomCode.Object + * R3.CustomCode.Object * @param objectType * @param type * @param mesh * @param position * @constructor */ -GameLib.CustomCode.GameObject = function( +R3.CustomCode.GameObject = function( objectType, type, mesh, position ) { - if (GameLib.Utils.UndefinedOrNull(objectType)) { - objectType = GameLib.CustomCode.OBJECT_TYPE_NONE; + if (R3.Utils.UndefinedOrNull(objectType)) { + objectType = R3.CustomCode.OBJECT_TYPE_NONE; } this.objectType = objectType; - if (GameLib.Utils.UndefinedOrNull(type)) { + if (R3.Utils.UndefinedOrNull(type)) { type = -1; } this.type = type; - if (GameLib.Utils.UndefinedOrNull(mesh)) { + if (R3.Utils.UndefinedOrNull(mesh)) { mesh = null; } this.mesh = mesh; - if (GameLib.Utils.UndefinedOrNull(position)) { + if (R3.Utils.UndefinedOrNull(position)) { position = null; } this.position = position; @@ -567,9 +567,9 @@ GameLib.CustomCode.GameObject = function( /** * Disposes of the mesh object and resets this object to its defaults */ -GameLib.CustomCode.GameObject.prototype.dispose = function(removeMesh) { +R3.CustomCode.GameObject.prototype.dispose = function(removeMesh) { - if (GameLib.Utils.UndefinedOrNull(removeMesh)) { + if (R3.Utils.UndefinedOrNull(removeMesh)) { removeMesh = true; } @@ -580,7 +580,7 @@ GameLib.CustomCode.GameObject.prototype.dispose = function(removeMesh) { this.mesh = null; } - this.objectType = GameLib.CustomCode.OBJECT_TYPE_NONE; + this.objectType = R3.CustomCode.OBJECT_TYPE_NONE; this.type = -1; @@ -591,11 +591,11 @@ GameLib.CustomCode.GameObject.prototype.dispose = function(removeMesh) { * Applies the object position to the mesh taking into account the offset and scale of the body * @param updateInstance */ -GameLib.CustomCode.GameObject.prototype.applyToMesh = function(updateInstance) { +R3.CustomCode.GameObject.prototype.applyToMesh = function(updateInstance) { if (this.mesh) { - this.mesh.position.x = (this.position.x * GameLib.CustomCode.BODY_SCALE_X) + GameLib.CustomCode.GRID_OFFSET_X; - this.mesh.position.y = (this.position.y * GameLib.CustomCode.BODY_SCALE_Y) + GameLib.CustomCode.GRID_OFFSET_Y; + this.mesh.position.x = (this.position.x * R3.CustomCode.BODY_SCALE_X) + R3.CustomCode.GRID_OFFSET_X; + this.mesh.position.y = (this.position.y * R3.CustomCode.BODY_SCALE_Y) + R3.CustomCode.GRID_OFFSET_Y; this.mesh.position.z = 0.1; if (updateInstance) { @@ -608,7 +608,7 @@ GameLib.CustomCode.GameObject.prototype.applyToMesh = function(updateInstance) { * Scans through the grid, gets all empty positions, and chooses a random one * @type {function(this:snakeEntityLoaded)} */ -GameLib.CustomCode.prototype.getFreeGridPosition = function() { +R3.CustomCode.prototype.getFreeGridPosition = function() { var positions = []; @@ -616,7 +616,7 @@ GameLib.CustomCode.prototype.getFreeGridPosition = function() { function(row, x) { row.map( function(object, y) { - if (object.objectType === GameLib.CustomCode.OBJECT_TYPE_NONE) { + if (object.objectType === R3.CustomCode.OBJECT_TYPE_NONE) { positions.push( { x : x, @@ -633,7 +633,7 @@ GameLib.CustomCode.prototype.getFreeGridPosition = function() { return null; } - var index = GameLib.Utils.GetRandomInt(0, positions.length); + var index = R3.Utils.GetRandomInt(0, positions.length); return positions[index]; @@ -643,30 +643,30 @@ GameLib.CustomCode.prototype.getFreeGridPosition = function() { * * @type {function(this:snakeEntityLoaded)} */ -GameLib.CustomCode.prototype.createGameObject = function( +R3.CustomCode.prototype.createGameObject = function( objectType, type, position, orientation ) { - if (GameLib.Utils.UndefinedOrNull(type)) { + if (R3.Utils.UndefinedOrNull(type)) { type = null; } var mesh = null; var array = null; - if (objectType === GameLib.CustomCode.OBJECT_TYPE_POWERUP) { - type = GameLib.Utils.GetRandomIntInclusive(0, 2); + if (objectType === R3.CustomCode.OBJECT_TYPE_POWERUP) { + type = R3.Utils.GetRandomIntInclusive(0, 2); switch (type) { - case GameLib.CustomCode.POWERUP_SPEED : + case R3.CustomCode.POWERUP_SPEED : mesh = this.createGameMesh(this.materialPowerupSpeed); break; - case GameLib.CustomCode.POWERUP_LIFE : + case R3.CustomCode.POWERUP_LIFE : mesh = this.createGameMesh(this.materialPowerupLife); break; - case GameLib.CustomCode.POWERUP_SLOW : + case R3.CustomCode.POWERUP_SLOW : mesh = this.createGameMesh(this.materialPowerupSlow); break; default: @@ -683,25 +683,25 @@ GameLib.CustomCode.prototype.createGameObject = function( array = this.powerups; } - if (objectType === GameLib.CustomCode.OBJECT_TYPE_FOOD) { - type = GameLib.Utils.GetRandomIntInclusive(0, 5); + if (objectType === R3.CustomCode.OBJECT_TYPE_FOOD) { + type = R3.Utils.GetRandomIntInclusive(0, 5); switch (type) { - case GameLib.CustomCode.FOOD_BACON : + case R3.CustomCode.FOOD_BACON : mesh = this.createGameMesh(this.materialBacon); break; - case GameLib.CustomCode.FOOD_CHEESE : + case R3.CustomCode.FOOD_CHEESE : mesh = this.createGameMesh(this.materialCheese); break; - case GameLib.CustomCode.FOOD_ONION : + case R3.CustomCode.FOOD_ONION : mesh = this.createGameMesh(this.materialOnion); break; - case GameLib.CustomCode.FOOD_ONION_RING : + case R3.CustomCode.FOOD_ONION_RING : mesh = this.createGameMesh(this.materialOnionRing); break; - case GameLib.CustomCode.FOOD_PATTY : + case R3.CustomCode.FOOD_PATTY : mesh = this.createGameMesh(this.materialPatty); break; - case GameLib.CustomCode.FOOD_TOMATO : + case R3.CustomCode.FOOD_TOMATO : mesh = this.createGameMesh(this.materialTomato); break; default : @@ -720,35 +720,35 @@ GameLib.CustomCode.prototype.createGameObject = function( var isTail = false; - if (objectType === GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY) { + if (objectType === R3.CustomCode.OBJECT_TYPE_SNAKE_BODY) { switch (type) { - case GameLib.CustomCode.BODY_TYPE_BREAD_BACON : + case R3.CustomCode.BODY_TYPE_BREAD_BACON : mesh = this.createGameMesh(this.materialBreadBacon); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_CHEESE : + case R3.CustomCode.BODY_TYPE_BREAD_CHEESE : mesh = this.createGameMesh(this.materialBreadCheese); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_ONION : + case R3.CustomCode.BODY_TYPE_BREAD_ONION : mesh = this.createGameMesh(this.materialBreadOnion); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_ONION_RING : + case R3.CustomCode.BODY_TYPE_BREAD_ONION_RING : mesh = this.createGameMesh(this.materialBreadOnionRing); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_PATTY : + case R3.CustomCode.BODY_TYPE_BREAD_PATTY : mesh = this.createGameMesh(this.materialBreadPatty); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_TOMATO : + case R3.CustomCode.BODY_TYPE_BREAD_TOMATO : mesh = this.createGameMesh(this.materialBreadTomato); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_HEAD : + case R3.CustomCode.BODY_TYPE_BREAD_HEAD : mesh = this.createGameMesh(this.materialBreadHead); break; - case GameLib.CustomCode.BODY_TYPE_BREAD_TAIL : + case R3.CustomCode.BODY_TYPE_BREAD_TAIL : mesh = this.createGameMesh(this.materialBreadTail); isTail = true; break; - case GameLib.CustomCode.BODY_TYPE_BREAD_CORNER : + case R3.CustomCode.BODY_TYPE_BREAD_CORNER : mesh = this.createGameMesh(this.materialBreadCorner); break; default : @@ -761,9 +761,9 @@ GameLib.CustomCode.prototype.createGameObject = function( var gameObject = null; switch (objectType) { - case GameLib.CustomCode.OBJECT_TYPE_FOOD: - case GameLib.CustomCode.OBJECT_TYPE_POWERUP: - gameObject = new GameLib.CustomCode.GameObject( + case R3.CustomCode.OBJECT_TYPE_FOOD: + case R3.CustomCode.OBJECT_TYPE_POWERUP: + gameObject = new R3.CustomCode.GameObject( objectType, type, mesh, @@ -771,9 +771,9 @@ GameLib.CustomCode.prototype.createGameObject = function( ) gameObject.applyToMesh(true); break; - case GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY: + case R3.CustomCode.OBJECT_TYPE_SNAKE_BODY: - gameObject = new GameLib.CustomCode.SnakeBody( + gameObject = new R3.CustomCode.SnakeBody( type, mesh, position, @@ -799,7 +799,7 @@ GameLib.CustomCode.prototype.createGameObject = function( /** * If there is a powerup at this position - remove it */ - if (currentGameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_POWERUP) { + if (currentGameObject.objectType === R3.CustomCode.OBJECT_TYPE_POWERUP) { this.powerups.splice( this.powerups.indexOf(currentGameObject), 1 @@ -809,7 +809,7 @@ GameLib.CustomCode.prototype.createGameObject = function( /** * If there is food at this position - remove it */ - if (currentGameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_FOOD) { + if (currentGameObject.objectType === R3.CustomCode.OBJECT_TYPE_FOOD) { this.food.splice( this.food.indexOf(currentGameObject), 1 @@ -819,7 +819,7 @@ GameLib.CustomCode.prototype.createGameObject = function( /** * If there is an existing snake body at this position - explode! */ - if (currentGameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY) { + if (currentGameObject.objectType === R3.CustomCode.OBJECT_TYPE_SNAKE_BODY) { console.warn('should not reach this code if collision detection is perfect'); this.explode(currentGameObject.position); return gameObject; @@ -833,8 +833,8 @@ GameLib.CustomCode.prototype.createGameObject = function( */ if ( - gameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_POWERUP || - gameObject.objectType === GameLib.CustomCode.OBJECT_TYPE_FOOD + gameObject.objectType === R3.CustomCode.OBJECT_TYPE_POWERUP || + gameObject.objectType === R3.CustomCode.OBJECT_TYPE_FOOD ) { /** * Food and powerups automatically get added, snake bodys need careful insertion @@ -845,12 +845,12 @@ GameLib.CustomCode.prototype.createGameObject = function( /** * If we have too many objects - dispose of the first on in the queue (fifo) */ - if (this.food.length > GameLib.CustomCode.MAX_FOOD_ITEMS) { + if (this.food.length > R3.CustomCode.MAX_FOOD_ITEMS) { gameObject = this.food.shift(); this.grid[gameObject.position.x][gameObject.position.y].dispose(); } - if (this.powerups.length > GameLib.CustomCode.MAX_POWERUP_ITEMS) { + if (this.powerups.length > R3.CustomCode.MAX_POWERUP_ITEMS) { gameObject = this.powerups.shift(); this.grid[gameObject.position.x][gameObject.position.y].dispose(); } @@ -861,7 +861,7 @@ GameLib.CustomCode.prototype.createGameObject = function( }.bind(this); -GameLib.CustomCode.prototype.createPowerup = function(delta) { +R3.CustomCode.prototype.createPowerup = function(delta) { if (this.state.exploding) { return; @@ -882,7 +882,7 @@ GameLib.CustomCode.prototype.createPowerup = function(delta) { } else { this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_POWERUP, + R3.CustomCode.OBJECT_TYPE_POWERUP, null, position ); @@ -891,7 +891,7 @@ GameLib.CustomCode.prototype.createPowerup = function(delta) { }.bind(this); -GameLib.CustomCode.prototype.createFood = function(delta) { +R3.CustomCode.prototype.createFood = function(delta) { if (this.state.exploding) { return; @@ -911,7 +911,7 @@ GameLib.CustomCode.prototype.createFood = function(delta) { this.gameOver(true); } else { this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_FOOD, + R3.CustomCode.OBJECT_TYPE_FOOD, null, position ); @@ -919,13 +919,13 @@ GameLib.CustomCode.prototype.createFood = function(delta) { }.bind(this); -GameLib.CustomCode.prototype.gameOver = function(won) { +R3.CustomCode.prototype.gameOver = function(won) { this.state.gameOver = true; if (won) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Game Over Won' } @@ -938,8 +938,8 @@ GameLib.CustomCode.prototype.gameOver = function(won) { }; } else { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Game Over Lost' } @@ -955,7 +955,7 @@ GameLib.CustomCode.prototype.gameOver = function(won) { }.bind(this) /** - * GameLib.CustomCode.SnakeBody + * R3.CustomCode.SnakeBody * @param type * @param mesh * @param position @@ -966,7 +966,7 @@ GameLib.CustomCode.prototype.gameOver = function(won) { * @property animation * @constructor */ -GameLib.CustomCode.SnakeBody = function( +R3.CustomCode.SnakeBody = function( type, mesh, position, @@ -976,41 +976,41 @@ GameLib.CustomCode.SnakeBody = function( isTail ) { - GameLib.CustomCode.GameObject.call( + R3.CustomCode.GameObject.call( this, - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, type, mesh, position ); - if (GameLib.Utils.UndefinedOrNull(orientation)) { - orientation = GameLib.CustomCode.ORIENTATION_UP; + if (R3.Utils.UndefinedOrNull(orientation)) { + orientation = R3.CustomCode.ORIENTATION_UP; } this.orientation = orientation; - if (GameLib.Utils.UndefinedOrNull(flip)) { + if (R3.Utils.UndefinedOrNull(flip)) { flip = 0; } this.flip = flip; - if (GameLib.Utils.UndefinedOrNull(backupMesh)) { + if (R3.Utils.UndefinedOrNull(backupMesh)) { backupMesh = null; } this.backupMesh = backupMesh; - if (GameLib.Utils.UndefinedOrNull(isTail)) { + if (R3.Utils.UndefinedOrNull(isTail)) { isTail = false; } this.isTail = isTail; }; -GameLib.CustomCode.SnakeBody.prototype = Object.create(GameLib.CustomCode.GameObject.prototype); -GameLib.CustomCode.SnakeBody.prototype.constructor = GameLib.CustomCode.GameObject; +R3.CustomCode.SnakeBody.prototype = Object.create(R3.CustomCode.GameObject.prototype); +R3.CustomCode.SnakeBody.prototype.constructor = R3.CustomCode.GameObject; -GameLib.CustomCode.SnakeBody.prototype.dispose = function() { +R3.CustomCode.SnakeBody.prototype.dispose = function() { - GameLib.CustomCode.GameObject.prototype.dispose.call(this); + R3.CustomCode.GameObject.prototype.dispose.call(this); if (this.backupMesh) { this.backupMesh.geometry = null; @@ -1024,8 +1024,8 @@ GameLib.CustomCode.SnakeBody.prototype.dispose = function() { this.isTail = false; } -GameLib.CustomCode.SnakeBody.prototype.clone = function() { - return new GameLib.CustomCode.SnakeBody( +R3.CustomCode.SnakeBody.prototype.clone = function() { + return new R3.CustomCode.SnakeBody( this.type, this.mesh, { @@ -1039,9 +1039,9 @@ GameLib.CustomCode.SnakeBody.prototype.clone = function() { ) }; -GameLib.CustomCode.SnakeBody.prototype.applyToMesh = function(updateInstance) { +R3.CustomCode.SnakeBody.prototype.applyToMesh = function(updateInstance) { - GameLib.CustomCode.GameObject.prototype.applyToMesh.call(this, updateInstance); + R3.CustomCode.GameObject.prototype.applyToMesh.call(this, updateInstance); this.mesh.rotation.z = this.orientation * Math.PI / 2; @@ -1054,34 +1054,34 @@ GameLib.CustomCode.SnakeBody.prototype.applyToMesh = function(updateInstance) { this.mesh.updateInstance('rotation'); } -GameLib.CustomCode.SnakeBody.prototype.advance = function(orientation, flip) { +R3.CustomCode.SnakeBody.prototype.advance = function(orientation, flip) { var crash = false; switch (orientation) { - case GameLib.CustomCode.ORIENTATION_UP : - if ((this.position.y + 1) >= GameLib.CustomCode.GRID_HEIGHT) { + case R3.CustomCode.ORIENTATION_UP : + if ((this.position.y + 1) >= R3.CustomCode.GRID_HEIGHT) { crash = true; } else { this.position.y += 1; } break; - case GameLib.CustomCode.ORIENTATION_DOWN : + case R3.CustomCode.ORIENTATION_DOWN : if ((this.position.y - 1) < 0) { crash = true; } else { this.position.y -= 1; } break; - case GameLib.CustomCode.ORIENTATION_LEFT : + case R3.CustomCode.ORIENTATION_LEFT : if ((this.position.x - 1) < 0) { crash = true; } else { this.position.x -= 1; } break; - case GameLib.CustomCode.ORIENTATION_RIGHT : - if ((this.position.x + 1) >= GameLib.CustomCode.GRID_WIDTH) { + case R3.CustomCode.ORIENTATION_RIGHT : + if ((this.position.x + 1) >= R3.CustomCode.GRID_WIDTH) { crash = true; } else { this.position.x += 1; @@ -1103,7 +1103,7 @@ GameLib.CustomCode.SnakeBody.prototype.advance = function(orientation, flip) { return !crash; } -GameLib.CustomCode.prototype.initializeGrid = function() { +R3.CustomCode.prototype.initializeGrid = function() { this.grid.map( function(x) { @@ -1125,10 +1125,10 @@ GameLib.CustomCode.prototype.initializeGrid = function() { this.grid = []; - for (var x = 0; x < GameLib.CustomCode.GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.GRID_WIDTH; x++) { this.grid[x] = []; - for (var y = 0; y < GameLib.CustomCode.GRID_HEIGHT; y++) { - this.grid[x][y] = new GameLib.CustomCode.GameObject(); + for (var y = 0; y < R3.CustomCode.GRID_HEIGHT; y++) { + this.grid[x][y] = new R3.CustomCode.GameObject(); } } @@ -1138,10 +1138,10 @@ GameLib.CustomCode.prototype.initializeGrid = function() { * Explode the snake * @param position */ -GameLib.CustomCode.prototype.explode = function(position) { +R3.CustomCode.prototype.explode = function(position) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Crashed' } @@ -1150,8 +1150,8 @@ GameLib.CustomCode.prototype.explode = function(position) { this.state.exploding = true; this.state.lives -= 1; - this.particleEnginePickle.position.x = (position.x * GameLib.CustomCode.BODY_SCALE_X) + GameLib.CustomCode.GRID_OFFSET_X; - this.particleEnginePickle.position.y = (position.y * GameLib.CustomCode.BODY_SCALE_Y) + GameLib.CustomCode.GRID_OFFSET_Y; + this.particleEnginePickle.position.x = (position.x * R3.CustomCode.BODY_SCALE_X) + R3.CustomCode.GRID_OFFSET_X; + this.particleEnginePickle.position.y = (position.y * R3.CustomCode.BODY_SCALE_Y) + R3.CustomCode.GRID_OFFSET_Y; this.particleEnginePickle.updateInstance('position'); this.particleEnginePickle.enabled = true; @@ -1162,14 +1162,14 @@ GameLib.CustomCode.prototype.explode = function(position) { * Extend the snake with information from gameObject * @param gameObject */ -GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation) { +R3.CustomCode.prototype.extend = function(gameObject, position, orientation) { - if (gameObject.objectType !== GameLib.CustomCode.OBJECT_TYPE_FOOD) { + if (gameObject.objectType !== R3.CustomCode.OBJECT_TYPE_FOOD) { throw new Error('wrong type of game object'); } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Extend' } @@ -1178,10 +1178,10 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation var body = null; switch (gameObject.type) { - case GameLib.CustomCode.FOOD_BACON : + case R3.CustomCode.FOOD_BACON : body = this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_BACON, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_BACON, { x : position.x, y : position.y @@ -1189,10 +1189,10 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation orientation ) break; - case GameLib.CustomCode.FOOD_CHEESE : + case R3.CustomCode.FOOD_CHEESE : body = this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_CHEESE, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_CHEESE, { x : position.x, y : position.y @@ -1200,10 +1200,10 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation orientation ) break; - case GameLib.CustomCode.FOOD_ONION : + case R3.CustomCode.FOOD_ONION : body = this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_ONION, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_ONION, { x : position.x, y : position.y @@ -1211,10 +1211,10 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation orientation ) break; - case GameLib.CustomCode.FOOD_ONION_RING : + case R3.CustomCode.FOOD_ONION_RING : body = this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_ONION_RING, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_ONION_RING, { x : position.x, y : position.y @@ -1222,10 +1222,10 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation orientation ) break; - case GameLib.CustomCode.FOOD_PATTY : + case R3.CustomCode.FOOD_PATTY : body = this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_PATTY, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_PATTY, { x : position.x, y : position.y @@ -1233,10 +1233,10 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation orientation ) break; - case GameLib.CustomCode.FOOD_TOMATO : + case R3.CustomCode.FOOD_TOMATO : body = this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_TOMATO, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_TOMATO, { x : position.x, y : position.y @@ -1250,20 +1250,20 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation /* - if (orientation === GameLib.CustomCode.ORIENTATION_UP) { - body.mesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (orientation === R3.CustomCode.ORIENTATION_UP) { + body.mesh.position.y -= 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (orientation === GameLib.CustomCode.ORIENTATION_DOWN) { - body.mesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (orientation === R3.CustomCode.ORIENTATION_DOWN) { + body.mesh.position.y += 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (orientation === GameLib.CustomCode.ORIENTATION_LEFT) { - body.mesh.position.x += 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (orientation === R3.CustomCode.ORIENTATION_LEFT) { + body.mesh.position.x += 0.5 * R3.CustomCode.BODY_SCALE_X; } - if (orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { - body.mesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (orientation === R3.CustomCode.ORIENTATION_RIGHT) { + body.mesh.position.x -= 0.5 * R3.CustomCode.BODY_SCALE_X; }*/ body.mesh.updateInstance('position'); @@ -1284,24 +1284,24 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation this.grid[body.position.x][body.position.y] = body; - if (this.snake.length === GameLib.CustomCode.GRID_WIDTH * GameLib.CustomCode.GRID_HEIGHT) { + if (this.snake.length === R3.CustomCode.GRID_WIDTH * R3.CustomCode.GRID_HEIGHT) { this.gameOver(true); } - this.extendSpeedGrain = (GameLib.CustomCode.SPEED_INITIAL - GameLib.CustomCode.MAX_SPEED) / ((GameLib.CustomCode.GRID_WIDTH * GameLib.CustomCode.GRID_HEIGHT) - this.snake.length) + this.extendSpeedGrain = (R3.CustomCode.SPEED_INITIAL - R3.CustomCode.MAX_SPEED) / ((R3.CustomCode.GRID_WIDTH * R3.CustomCode.GRID_HEIGHT) - this.snake.length) - var animationSpeedGrain = (GameLib.CustomCode.MAX_ANIMATION_SPEED - GameLib.CustomCode.MIN_ANIMATION_SPEED) / ((GameLib.CustomCode.GRID_WIDTH * GameLib.CustomCode.GRID_HEIGHT) - this.snake.length) + var animationSpeedGrain = (R3.CustomCode.MAX_ANIMATION_SPEED - R3.CustomCode.MIN_ANIMATION_SPEED) / ((R3.CustomCode.GRID_WIDTH * R3.CustomCode.GRID_HEIGHT) - this.snake.length) this.speed -= this.extendSpeedGrain; - if (this.speed < GameLib.CustomCode.MAX_SPEED) { - this.speed = GameLib.CustomCode.MAX_SPEED; + if (this.speed < R3.CustomCode.MAX_SPEED) { + this.speed = R3.CustomCode.MAX_SPEED; } this.animation.translationSpeed += animationSpeedGrain; - if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) { - this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED; + if (this.animation.translationSpeed > R3.CustomCode.MAX_ANIMATION_SPEED) { + this.animation.translationSpeed = R3.CustomCode.MAX_ANIMATION_SPEED; } this.state.score += Math.round((1 - this.speed) * 100); @@ -1316,20 +1316,20 @@ GameLib.CustomCode.prototype.extend = function(gameObject, position, orientation * Powerup the snake with information from gameObject * @param gameObject */ -GameLib.CustomCode.prototype.powerup = function(gameObject) { +R3.CustomCode.prototype.powerup = function(gameObject) { - if (gameObject.objectType !== GameLib.CustomCode.OBJECT_TYPE_POWERUP) { + if (gameObject.objectType !== R3.CustomCode.OBJECT_TYPE_POWERUP) { throw new Error('wrong type of game object'); } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Powerup' } ); - if (gameObject.type === GameLib.CustomCode.POWERUP_LIFE) { + if (gameObject.type === R3.CustomCode.POWERUP_LIFE) { this.state.lives += 1; @@ -1340,34 +1340,34 @@ GameLib.CustomCode.prototype.powerup = function(gameObject) { this.displayHUD(); } - if (gameObject.type === GameLib.CustomCode.POWERUP_SPEED) { + if (gameObject.type === R3.CustomCode.POWERUP_SPEED) { - this.speed -= GameLib.CustomCode.POWERUP_SPEED_GRAIN; + this.speed -= R3.CustomCode.POWERUP_SPEED_GRAIN; - if (this.speed < GameLib.CustomCode.MAX_SPEED) { - this.speed = GameLib.CustomCode.MAX_SPEED; + if (this.speed < R3.CustomCode.MAX_SPEED) { + this.speed = R3.CustomCode.MAX_SPEED; } - this.animation.translationSpeed += GameLib.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN; + this.animation.translationSpeed += R3.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN; - if (this.animation.translationSpeed > GameLib.CustomCode.MAX_ANIMATION_SPEED) { - this.animation.translationSpeed = GameLib.CustomCode.MAX_ANIMATION_SPEED; + if (this.animation.translationSpeed > R3.CustomCode.MAX_ANIMATION_SPEED) { + this.animation.translationSpeed = R3.CustomCode.MAX_ANIMATION_SPEED; } } - if (gameObject.type === GameLib.CustomCode.POWERUP_SLOW) { + if (gameObject.type === R3.CustomCode.POWERUP_SLOW) { - this.speed += GameLib.CustomCode.POWERUP_SPEED_GRAIN; + this.speed += R3.CustomCode.POWERUP_SPEED_GRAIN; - if (this.speed > GameLib.CustomCode.MIN_SPEED) { - this.speed = GameLib.CustomCode.MIN_SPEED; + if (this.speed > R3.CustomCode.MIN_SPEED) { + this.speed = R3.CustomCode.MIN_SPEED; } - this.animation.translationSpeed -= GameLib.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN; + this.animation.translationSpeed -= R3.CustomCode.POWERUP_ANIMATION_SPEED_GRAIN; - if (this.animation.translationSpeed < GameLib.CustomCode.MIN_ANIMATION_SPEED) { - this.animation.translationSpeed = GameLib.CustomCode.MIN_ANIMATION_SPEED; + if (this.animation.translationSpeed < R3.CustomCode.MIN_ANIMATION_SPEED) { + this.animation.translationSpeed = R3.CustomCode.MIN_ANIMATION_SPEED; } } @@ -1385,7 +1385,7 @@ GameLib.CustomCode.prototype.powerup = function(gameObject) { }.bind(this); -GameLib.CustomCode.prototype.createCorner = function(body, temp) { +R3.CustomCode.prototype.createCorner = function(body, temp) { var backupOrientation = body.orientation; @@ -1395,20 +1395,20 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) { body.backupMesh = body.mesh; - if (temp.orientation === GameLib.CustomCode.ORIENTATION_UP) { - body.backupMesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (temp.orientation === R3.CustomCode.ORIENTATION_UP) { + body.backupMesh.position.y -= 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (temp.orientation === GameLib.CustomCode.ORIENTATION_DOWN) { - body.backupMesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (temp.orientation === R3.CustomCode.ORIENTATION_DOWN) { + body.backupMesh.position.y += 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (temp.orientation === GameLib.CustomCode.ORIENTATION_LEFT) { - body.backupMesh.position.x += 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (temp.orientation === R3.CustomCode.ORIENTATION_LEFT) { + body.backupMesh.position.x += 0.5 * R3.CustomCode.BODY_SCALE_X; } - if (temp.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { - body.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (temp.orientation === R3.CustomCode.ORIENTATION_RIGHT) { + body.backupMesh.position.x -= 0.5 * R3.CustomCode.BODY_SCALE_X; } body.orientation = backupOrientation; @@ -1425,7 +1425,7 @@ GameLib.CustomCode.prototype.createCorner = function(body, temp) { }.bind(this); -GameLib.CustomCode.prototype.backup = function() { +R3.CustomCode.prototype.backup = function() { this.backupState = { snake : this.snake.map( @@ -1439,7 +1439,7 @@ GameLib.CustomCode.prototype.backup = function() { }.bind(this) -GameLib.CustomCode.prototype.restore = function() { +R3.CustomCode.prototype.restore = function() { this.snake.map( function(body) { @@ -1520,20 +1520,20 @@ GameLib.CustomCode.prototype.restore = function() { clone.applyToMesh(); clone.backupMesh = clone.mesh; - if (clone.orientation === GameLib.CustomCode.ORIENTATION_UP) { - clone.backupMesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (clone.orientation === R3.CustomCode.ORIENTATION_UP) { + clone.backupMesh.position.y += 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (clone.orientation === GameLib.CustomCode.ORIENTATION_DOWN) { - clone.backupMesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (clone.orientation === R3.CustomCode.ORIENTATION_DOWN) { + clone.backupMesh.position.y -= 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (clone.orientation === GameLib.CustomCode.ORIENTATION_LEFT) { - clone.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (clone.orientation === R3.CustomCode.ORIENTATION_LEFT) { + clone.backupMesh.position.x -= 0.5 * R3.CustomCode.BODY_SCALE_X; } - if (clone.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { - clone.backupMesh.position.x += 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (clone.orientation === R3.CustomCode.ORIENTATION_RIGHT) { + clone.backupMesh.position.x += 0.5 * R3.CustomCode.BODY_SCALE_X; } if (clone.isTail) { @@ -1567,7 +1567,7 @@ GameLib.CustomCode.prototype.restore = function() { * Move the snake forward and do collision detection * @type {function(this:snakeEntityLoaded)} */ -GameLib.CustomCode.prototype.advanceSnake = function(delta) { +R3.CustomCode.prototype.advanceSnake = function(delta) { if (this.state.exploding) { return; @@ -1585,8 +1585,8 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { var temp = null; var advanced = false; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Move' } @@ -1634,7 +1634,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { this.grid ); - this.grid[backup.position.x][backup.position.y] = new GameLib.CustomCode.GameObject(); + this.grid[backup.position.x][backup.position.y] = new R3.CustomCode.GameObject(); if (!advanced) { @@ -1645,7 +1645,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { var gameObject = this.grid[body.position.x][body.position.y]; switch (gameObject.objectType) { - case GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY : + case R3.CustomCode.OBJECT_TYPE_SNAKE_BODY : if (!gameObject.isTail) { @@ -1657,20 +1657,20 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { body.backupMesh = body.mesh; - if (body.orientation === GameLib.CustomCode.ORIENTATION_UP) { - body.backupMesh.position.y -= 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (body.orientation === R3.CustomCode.ORIENTATION_UP) { + body.backupMesh.position.y -= 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (body.orientation === GameLib.CustomCode.ORIENTATION_DOWN) { - body.backupMesh.position.y += 0.5 * GameLib.CustomCode.BODY_SCALE_Y; + if (body.orientation === R3.CustomCode.ORIENTATION_DOWN) { + body.backupMesh.position.y += 0.5 * R3.CustomCode.BODY_SCALE_Y; } - if (body.orientation === GameLib.CustomCode.ORIENTATION_LEFT) { - body.backupMesh.position.x += 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (body.orientation === R3.CustomCode.ORIENTATION_LEFT) { + body.backupMesh.position.x += 0.5 * R3.CustomCode.BODY_SCALE_X; } - if (body.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { - body.backupMesh.position.x -= 0.5 * GameLib.CustomCode.BODY_SCALE_X; + if (body.orientation === R3.CustomCode.ORIENTATION_RIGHT) { + body.backupMesh.position.x -= 0.5 * R3.CustomCode.BODY_SCALE_X; } body.mesh = this.createGameMesh(this.materialBreadCorner); @@ -1699,10 +1699,10 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { } } break; - case GameLib.CustomCode.OBJECT_TYPE_FOOD : + case R3.CustomCode.OBJECT_TYPE_FOOD : this.extend(gameObject, backup.position, backup.orientation); break; - case GameLib.CustomCode.OBJECT_TYPE_POWERUP: + case R3.CustomCode.OBJECT_TYPE_POWERUP: this.powerup(gameObject); break; default: @@ -1752,7 +1752,7 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { * collision - in this case - don't reset this position since it belongs to the head */ } else { - this.grid[body.position.x][body.position.y] = new GameLib.CustomCode.GameObject(); + this.grid[body.position.x][body.position.y] = new R3.CustomCode.GameObject(); } /** @@ -1814,8 +1814,8 @@ GameLib.CustomCode.prototype.advanceSnake = function(delta) { }.bind(this); -GameLib.Event.Subscribe( - GameLib.Event.GAME_START, +R3.Event.Subscribe( + R3.Event.GAME_START, function() { this.state = { @@ -1834,8 +1834,8 @@ GameLib.Event.Subscribe( highscore : this.state.highscore }; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Techno BG Music' } @@ -1847,31 +1847,31 @@ GameLib.Event.Subscribe( this.snake = [ this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_HEAD, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_HEAD, { x : 3, y : 2 }, - GameLib.CustomCode.ORIENTATION_UP + R3.CustomCode.ORIENTATION_UP ), this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_PATTY, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_PATTY, { x : 3, y : 1 }, - GameLib.CustomCode.ORIENTATION_UP + R3.CustomCode.ORIENTATION_UP ), this.createGameObject( - GameLib.CustomCode.OBJECT_TYPE_SNAKE_BODY, - GameLib.CustomCode.BODY_TYPE_BREAD_TAIL, + R3.CustomCode.OBJECT_TYPE_SNAKE_BODY, + R3.CustomCode.BODY_TYPE_BREAD_TAIL, { x : 3, y : 0 }, - GameLib.CustomCode.ORIENTATION_UP + R3.CustomCode.ORIENTATION_UP ) ] @@ -1881,22 +1881,22 @@ GameLib.Event.Subscribe( * Other Settings */ this.advanceTime = 0; - this.speed = GameLib.CustomCode.SPEED_INITIAL; + this.speed = R3.CustomCode.SPEED_INITIAL; this.foodTime = 0; - this.foodSpeed = GameLib.CustomCode.FOOD_SPEED_INITIAL; + this.foodSpeed = R3.CustomCode.FOOD_SPEED_INITIAL; this.powerupTime = 0; - this.nextPowerupTime = GameLib.Utils.GetRandomIntInclusive( - GameLib.CustomCode.POWERUP_WAIT_TIME_MIN, - GameLib.CustomCode.POWERUP_WAIT_TIME_MAX + this.nextPowerupTime = R3.Utils.GetRandomIntInclusive( + R3.CustomCode.POWERUP_WAIT_TIME_MIN, + R3.CustomCode.POWERUP_WAIT_TIME_MAX ); this.explodeTime = 0; this.speedTimer = 0; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { type : 'game_start', state : this.state @@ -1928,8 +1928,8 @@ GameLib.Event.Subscribe( }.bind(this) ); -GameLib.Event.Subscribe( - GameLib.Event.GAME_OVER, +R3.Event.Subscribe( + R3.Event.GAME_OVER, function() { this.keyUp.initialized = false; @@ -1950,8 +1950,8 @@ GameLib.Event.Subscribe( this.touchStart.initialized = false; this.touchStart.entityLoaded = null; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { type : 'game_over', state : this.state @@ -1962,8 +1962,8 @@ GameLib.Event.Subscribe( }.bind(this) ) -GameLib.Event.Subscribe( - GameLib.Event.ENGINE_FIRED_PARTICLES_ZERO, +R3.Event.Subscribe( + R3.Event.ENGINE_FIRED_PARTICLES_ZERO, function(data) { if (data.component === this.particleEnginePickle) { this.particleEnginePickle.enabled = false; @@ -1972,8 +1972,8 @@ GameLib.Event.Subscribe( }.bind(this) ) -GameLib.Event.Subscribe( - GameLib.Event.GAME_DATA, +R3.Event.Subscribe( + R3.Event.GAME_DATA, function(data) { if (data.type === 'highscore') { this.state.highscore = data.highscore; @@ -1984,6 +1984,6 @@ GameLib.Event.Subscribe( this.displayHUD(); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js \ No newline at end of file diff --git a/2hq8ud34dj.js b/2hq8ud34dj.js index c9407ca..89e7d00 100644 --- a/2hq8ud34dj.js +++ b/2hq8ud34dj.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/2leaoar72c.js b/2leaoar72c.js index 83ba520..82678c4 100644 --- a/2leaoar72c.js +++ b/2leaoar72c.js @@ -4,18 +4,18 @@ var touches = Object.keys(data); /** * This code is rediculous - but it fixes the bug in ios where audio does not play */ -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); if (touches.length > 2) { - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); } else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/2oppg7ptas.js b/2oppg7ptas.js index 87de14d..2f48b1b 100644 --- a/2oppg7ptas.js +++ b/2oppg7ptas.js @@ -47,15 +47,15 @@ ig.module( } ); - GameLib.Event.Subscribe( - GameLib.Event.GAME_START, + R3.Event.Subscribe( + R3.Event.GAME_START, function(data) { - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); ig.main('1cvwv04mfw', Snake, 60, 720, 1280, 1 ); } ); - GameLib.Event.Emit(GameLib.Event.GAME_LOADED); + R3.Event.Emit(R3.Event.GAME_LOADED); }); diff --git a/2pqj50hpb4.js b/2pqj50hpb4.js index 90b5aee..2a60757 100644 --- a/2pqj50hpb4.js +++ b/2pqj50hpb4.js @@ -34,7 +34,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/2xswm1bwq8.js b/2xswm1bwq8.js index 8590b2c..f735ed9 100644 --- a/2xswm1bwq8.js +++ b/2xswm1bwq8.js @@ -5,55 +5,55 @@ if (data.entity === this.parentEntity) { /** * Custom Code Components */ -this.ccBeforeRender = GameLib.EntityManager.Instance.findComponentById('o4c478xpx3'); -this.ccKeyDown = GameLib.EntityManager.Instance.findComponentById('dgscoensvf'); -this.ccTouchStart = GameLib.EntityManager.Instance.findComponentById('xjaoh824ff'); -this.ccTouchEnd = GameLib.EntityManager.Instance.findComponentById('ohqwmnjfgf'); +this.ccBeforeRender = R3.EntityManager.Instance.findComponentById('o4c478xpx3'); +this.ccKeyDown = R3.EntityManager.Instance.findComponentById('dgscoensvf'); +this.ccTouchStart = R3.EntityManager.Instance.findComponentById('xjaoh824ff'); +this.ccTouchEnd = R3.EntityManager.Instance.findComponentById('ohqwmnjfgf'); /** * Images */ -this.image_0 = GameLib.EntityManager.Instance.findComponentById('gvrik6h4yd'); -this.image_1 = GameLib.EntityManager.Instance.findComponentById('ssdlmrpv9j'); -this.image_2 = GameLib.EntityManager.Instance.findComponentById('zdg2qpu35c'); -this.image_3 = GameLib.EntityManager.Instance.findComponentById('pjy42fg69n'); -this.image_4 = GameLib.EntityManager.Instance.findComponentById('5t3olr10pw'); -this.image_5 = GameLib.EntityManager.Instance.findComponentById('qrh0foyins'); -this.image_6 = GameLib.EntityManager.Instance.findComponentById('0bjbsj4sss'); -this.image_grid = GameLib.EntityManager.Instance.findComponentById('7yji3yzct9'); -this.image_glow = GameLib.EntityManager.Instance.findComponentById('aei9gfkjb6'); -this.image_flames_small = GameLib.EntityManager.Instance.findComponentById('vp4zkbx7yr'); +this.image_0 = R3.EntityManager.Instance.findComponentById('gvrik6h4yd'); +this.image_1 = R3.EntityManager.Instance.findComponentById('ssdlmrpv9j'); +this.image_2 = R3.EntityManager.Instance.findComponentById('zdg2qpu35c'); +this.image_3 = R3.EntityManager.Instance.findComponentById('pjy42fg69n'); +this.image_4 = R3.EntityManager.Instance.findComponentById('5t3olr10pw'); +this.image_5 = R3.EntityManager.Instance.findComponentById('qrh0foyins'); +this.image_6 = R3.EntityManager.Instance.findComponentById('0bjbsj4sss'); +this.image_grid = R3.EntityManager.Instance.findComponentById('7yji3yzct9'); +this.image_glow = R3.EntityManager.Instance.findComponentById('aei9gfkjb6'); +this.image_flames_small = R3.EntityManager.Instance.findComponentById('vp4zkbx7yr'); /** * Scene */ -this.scene = GameLib.EntityManager.Instance.findComponentById('i1ac678a5d'); +this.scene = R3.EntityManager.Instance.findComponentById('i1ac678a5d'); /** * Materials */ -this.gridMaterial = GameLib.EntityManager.Instance.findComponentById('1tp9zqjo6s'); +this.gridMaterial = R3.EntityManager.Instance.findComponentById('1tp9zqjo6s'); /** * Score */ -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('85d0jk6dhx'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('kva68t4dm8'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('85d0jk6dhx'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('kva68t4dm8'); /** * Animations */ -this.animation = GameLib.EntityManager.Instance.findComponentById('tnlwgvf12x'); +this.animation = R3.EntityManager.Instance.findComponentById('tnlwgvf12x'); /** * Lights */ -this.burnLight = GameLib.EntityManager.Instance.findComponentById('q13y5xwv6c'); +this.burnLight = R3.EntityManager.Instance.findComponentById('q13y5xwv6c'); /** * Textures */ -this.textureDisplacement = GameLib.EntityManager.Instance.findComponentById('b0du0xqeeu'); +this.textureDisplacement = R3.EntityManager.Instance.findComponentById('b0du0xqeeu'); /** * Initial Game Settings @@ -68,24 +68,24 @@ this.grid = []; this.gameOver = false; -GameLib.CustomCode.TETRIS_BLOCK_I = 0; -GameLib.CustomCode.TETRIS_BLOCK_L = 1; -GameLib.CustomCode.TETRIS_BLOCK_L2 = 2; -GameLib.CustomCode.TETRIS_BLOCK_Z = 3; -GameLib.CustomCode.TETRIS_BLOCK_Z2 = 4; -GameLib.CustomCode.TETRIS_BLOCK_T = 5; -GameLib.CustomCode.TETRIS_BLOCK_O = 6; -GameLib.CustomCode.TETRIS_BLOCK_MAX = 7; +R3.CustomCode.TETRIS_BLOCK_I = 0; +R3.CustomCode.TETRIS_BLOCK_L = 1; +R3.CustomCode.TETRIS_BLOCK_L2 = 2; +R3.CustomCode.TETRIS_BLOCK_Z = 3; +R3.CustomCode.TETRIS_BLOCK_Z2 = 4; +R3.CustomCode.TETRIS_BLOCK_T = 5; +R3.CustomCode.TETRIS_BLOCK_O = 6; +R3.CustomCode.TETRIS_BLOCK_MAX = 7; -GameLib.CustomCode.TETRIS_GRID_WIDTH = 11; -GameLib.CustomCode.TETRIS_GRID_HEIGHT = 24; -GameLib.CustomCode.TETRIS_GRID_HEADSPACE = 4; +R3.CustomCode.TETRIS_GRID_WIDTH = 11; +R3.CustomCode.TETRIS_GRID_HEIGHT = 24; +R3.CustomCode.TETRIS_GRID_HEADSPACE = 4; -GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; -GameLib.CustomCode.TETRIS_GRID_TAKEN = 1; -GameLib.CustomCode.TETRIS_GRID_DISAPPEARING = 2; +R3.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; +R3.CustomCode.TETRIS_GRID_TAKEN = 1; +R3.CustomCode.TETRIS_GRID_DISAPPEARING = 2; -GameLib.CustomCode.prototype.visualizeGrid = function (color) { +R3.CustomCode.prototype.visualizeGrid = function (color) { if (this.starsMesh) { this.scene.instance.remove(this.starsMesh); @@ -95,7 +95,7 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { for (var y = 0; y < this.grid.length; y++) { for (var x = 0; x < this.grid[y].length; x++) { - if (this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { this.starsGeometry.vertices.push( new THREE.Vector3( x, @@ -115,9 +115,9 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { }.bind(this) -GameLib.CustomCode.prototype.startAnimation = function (index) { +R3.CustomCode.prototype.startAnimation = function (index) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { var bacon = this.tile_bacon_disappearing.clone(); @@ -142,7 +142,7 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { glow.updateInstance('visible'); glow.position.y = index; - glow.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + glow.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; glow.position.z = 4; glow.updateInstance('position'); @@ -152,7 +152,7 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { flames.updateInstance('visible'); flames.position.y = index + 0.5; - flames.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + flames.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; flames.position.z = 5; flames.updateInstance('position'); @@ -164,8 +164,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { time: 0 } - animationObject.subscription = GameLib.Event.Subscribe( - GameLib.Event.BEFORE_RENDER, + animationObject.subscription = R3.Event.Subscribe( + R3.Event.BEFORE_RENDER, function (__animationObject) { return function (data) { __animationObject.time += data.delta * 4; @@ -197,15 +197,15 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { this.burnLight.intensity = 0; this.burnLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: __animationObject.glow } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: __animationObject.flames } @@ -216,8 +216,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { */ __animationObject.flamesArray.map( function (flame) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: flame } @@ -228,21 +228,21 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { /** * Remove the meshes and the baconDisappearing objects */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (!this.grid[__animationObject.rowNumber][x].mesh) { throw new Error('mesh should exist but does not'); } - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[__animationObject.rowNumber][x].mesh } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[__animationObject.rowNumber][x].baconDisappearing } @@ -257,10 +257,10 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { var row = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { row.push( { - value: GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value: R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh: null } ) @@ -271,8 +271,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { /** * Now - drop all blocks above the current index down one row */ - for (var y = __animationObject.rowNumber; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = __animationObject.rowNumber; y < R3.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (this.grid[y][x].mesh) { this.grid[y][x].mesh.position.y = y; @@ -328,18 +328,18 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { this.animationObjects.push(animationObject); }.bind(this) -GameLib.CustomCode.prototype.removeLines = function () { +R3.CustomCode.prototype.removeLines = function () { var indices = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { var line = true; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN || - this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING + this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_NOT_TAKEN || + this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING ) { line = false; } @@ -448,8 +448,8 @@ GameLib.CustomCode.prototype.removeLines = function () { indices.map( function (index) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { - this.grid[index][x].value = GameLib.CustomCode.TETRIS_GRID_DISAPPEARING; + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { + this.grid[index][x].value = R3.CustomCode.TETRIS_GRID_DISAPPEARING; } this.startAnimation(index); }.bind(this) @@ -458,7 +458,7 @@ GameLib.CustomCode.prototype.removeLines = function () { }.bind(this); -GameLib.CustomCode.prototype.drawStatus = function () { +R3.CustomCode.prototype.drawStatus = function () { var context = this.scoreCanvas.instance.getContext('2d'); context.textBaseline = "middle"; @@ -533,7 +533,7 @@ GameLib.CustomCode.prototype.drawStatus = function () { this.scoreTexture.instance.needsUpdate = true; }.bind(this) -GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { +R3.CustomCode.prototype.getBlockGridPositions = function (block) { var object = new THREE.Mesh(); @@ -583,7 +583,7 @@ GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { }.bind(this); -GameLib.CustomCode.prototype.drawGrid = function () { +R3.CustomCode.prototype.drawGrid = function () { var geometry = new THREE.PlaneBufferGeometry(); @@ -592,8 +592,8 @@ GameLib.CustomCode.prototype.drawGrid = function () { this.gridMaterial.instance ); - for (var y = 0; y < (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE); y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = 0; y < (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE); y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { var clone = mesh.clone(); @@ -610,7 +610,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { geometry.vertices.push( new THREE.Vector3( -0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ), new THREE.Vector3( @@ -619,13 +619,13 @@ GameLib.CustomCode.prototype.drawGrid = function () { 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, -0.5, 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ) ); @@ -645,7 +645,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { }.bind(this) -GameLib.CustomCode.prototype.checkBoundaries = function (block) { +R3.CustomCode.prototype.checkBoundaries = function (block) { /** * collisions are true only for out of bounds indexes, and if the current block is taken @@ -669,7 +669,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { leftHit = true; } - if (position.x === (GameLib.CustomCode.TETRIS_GRID_WIDTH - 1)) { + if (position.x === (R3.CustomCode.TETRIS_GRID_WIDTH - 1)) { rightHit = true; } @@ -677,7 +677,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { bottomHit = true; } - if (position.y === (GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1)) { + if (position.y === (R3.CustomCode.TETRIS_GRID_HEIGHT - 1)) { topHit = true; } @@ -688,7 +688,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.x >= GameLib.CustomCode.TETRIS_GRID_WIDTH) { + if (position.x >= R3.CustomCode.TETRIS_GRID_WIDTH) { collision = true; } @@ -696,7 +696,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.y >= GameLib.CustomCode.TETRIS_GRID_HEIGHT) { + if (position.y >= R3.CustomCode.TETRIS_GRID_HEIGHT) { collision = true; } @@ -705,14 +705,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * be sure x+1 is inside bounds */ if ( - ((position.x + 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) && + ((position.x + 1) < R3.CustomCode.TETRIS_GRID_WIDTH) && ((position.x + 1) >= 0) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.grid[position.y][position.x + 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.grid[position.y][position.x + 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - we found a block to the right - its over */ @@ -728,14 +728,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.x) > 0) && ((position.x - 1) >= 0) && - ((position.x - 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) + ((position.x - 1) < R3.CustomCode.TETRIS_GRID_WIDTH) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.grid[position.y][position.x - 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.grid[position.y][position.x - 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * We found a block to the left - its over also */ @@ -748,15 +748,15 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * Now we want to see if the block above is taken, we cannot be sure y+1 is inside bounds */ if ( - ((position.y + 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) && + ((position.y + 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) && ((position.y + 1) >= 0) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.grid[position.y + 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[position.y + 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block is at the top */ @@ -771,20 +771,20 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.y) > 0) && ((position.y - 1) >= 0) && - ((position.y - 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) + ((position.y - 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (this.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block hit bottom */ bottomHit = true; } - if (this.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING) { + if (this.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING) { bottomDisappearing = true; } } @@ -795,10 +795,10 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * we cannot be sure, x and y is inside bounds */ if ( - (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && - (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) + (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && + (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) ) { - if (this.grid[position.y][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[position.y][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { collision = true; } } @@ -816,7 +816,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { }.bind(this) -GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { +R3.CustomCode.prototype.rotateBlock = function (clockwise) { if (this.gameOver) { return; @@ -865,9 +865,9 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { }.bind(this); -GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { +R3.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { - if (GameLib.Utils.UndefinedOrNull(block)) { + if (R3.Utils.UndefinedOrNull(block)) { block = this.block; } @@ -934,7 +934,7 @@ GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, coll return moved; }.bind(this); -GameLib.CustomCode.prototype.spawnBlock = function () { +R3.CustomCode.prototype.spawnBlock = function () { var blockType = Math.floor(Math.random() * 7); @@ -961,7 +961,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { center.position.x = 0; center.position.z = 3.5; - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_I) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_I) { mesh0 = this.tile_4.clone(); mesh0.position.setFrom(center.position); @@ -993,7 +993,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.5; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1025,7 +1025,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L2) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1057,7 +1057,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1088,7 +1088,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z2) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); @@ -1120,7 +1120,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_T) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_T) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1150,7 +1150,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 16; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_O) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_O) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1241,7 +1241,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { }.bind(this) -GameLib.CustomCode.prototype.spawnTinyBlock = function () { +R3.CustomCode.prototype.spawnTinyBlock = function () { var block = this.spawnBlock(); @@ -1264,7 +1264,7 @@ GameLib.CustomCode.prototype.spawnTinyBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnNextBlock = function () { +R3.CustomCode.prototype.spawnNextBlock = function () { if (!this.tinyBlock) { this.tinyBlock = this.spawnTinyBlock(); @@ -1287,7 +1287,7 @@ GameLib.CustomCode.prototype.spawnNextBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnBigBlock = function () { +R3.CustomCode.prototype.spawnBigBlock = function () { if (!this.nextBlock) { this.nextBlock = this.spawnNextBlock(); @@ -1303,8 +1303,8 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { block.center.position.x = 0; block.center.position.y = 0; block.center.position.z = 2.5; - this.moveBlock(block, {up: true}, (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE), false); - this.moveBlock(block, {right: true}, GameLib.CustomCode.TETRIS_GRID_WIDTH / 2, false); + this.moveBlock(block, {up: true}, (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE), false); + this.moveBlock(block, {right: true}, R3.CustomCode.TETRIS_GRID_WIDTH / 2, false); this.moveBlock(block, {left: true}, block.offset.x, false); this.moveBlock(block, {down: true}, block.offset.y, false); block.center.updateInstance('position'); @@ -1314,12 +1314,12 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.getNextBlock = function () { +R3.CustomCode.prototype.getNextBlock = function () { this.block = this.spawnBigBlock(); - GameLib.Event.Emit( - GameLib.Event.COMPONENT_REGISTER, + R3.Event.Emit( + R3.Event.COMPONENT_REGISTER, { component: this.block.center } @@ -1332,7 +1332,7 @@ GameLib.CustomCode.prototype.getNextBlock = function () { /** * This code executes when the 'bottom' has been reached (the block is stopping) */ -GameLib.CustomCode.prototype.stopBlock = function() { +R3.CustomCode.prototype.stopBlock = function() { var gridPositions = this.getBlockGridPositions(this.block); @@ -1353,7 +1353,7 @@ GameLib.CustomCode.prototype.stopBlock = function() { } block = { - value : GameLib.CustomCode.TETRIS_GRID_TAKEN, + value : R3.CustomCode.TETRIS_GRID_TAKEN, mesh : position.mesh, baconDisappearing : null } @@ -1388,8 +1388,8 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * We remove the controlling block */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -1405,13 +1405,13 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * Check if the game is over */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[19][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[20][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[21][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[22][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[23][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN + this.grid[19][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[20][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[21][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[22][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[23][x].value === R3.CustomCode.TETRIS_GRID_TAKEN ) { this.gameOver = true; } @@ -1422,8 +1422,8 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * End the game if game over */ - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { score: this.score, level: this.level, @@ -1444,7 +1444,7 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * Clears the grid */ -GameLib.CustomCode.prototype.clearGrid = function() { +R3.CustomCode.prototype.clearGrid = function() { /** * Remove all stale components (if any) @@ -1470,11 +1470,11 @@ GameLib.CustomCode.prototype.clearGrid = function() { * Initialize the grid */ this.grid = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { this.grid[y] = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { this.grid[y][x] = { - value : GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value : R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh : null, baconDisappearing : null }; @@ -1483,13 +1483,13 @@ GameLib.CustomCode.prototype.clearGrid = function() { }.bind(this) -GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) { +R3.CustomCode.prototype.createTile = function(tileName, imageName, displace) { var apiMaterial; if (imageName) { if (displace) { - apiMaterial = new GameLib.D3.API.Material.Phong( + apiMaterial = new R3.D3.API.Material.Phong( null, null, null, @@ -1507,13 +1507,13 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace null, null, null, - new GameLib.D3.API.Texture.Image( + new R3.D3.API.Texture.Image( null, this[imageName] ) ) } else { - apiMaterial = new GameLib.D3.API.Material.Phong( + apiMaterial = new R3.D3.API.Material.Phong( null, null, null, @@ -1531,21 +1531,21 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace null, null, null, - new GameLib.D3.API.Texture.Image( + new R3.D3.API.Texture.Image( null, this[imageName] ) ) } } else { - apiMaterial = new GameLib.D3.API.Material.Phong(); + apiMaterial = new R3.D3.API.Material.Phong(); } - this[tileName] = new GameLib.D3.Mesh( + this[tileName] = new R3.D3.Mesh( this.graphics, - new GameLib.D3.API.Mesh( + new R3.D3.API.Mesh( null, - new GameLib.D3.API.Geometry.Buffer.Plane( + new R3.D3.API.Geometry.Buffer.Plane( null, 1, 1, @@ -1570,8 +1570,8 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace }.bind(this); -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function () { @@ -1597,8 +1597,8 @@ GameLib.Event.Subscribe( if (this.block && this.block.center) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -1608,8 +1608,8 @@ GameLib.Event.Subscribe( if (this.block && this.block.meshes) { this.block.meshes.map( function (mesh) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: mesh } @@ -1646,8 +1646,8 @@ GameLib.Event.Subscribe( }.bind(this) ); -GameLib.Event.Emit( - GameLib.Event.GET_RUNTIME, +R3.Event.Emit( + R3.Event.GET_RUNTIME, {}, function(runtime) { @@ -1701,9 +1701,9 @@ GameLib.Event.Emit( this.drawGrid(); this.drawStatus(); - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, GameLib.Utils.GetWindowSize()); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, R3.Utils.GetWindowSize()); - GameLib.Event.Emit(GameLib.Event.GAME_LOADED); + R3.Event.Emit(R3.Event.GAME_LOADED); }.bind(this) ) diff --git a/306204wy29.js b/306204wy29.js index fd64dd5..46fb221 100644 --- a/306204wy29.js +++ b/306204wy29.js @@ -9,8 +9,8 @@ if (!this.initialized) { this.initialized = true; } -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Click' } @@ -21,11 +21,11 @@ if (this.state.turning) { return; } -if (data.keyCode === GameLib.System.Input.KEY_UP) { +if (data.keyCode === R3.System.Input.KEY_UP) { if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_UP || - this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN + this.state.orientation === R3.CustomCode.ORIENTATION_UP || + this.state.orientation === R3.CustomCode.ORIENTATION_DOWN ) { /** * The snake is moving up or down - do nothing @@ -34,25 +34,25 @@ if (data.keyCode === GameLib.System.Input.KEY_UP) { } if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_LEFT || - this.state.orientation === GameLib.CustomCode.ORIENTATION_RIGHT + this.state.orientation === R3.CustomCode.ORIENTATION_LEFT || + this.state.orientation === R3.CustomCode.ORIENTATION_RIGHT ) { - if (this.state.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { + if (this.state.orientation === R3.CustomCode.ORIENTATION_RIGHT) { this.state.flip = 0; } else { this.state.flip = -1; } - this.state.orientation = GameLib.CustomCode.ORIENTATION_UP; + this.state.orientation = R3.CustomCode.ORIENTATION_UP; this.state.turning = true; } } -if (data.keyCode === GameLib.System.Input.KEY_DOWN) { +if (data.keyCode === R3.System.Input.KEY_DOWN) { if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_UP || - this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN + this.state.orientation === R3.CustomCode.ORIENTATION_UP || + this.state.orientation === R3.CustomCode.ORIENTATION_DOWN ) { /** * The snake is moving up or down - do nothing @@ -61,24 +61,24 @@ if (data.keyCode === GameLib.System.Input.KEY_DOWN) { } if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_LEFT || - this.state.orientation === GameLib.CustomCode.ORIENTATION_RIGHT + this.state.orientation === R3.CustomCode.ORIENTATION_LEFT || + this.state.orientation === R3.CustomCode.ORIENTATION_RIGHT ) { - if (this.state.orientation === GameLib.CustomCode.ORIENTATION_RIGHT) { + if (this.state.orientation === R3.CustomCode.ORIENTATION_RIGHT) { this.state.flip = -1; } else { this.state.flip = 0; } - this.state.orientation = GameLib.CustomCode.ORIENTATION_DOWN; + this.state.orientation = R3.CustomCode.ORIENTATION_DOWN; this.state.turning = true; } } -if (data.keyCode === GameLib.System.Input.KEY_LEFT) { +if (data.keyCode === R3.System.Input.KEY_LEFT) { if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_LEFT || - this.state.orientation === GameLib.CustomCode.ORIENTATION_RIGHT + this.state.orientation === R3.CustomCode.ORIENTATION_LEFT || + this.state.orientation === R3.CustomCode.ORIENTATION_RIGHT ) { /** * The snake is moving up or down - do nothing @@ -87,25 +87,25 @@ if (data.keyCode === GameLib.System.Input.KEY_LEFT) { } if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_UP || - this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN + this.state.orientation === R3.CustomCode.ORIENTATION_UP || + this.state.orientation === R3.CustomCode.ORIENTATION_DOWN ) { - if (this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN) { + if (this.state.orientation === R3.CustomCode.ORIENTATION_DOWN) { this.state.flip = -1; } else { this.state.flip = 0; } - this.state.orientation = GameLib.CustomCode.ORIENTATION_LEFT; + this.state.orientation = R3.CustomCode.ORIENTATION_LEFT; this.state.turning = true; } } -if (data.keyCode === GameLib.System.Input.KEY_RIGHT) { +if (data.keyCode === R3.System.Input.KEY_RIGHT) { if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_LEFT || - this.state.orientation === GameLib.CustomCode.ORIENTATION_RIGHT + this.state.orientation === R3.CustomCode.ORIENTATION_LEFT || + this.state.orientation === R3.CustomCode.ORIENTATION_RIGHT ) { /** * The snake is moving up or down - do nothing @@ -114,17 +114,17 @@ if (data.keyCode === GameLib.System.Input.KEY_RIGHT) { } if ( - this.state.orientation === GameLib.CustomCode.ORIENTATION_UP || - this.state.orientation === GameLib.CustomCode.ORIENTATION_DOWN + this.state.orientation === R3.CustomCode.ORIENTATION_UP || + this.state.orientation === R3.CustomCode.ORIENTATION_DOWN ) { - if (this.state.orientation === GameLib.CustomCode.ORIENTATION_UP) { + if (this.state.orientation === R3.CustomCode.ORIENTATION_UP) { this.state.flip = -1; } else { this.state.flip = 0; } - this.state.orientation = GameLib.CustomCode.ORIENTATION_RIGHT; + this.state.orientation = R3.CustomCode.ORIENTATION_RIGHT; this.state.turning = true; } } diff --git a/3b588t2jz1.js b/3b588t2jz1.js index 4ea9a75..5a8dbad 100644 --- a/3b588t2jz1.js +++ b/3b588t2jz1.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } @@ -10,8 +10,8 @@ var units = Math.floor(max / 150) + 1; if (typeof max === 'number') { if (max < 5) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -20,8 +20,8 @@ if (typeof max === 'number') { if (max === touch.left) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowLeft' } @@ -31,8 +31,8 @@ if (typeof max === 'number') { if (max === touch.right) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowRight' } @@ -41,8 +41,8 @@ if (typeof max === 'number') { } if (max === touch.up) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -50,8 +50,8 @@ if (typeof max === 'number') { } if (max === touch.down) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'Space' } diff --git a/3csgf2ng51.js b/3csgf2ng51.js index 74d035e..ff850af 100644 --- a/3csgf2ng51.js +++ b/3csgf2ng51.js @@ -7,16 +7,16 @@ if (data.entity === this.parentEntity) { /** * Custom Code Components */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('m0ee24mqoy'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('sossh1zbtq'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('m0ee24mqoy'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('sossh1zbtq'); /** * Meshes */ -this.road = GameLib.EntityManager.Instance.findComponentById('zhrnmn1spo'); -this.snail = GameLib.EntityManager.Instance.findComponentById('q7jfofpn27'); -this.cloud = GameLib.EntityManager.Instance.findComponentById('78z72xqfhg'); -this.solar = GameLib.EntityManager.Instance.findComponentById('1rqrv0u18w'); +this.road = R3.EntityManager.Instance.findComponentById('zhrnmn1spo'); +this.snail = R3.EntityManager.Instance.findComponentById('q7jfofpn27'); +this.cloud = R3.EntityManager.Instance.findComponentById('78z72xqfhg'); +this.solar = R3.EntityManager.Instance.findComponentById('1rqrv0u18w'); /** * Activate our custom code components diff --git a/3hydxnm019.js b/3hydxnm019.js index c28a0bf..d4a434e 100644 --- a/3hydxnm019.js +++ b/3hydxnm019.js @@ -4,5 +4,5 @@ if (!this.entityLoaded) { data.event.preventDefault(); -GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +R3.Event.Emit(R3.Event.MOUSE_DOWN); //@ sourceURL=SpoonLibTouchStart.js \ No newline at end of file diff --git a/3u4ivhvl08.js b/3u4ivhvl08.js index a72560d..778a90a 100644 --- a/3u4ivhvl08.js +++ b/3u4ivhvl08.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/3w66vzyd6a.js b/3w66vzyd6a.js index 38aae4b..ec70001 100644 --- a/3w66vzyd6a.js +++ b/3w66vzyd6a.js @@ -34,7 +34,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/42igil3g39.js b/42igil3g39.js index 6440feb..8d6251c 100644 --- a/42igil3g39.js +++ b/42igil3g39.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/4jubz9thqn.js b/4jubz9thqn.js index b4e3314..72686d4 100644 --- a/4jubz9thqn.js +++ b/4jubz9thqn.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -24,8 +24,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -33,7 +33,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -43,12 +43,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 4); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 4); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; @@ -75,15 +75,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -166,8 +166,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/4sjzwfvciu.js b/4sjzwfvciu.js index 6eb7909..ad83123 100644 --- a/4sjzwfvciu.js +++ b/4sjzwfvciu.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/4uuloos87b.js b/4uuloos87b.js index fe66f0c..9dcc8fb 100644 --- a/4uuloos87b.js +++ b/4uuloos87b.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/4ylf5b2dne.js b/4ylf5b2dne.js index a72560d..778a90a 100644 --- a/4ylf5b2dne.js +++ b/4ylf5b2dne.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/4ysd7umn4c.js b/4ysd7umn4c.js index 83ba520..82678c4 100644 --- a/4ysd7umn4c.js +++ b/4ysd7umn4c.js @@ -4,18 +4,18 @@ var touches = Object.keys(data); /** * This code is rediculous - but it fixes the bug in ios where audio does not play */ -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); if (touches.length > 2) { - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); } else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/4zoi8d3gzl.js b/4zoi8d3gzl.js index fe66f0c..9dcc8fb 100644 --- a/4zoi8d3gzl.js +++ b/4zoi8d3gzl.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/53069a21r6.js b/53069a21r6.js index 1c1035b..a1afd33 100644 --- a/53069a21r6.js +++ b/53069a21r6.js @@ -9,62 +9,62 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('egi5ucb47x') -this.bull = GameLib.EntityManager.Instance.findComponentById('ajxhp7crsw'); -this.star = GameLib.EntityManager.Instance.findComponentById('jd8luy8ukf'); -this.burger = GameLib.EntityManager.Instance.findComponentById('t9gccby15c'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('nsb0ovbowz'); -this.santa = GameLib.EntityManager.Instance.findComponentById('ylbblk3m8p'); -this.camera = GameLib.EntityManager.Instance.findComponentById('mir63dwhcx'); -this.scene = GameLib.EntityManager.Instance.findComponentById('p9wx7voskb'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('ee12wegj0n'); +this.fog = R3.EntityManager.Instance.findComponentById('egi5ucb47x') +this.bull = R3.EntityManager.Instance.findComponentById('ajxhp7crsw'); +this.star = R3.EntityManager.Instance.findComponentById('jd8luy8ukf'); +this.burger = R3.EntityManager.Instance.findComponentById('t9gccby15c'); +this.parcel = R3.EntityManager.Instance.findComponentById('nsb0ovbowz'); +this.santa = R3.EntityManager.Instance.findComponentById('ylbblk3m8p'); +this.camera = R3.EntityManager.Instance.findComponentById('mir63dwhcx'); +this.scene = R3.EntityManager.Instance.findComponentById('p9wx7voskb'); +this.cursor = R3.EntityManager.Instance.findComponentById('ee12wegj0n'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('v3c2uuu1m8'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('s9m206ikt8'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('89auo5pzns'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('goosyb14fk'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('8moboyxc2i'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('loxh9dc2mq'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('tnjyooogkp'); +this.thrower = R3.EntityManager.Instance.findComponentById('v3c2uuu1m8'); +this.renderer = R3.EntityManager.Instance.findComponentById('s9m206ikt8'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('89auo5pzns'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('goosyb14fk'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('8moboyxc2i'); +this.stone1 = R3.EntityManager.Instance.findComponentById('loxh9dc2mq'); +this.stone2 = R3.EntityManager.Instance.findComponentById('tnjyooogkp'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('qnqdunn3l2'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('nd0k4edyji'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('sre34rw4xj'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('j3a7fbtmw6'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('qnqdunn3l2'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('nd0k4edyji'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('sre34rw4xj'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('j3a7fbtmw6'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('pxcqbyldn'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('pxcqbyldn'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('srto11uc87'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('srto11uc87'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('3r8p0iuc30'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('3r8p0iuc30'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('kjk2zqtnf'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('kjk2zqtnf'); this.mouseMove.entityLoaded = this; -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); /** * Plant all our trees - Below code gets generated automatically diff --git a/56if6ltmvm.js b/56if6ltmvm.js index 20fa1bc..0de8156 100644 --- a/56if6ltmvm.js +++ b/56if6ltmvm.js @@ -23,7 +23,7 @@ var codeSnippet = function(type, rotation, scale, position) { var code = ''; -var meshes = GameLib.EntityManager.Instance.queryComponents(GameLib.D3.Mesh); +var meshes = R3.EntityManager.Instance.queryComponents(R3.D3.Mesh); meshes.map( function(mesh) { diff --git a/5k47kxoa29.js b/5k47kxoa29.js index dfa9dbe..1214f70 100644 --- a/5k47kxoa29.js +++ b/5k47kxoa29.js @@ -9,67 +9,67 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('2wgl4d7uch') -this.bull = GameLib.EntityManager.Instance.findComponentById('aqu0o39q3g'); -this.star = GameLib.EntityManager.Instance.findComponentById('ucaqp8rzty'); -this.burger = GameLib.EntityManager.Instance.findComponentById('r8ztuba1ni'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('ai3o44wd0a'); -this.santa = GameLib.EntityManager.Instance.findComponentById('kcp1y8q5p7'); -this.camera = GameLib.EntityManager.Instance.findComponentById('48qet53m86'); -this.scene = GameLib.EntityManager.Instance.findComponentById('3nolkbbc7j'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('gkkoz2irxe'); -this.dom = GameLib.EntityManager.Instance.findComponentById('bagyiej8o9'); +this.fog = R3.EntityManager.Instance.findComponentById('2wgl4d7uch') +this.bull = R3.EntityManager.Instance.findComponentById('aqu0o39q3g'); +this.star = R3.EntityManager.Instance.findComponentById('ucaqp8rzty'); +this.burger = R3.EntityManager.Instance.findComponentById('r8ztuba1ni'); +this.parcel = R3.EntityManager.Instance.findComponentById('ai3o44wd0a'); +this.santa = R3.EntityManager.Instance.findComponentById('kcp1y8q5p7'); +this.camera = R3.EntityManager.Instance.findComponentById('48qet53m86'); +this.scene = R3.EntityManager.Instance.findComponentById('3nolkbbc7j'); +this.cursor = R3.EntityManager.Instance.findComponentById('gkkoz2irxe'); +this.dom = R3.EntityManager.Instance.findComponentById('bagyiej8o9'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('4mkwbx1vku'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('w176oinkdw'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('7tovvhn9qf'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('doum0joyd1'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('uhl0lar6qn'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('jnlpuzn81z'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('i6ysiguhsh'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('81wsdpbgut'); +this.renderer = R3.EntityManager.Instance.findComponentById('4mkwbx1vku'); +this.thrower = R3.EntityManager.Instance.findComponentById('w176oinkdw'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('7tovvhn9qf'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('doum0joyd1'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('uhl0lar6qn'); +this.stone1 = R3.EntityManager.Instance.findComponentById('jnlpuzn81z'); +this.stone2 = R3.EntityManager.Instance.findComponentById('i6ysiguhsh'); +this.kanister = R3.EntityManager.Instance.findComponentById('81wsdpbgut'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('wn2mdb2orv'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('2vhyv0dz59'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('u50c6rjo5o'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('2yex7s9vhe'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('yfu1ilad2y'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('l050l1fbi9'); +this.leftLight = R3.EntityManager.Instance.findComponentById('wn2mdb2orv'); +this.rightLight = R3.EntityManager.Instance.findComponentById('2vhyv0dz59'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('u50c6rjo5o'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('2yex7s9vhe'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('yfu1ilad2y'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('l050l1fbi9'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('0og8p6ts36'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('3kyiu5cokv'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('z4pucpscf3'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('uatorrbo9e'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('8anoe7g9or'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('0og8p6ts36'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('3kyiu5cokv'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('z4pucpscf3'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('uatorrbo9e'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('8anoe7g9or'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('oapz1hoxki'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('oapz1hoxki'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('6rskhzgjog'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('vinuf6amoi'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('o3xmefbbln'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('kbn8blxfe5'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('cnn8o15h2g'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('6rskhzgjog'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('vinuf6amoi'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('o3xmefbbln'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('kbn8blxfe5'); +this.touchMove = R3.EntityManager.Instance.findComponentById('cnn8o15h2g'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -84,8 +84,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -96,7 +96,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -1074,6 +1074,6 @@ mesh.updateInstance('position'); mesh.updateInstance('rotation'); mesh.updateInstance('scale'); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/5vrq8rxgse.js b/5vrq8rxgse.js index 5bbdbc4..fb59870 100644 --- a/5vrq8rxgse.js +++ b/5vrq8rxgse.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -var particleEngine = GameLib.EntityManager.Instance.findComponentById('xcnso20er9'); +var particleEngine = R3.EntityManager.Instance.findComponentById('xcnso20er9'); particleEngine.enabled = false; diff --git a/5y364zgu7r.js b/5y364zgu7r.js index fde585c..8c1444e 100644 --- a/5y364zgu7r.js +++ b/5y364zgu7r.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/5zvl0zbox2.js b/5zvl0zbox2.js index fe66f0c..9dcc8fb 100644 --- a/5zvl0zbox2.js +++ b/5zvl0zbox2.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/60mpr5snmo.js b/60mpr5snmo.js index efe0d04..732930f 100644 --- a/60mpr5snmo.js +++ b/60mpr5snmo.js @@ -1,32 +1,32 @@ if (this.parentEntity === data.entity) { console.log('Entity SpoonLib Loaded'); - this.animationSystem = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION)[0]; + this.animationSystem = R3.EntityManager.Instance.queryComponents(R3.Component.SYSTEM_ANIMATION)[0]; - this.beforeRender = GameLib.EntityManager.Instance.findComponentById('uou2i9be9r'); + this.beforeRender = R3.EntityManager.Instance.findComponentById('uou2i9be9r'); - this.touchStart = GameLib.EntityManager.Instance.findComponentById('9m43m5angb'); - this.touchMove = GameLib.EntityManager.Instance.findComponentById('ktf4wzckvh'); - this.touchEnd = GameLib.EntityManager.Instance.findComponentById('r17o00dvgo'); + this.touchStart = R3.EntityManager.Instance.findComponentById('9m43m5angb'); + this.touchMove = R3.EntityManager.Instance.findComponentById('ktf4wzckvh'); + this.touchEnd = R3.EntityManager.Instance.findComponentById('r17o00dvgo'); - this.mouseUp = GameLib.EntityManager.Instance.findComponentById('abw1ga2etc'); - this.mouseDown = GameLib.EntityManager.Instance.findComponentById('f3b90qedii'); - this.mouseWheel = GameLib.EntityManager.Instance.findComponentById('opxis1pjmo'); - this.mouseMove = GameLib.EntityManager.Instance.findComponentById('arswdj0syh'); + this.mouseUp = R3.EntityManager.Instance.findComponentById('abw1ga2etc'); + this.mouseDown = R3.EntityManager.Instance.findComponentById('f3b90qedii'); + this.mouseWheel = R3.EntityManager.Instance.findComponentById('opxis1pjmo'); + this.mouseMove = R3.EntityManager.Instance.findComponentById('arswdj0syh'); - this.cylinder = GameLib.EntityManager.Instance.findComponentById('xtnu5j78bq'); + this.cylinder = R3.EntityManager.Instance.findComponentById('xtnu5j78bq'); - this.keyUp = GameLib.EntityManager.Instance.findComponentById('opxis1pjmo'); - this.camera = GameLib.EntityManager.Instance.findComponentById('32sdim4koy'); - this.textCanvas = GameLib.EntityManager.Instance.findComponentById('c8tk5ha6nw'); - this.textTexture = GameLib.EntityManager.Instance.findComponentById('eprfl2ynkx'); - this.particleEngine = GameLib.EntityManager.Instance.findComponentById('l60d7ra270'); - this.particle = GameLib.EntityManager.Instance.findComponentById('mvo0gyajun'); + this.keyUp = R3.EntityManager.Instance.findComponentById('opxis1pjmo'); + this.camera = R3.EntityManager.Instance.findComponentById('32sdim4koy'); + this.textCanvas = R3.EntityManager.Instance.findComponentById('c8tk5ha6nw'); + this.textTexture = R3.EntityManager.Instance.findComponentById('eprfl2ynkx'); + this.particleEngine = R3.EntityManager.Instance.findComponentById('l60d7ra270'); + this.particle = R3.EntityManager.Instance.findComponentById('mvo0gyajun'); - this.camera2d = GameLib.EntityManager.Instance.findComponentById('majq7lytaz'); + this.camera2d = R3.EntityManager.Instance.findComponentById('majq7lytaz'); - this.audioDrone = GameLib.EntityManager.Instance.findComponentById('4m7djsbvpf'); + this.audioDrone = R3.EntityManager.Instance.findComponentById('4m7djsbvpf'); this.beforeRender.entityLoaded = this; this.keyUp.entityLoaded = this; @@ -40,8 +40,8 @@ if (this.parentEntity === data.entity) { this.mouseWheel.entityLoaded = this; this.mouseMove.entityLoaded = this; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Drone' } diff --git a/6dqswe2iu3.js b/6dqswe2iu3.js index c55f567..b80c9d5 100644 --- a/6dqswe2iu3.js +++ b/6dqswe2iu3.js @@ -34,7 +34,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/6hecxmuir7.js b/6hecxmuir7.js index fe66f0c..9dcc8fb 100644 --- a/6hecxmuir7.js +++ b/6hecxmuir7.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/6rskhzgjog.js b/6rskhzgjog.js index c30da77..0377639 100644 --- a/6rskhzgjog.js +++ b/6rskhzgjog.js @@ -2,14 +2,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } @@ -19,14 +19,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1,5); + var play = R3.Utils.GetRandomIntInclusive(1,5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -71,7 +71,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.kanister.instance.visible = false; this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -129,8 +129,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore : this.kanisterSpawnScore @@ -179,8 +179,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -211,8 +211,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level +', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level : this.level, enemySpawnInterval : this.enemySpawnInterval, @@ -224,8 +224,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function(kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); if (kanister) { meshType = 6; @@ -234,7 +234,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -285,15 +285,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -372,8 +372,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -391,8 +391,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -409,7 +409,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -421,8 +421,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -490,8 +490,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'scoreUpdate', score : this.score @@ -502,8 +502,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnKanister(); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyExploded' @@ -526,8 +526,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('burning enemy ' + mesh.name); enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyBurned' @@ -540,8 +540,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { smokeParticleEngine.enabled = true; mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -563,15 +563,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -617,8 +617,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameRunning', message : 'we have enough trees burning now to start - the enemy will spawn now' @@ -626,8 +626,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'treeBurned', treesBurning : this.treesBurning, @@ -663,8 +663,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -679,8 +679,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game : this } @@ -742,7 +742,7 @@ if (this.mouseIsDown) } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -784,7 +784,7 @@ if (this.mouseIsDown) /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -824,8 +824,8 @@ else var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'fuelUsed', used : used, @@ -839,8 +839,8 @@ if (this.kanisterTime > this.kanisterLife) { this.kanisterTime = 0; this.kanisters -= 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -848,8 +848,8 @@ if (this.kanisterTime > this.kanisterLife) { ); if (this.kanisters < 0) { - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game : this } @@ -864,7 +864,7 @@ if (this.enemySpawnTime > this.enemySpawnInterval && this.running) { // // if (this.kanister.explodeParticleEngine) { -// if (GameLib.Utils.UndefinedOrNull(this.kanister.waiting)) { +// if (R3.Utils.UndefinedOrNull(this.kanister.waiting)) { // this.kanister.waiting = true; // } else { // this.kanister.explodeParticleEngine.remove(); @@ -878,8 +878,8 @@ if (this.enemySpawnTime > this.enemySpawnInterval && this.running) { // this.kanister.visible = true; // this.kanister.updateInstance('visible'); // -// GameLib.Event.Emit( -// GameLib.Event.GAME_DATA, +// R3.Event.Emit( +// R3.Event.GAME_DATA, // { // event : 'kanisterAppeared' // } @@ -894,7 +894,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { @@ -914,8 +914,8 @@ this.enemies = this.enemies.reduce( if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'enemyLifetimeReached', enemy : enemy diff --git a/72d6a2a3kc.js b/72d6a2a3kc.js index 0bbf6ce..bac39f8 100644 --- a/72d6a2a3kc.js +++ b/72d6a2a3kc.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -36,8 +36,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -45,7 +45,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -55,10 +55,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -97,15 +97,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -330,15 +330,15 @@ this.enemies = this.enemies.reduce( /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/76gcemwxf6.js b/76gcemwxf6.js index 8849658..7f615db 100644 --- a/76gcemwxf6.js +++ b/76gcemwxf6.js @@ -2,8 +2,8 @@ data.event.preventDefault(); var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, @@ -13,6 +13,6 @@ GameLib.Event.Emit( } ) -GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +R3.Event.Emit(R3.Event.MOUSE_DOWN); //@ sourceURL=touchStart.js \ No newline at end of file diff --git a/78gnds8jrj.js b/78gnds8jrj.js index 4f382d8..165788b 100644 --- a/78gnds8jrj.js +++ b/78gnds8jrj.js @@ -7,33 +7,33 @@ if (data.entity === this.parentEntity) { /** * Custom Code Components */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('94xi7aitax'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('jz3qg0174l'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('8dntnb01wu'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('kx7drv1vqw'); -this.keyDown = GameLib.EntityManager.Instance.findComponentById('ramgcjepp5'); -this.keyUp = GameLib.EntityManager.Instance.findComponentById('4uie4sjqxd'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('94xi7aitax'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('jz3qg0174l'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('8dntnb01wu'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('kx7drv1vqw'); +this.keyDown = R3.EntityManager.Instance.findComponentById('ramgcjepp5'); +this.keyUp = R3.EntityManager.Instance.findComponentById('4uie4sjqxd'); /** * Meshes */ -this.snail = GameLib.EntityManager.Instance.findComponentById('z2izbq1hcz'); -this.cloud = GameLib.EntityManager.Instance.findComponentById('jbvm17iwfx'); -this.solar = GameLib.EntityManager.Instance.findComponentById('lq5xyiu8n4'); -this.treesLeft = GameLib.EntityManager.Instance.findComponentById('lq0rxnjq3n'); -this.treesRight = GameLib.EntityManager.Instance.findComponentById('oag0yr1rav'); -this.road = GameLib.EntityManager.Instance.findComponentById('4furha3wst'); -this.sun = GameLib.EntityManager.Instance.findComponentById('nkdyvga5nl'); +this.snail = R3.EntityManager.Instance.findComponentById('z2izbq1hcz'); +this.cloud = R3.EntityManager.Instance.findComponentById('jbvm17iwfx'); +this.solar = R3.EntityManager.Instance.findComponentById('lq5xyiu8n4'); +this.treesLeft = R3.EntityManager.Instance.findComponentById('lq0rxnjq3n'); +this.treesRight = R3.EntityManager.Instance.findComponentById('oag0yr1rav'); +this.road = R3.EntityManager.Instance.findComponentById('4furha3wst'); +this.sun = R3.EntityManager.Instance.findComponentById('nkdyvga5nl'); /** * Lights */ -this.spotLight = GameLib.EntityManager.Instance.findComponentById('abkdj2g1f1'); +this.spotLight = R3.EntityManager.Instance.findComponentById('abkdj2g1f1'); /** * Images */ -this.level1 = GameLib.EntityManager.Instance.findComponentById('z0kofhvw8k'); +this.level1 = R3.EntityManager.Instance.findComponentById('z0kofhvw8k'); /** * Road Sections and Clouds @@ -64,11 +64,11 @@ this.targetSnailPosition = new THREE.Vector3(0, 0, 0); /** * Camera, Raycaster, Mouse */ -this.camera = GameLib.EntityManager.Instance.findComponentById('hd8dsn7o4c'); -this.raycaster = GameLib.EntityManager.Instance.findComponentById('h3yxd73sz7'); -this.mouse = GameLib.EntityManager.Instance.findComponentById('eriv6mcw8k'); +this.camera = R3.EntityManager.Instance.findComponentById('hd8dsn7o4c'); +this.raycaster = R3.EntityManager.Instance.findComponentById('h3yxd73sz7'); +this.mouse = R3.EntityManager.Instance.findComponentById('eriv6mcw8k'); -GameLib.CustomCode.prototype.loadLevel = function(index) { +R3.CustomCode.prototype.loadLevel = function(index) { var image = this['level' + index]; var heightData = image.getHeightData(); @@ -84,7 +84,7 @@ GameLib.CustomCode.prototype.loadLevel = function(index) { }.bind(this); -GameLib.CustomCode.prototype.spawnRoadSections = function() { +R3.CustomCode.prototype.spawnRoadSections = function() { var cloneLeft = this.treesLeft.clone(); var cloneRoad = this.road.clone(); @@ -111,7 +111,7 @@ GameLib.CustomCode.prototype.spawnRoadSections = function() { }.bind(this) -GameLib.CustomCode.prototype.spawnCloud = function() { +R3.CustomCode.prototype.spawnCloud = function() { var cloud = this.cloud.clone(); this.cloud.position.x = -155; @@ -123,7 +123,7 @@ GameLib.CustomCode.prototype.spawnCloud = function() { this.clouds.push(cloud); }.bind(this) -GameLib.CustomCode.prototype.advanceClouds = function(delta) { +R3.CustomCode.prototype.advanceClouds = function(delta) { var diff = delta * this.speed; @@ -165,7 +165,7 @@ GameLib.CustomCode.prototype.advanceClouds = function(delta) { }.bind(this); -GameLib.CustomCode.prototype.advanceRoadSections = function(delta) { +R3.CustomCode.prototype.advanceRoadSections = function(delta) { var diff = delta * this.speed; @@ -188,7 +188,7 @@ GameLib.CustomCode.prototype.advanceRoadSections = function(delta) { ); }.bind(this); -GameLib.CustomCode.prototype.adjustCamera = function(delta) { +R3.CustomCode.prototype.adjustCamera = function(delta) { /** * We don't adjust the camera anymore since it affects the ray-tracing in mouse-move * An update here causes a slightly different 3d mouse location on mouse move which @@ -196,7 +196,7 @@ GameLib.CustomCode.prototype.adjustCamera = function(delta) { */ }.bind(this); -GameLib.CustomCode.prototype.adjustSpeed = function(delta) { +R3.CustomCode.prototype.adjustSpeed = function(delta) { if (this.speedUp) { this.speed += delta; @@ -228,7 +228,7 @@ GameLib.CustomCode.prototype.adjustSpeed = function(delta) { }.bind(this); -GameLib.CustomCode.prototype.adjustSnailPosition = function(delta) { +R3.CustomCode.prototype.adjustSnailPosition = function(delta) { this.currentSnailSettings.lerpVectors( this.initialSnailSettings, @@ -257,7 +257,7 @@ GameLib.CustomCode.prototype.adjustSnailPosition = function(delta) { }.bind(this); -GameLib.CustomCode.prototype.update3dCursor = function() { +R3.CustomCode.prototype.update3dCursor = function() { this.raycaster.setFromCamera( this.mouse, @@ -276,8 +276,8 @@ GameLib.CustomCode.prototype.update3dCursor = function() { }.bind(this); -GameLib.Event.Subscribe( - GameLib.Event.GAME_START, +R3.Event.Subscribe( + R3.Event.GAME_START, function() { /** * Game Variables @@ -325,6 +325,6 @@ this.spawnRoadSections(); this.loadLevel(1); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js \ No newline at end of file diff --git a/7hbzh7r5xx.js b/7hbzh7r5xx.js index d483366..78e7afc 100644 --- a/7hbzh7r5xx.js +++ b/7hbzh7r5xx.js @@ -34,7 +34,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/7jq30brvwf.js b/7jq30brvwf.js index c9407ca..89e7d00 100644 --- a/7jq30brvwf.js +++ b/7jq30brvwf.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/7kxus4p81o.js b/7kxus4p81o.js index a72560d..778a90a 100644 --- a/7kxus4p81o.js +++ b/7kxus4p81o.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/7n10po5ukd.js b/7n10po5ukd.js index fe66f0c..9dcc8fb 100644 --- a/7n10po5ukd.js +++ b/7n10po5ukd.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/7p8dxknb7m.js b/7p8dxknb7m.js index cce5f1e..35fdcbd 100644 --- a/7p8dxknb7m.js +++ b/7p8dxknb7m.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -36,8 +36,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -45,7 +45,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -55,10 +55,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -97,15 +97,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -384,15 +384,15 @@ this.enemies = this.enemies.reduce( /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/7vjcf5lwek.js b/7vjcf5lwek.js index 99addd3..e7b523c 100644 --- a/7vjcf5lwek.js +++ b/7vjcf5lwek.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -var particleEngine = GameLib.EntityManager.Instance.findComponentById('w4gg7woov2'); +var particleEngine = R3.EntityManager.Instance.findComponentById('w4gg7woov2'); particleEngine.enabled = false; diff --git a/80yal6ybb1.js b/80yal6ybb1.js index e988270..fd2e9fe 100644 --- a/80yal6ybb1.js +++ b/80yal6ybb1.js @@ -9,69 +9,69 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('vf71eo6vy7') -this.bull = GameLib.EntityManager.Instance.findComponentById('fb8nok5p3s'); -this.star = GameLib.EntityManager.Instance.findComponentById('kh2bn0fkfq'); -this.burger = GameLib.EntityManager.Instance.findComponentById('rbktwz9ypl'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('doajaarxnb'); -this.santa = GameLib.EntityManager.Instance.findComponentById('bkbhy2k864'); -this.camera = GameLib.EntityManager.Instance.findComponentById('ut5nm7c2xr'); -this.scene = GameLib.EntityManager.Instance.findComponentById('fjfna894cf'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('xd6wp2w74l'); +this.fog = R3.EntityManager.Instance.findComponentById('vf71eo6vy7') +this.bull = R3.EntityManager.Instance.findComponentById('fb8nok5p3s'); +this.star = R3.EntityManager.Instance.findComponentById('kh2bn0fkfq'); +this.burger = R3.EntityManager.Instance.findComponentById('rbktwz9ypl'); +this.parcel = R3.EntityManager.Instance.findComponentById('doajaarxnb'); +this.santa = R3.EntityManager.Instance.findComponentById('bkbhy2k864'); +this.camera = R3.EntityManager.Instance.findComponentById('ut5nm7c2xr'); +this.scene = R3.EntityManager.Instance.findComponentById('fjfna894cf'); +this.cursor = R3.EntityManager.Instance.findComponentById('xd6wp2w74l'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('ovj7ymtofz'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('hx0oxkh51d'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('iulg9l3wxf'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('j48lsgfhcf'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('7wshp3vkqg'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('0yynf8c3i7'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('222aabfbhq'); +this.thrower = R3.EntityManager.Instance.findComponentById('ovj7ymtofz'); +this.renderer = R3.EntityManager.Instance.findComponentById('hx0oxkh51d'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('iulg9l3wxf'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('j48lsgfhcf'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('7wshp3vkqg'); +this.stone1 = R3.EntityManager.Instance.findComponentById('0yynf8c3i7'); +this.stone2 = R3.EntityManager.Instance.findComponentById('222aabfbhq'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('ziobe1jocu'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('1irf780tzg'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('v9wdq6y9bt'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('xcboaoyd8t'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('f2p0yutu8z'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('ziobe1jocu'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('1irf780tzg'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('v9wdq6y9bt'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('xcboaoyd8t'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('f2p0yutu8z'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('ulv0tmaiah'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('ulv0tmaiah'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('plccpu9dx0'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('plccpu9dx0'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('2hq8ud34dj'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('2hq8ud34dj'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('y1gyht3k6t'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('y1gyht3k6t'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('8ndi8ljwbc'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('8ndi8ljwbc'); this.mouseMove.entityLoaded = this; -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +//R3.Event.Emit(R3.Event.MOUSE_UP); -GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } diff --git a/88jsagda74.js b/88jsagda74.js index a126517..520b748 100644 --- a/88jsagda74.js +++ b/88jsagda74.js @@ -1,7 +1,7 @@ var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, diff --git a/8d5c3jt4rz.js b/8d5c3jt4rz.js index bfece8c..5fec684 100644 --- a/8d5c3jt4rz.js +++ b/8d5c3jt4rz.js @@ -2,12 +2,12 @@ if (!this.entityLoaded) { return; } -var camera = GameLib.EntityManager.Instance.findComponentById('r38gjp0opa'); +var camera = R3.EntityManager.Instance.findComponentById('r38gjp0opa'); camera.lookAt.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025;//(window.clientWidth/ 2) + data.event.x; camera.lookAt.y = (((window.innerHeight / 2 - data.event.y)) * 0.05); camera.updateInstance(); -var cursorCamera = GameLib.EntityManager.Instance.findComponentById('ajtzsvtt8o'); +var cursorCamera = R3.EntityManager.Instance.findComponentById('ajtzsvtt8o'); var mousePosition = new THREE.Vector3( (-1 * (window.innerWidth / 2 - data.event.x)) , @@ -17,14 +17,14 @@ var mousePosition = new THREE.Vector3( mousePosition.unproject(cursorCamera.instance); -var cursor = GameLib.EntityManager.Instance.findComponentById('aj7cby3brc'); +var cursor = R3.EntityManager.Instance.findComponentById('aj7cby3brc'); cursor.position.x = mousePosition.x; cursor.position.y = mousePosition.y; //cursor.position.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025; //cursor.position.y = (((window.innerHeight / 2 - data.event.y)) * 0.05); cursor.updateInstance(); -var thrower = GameLib.EntityManager.Instance.findComponentById('32a4ii2ixu'); +var thrower = R3.EntityManager.Instance.findComponentById('32a4ii2ixu'); thrower.instance.lookAt( new THREE.Vector3( @@ -41,8 +41,8 @@ thrower.instance.lookAt( /** * First we find our crosshair */ -//var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); -var sphere = GameLib.EntityManager.Instance.findComponentById('pxgrrbj2mz'); +//var crosshair = R3.EntityManager.Instance.findComponentById('oxpg88pgzv'); +var sphere = R3.EntityManager.Instance.findComponentById('pxgrrbj2mz'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -81,7 +81,7 @@ raycaster.ray = new THREE.Ray( ); var intersects = raycaster.intersectObjects( - GameLib.EntityManager.Instance.queryComponents(GameLib.D3.Mesh).map( + R3.EntityManager.Instance.queryComponents(R3.D3.Mesh).map( function(mesh){ if (mesh.instance.material instanceof Array) { diff --git a/8ia8dlk7l5.js b/8ia8dlk7l5.js index 8ba2d37..d680ef1 100644 --- a/8ia8dlk7l5.js +++ b/8ia8dlk7l5.js @@ -5,55 +5,55 @@ if (data.entity === this.parentEntity) { /** * Custom Code Components */ -this.ccBeforeRender = GameLib.EntityManager.Instance.findComponentById('r8wkd1wwip'); -this.ccKeyDown = GameLib.EntityManager.Instance.findComponentById('airpllbqpu'); -this.ccTouchStart = GameLib.EntityManager.Instance.findComponentById('dwln7lp0w9'); -this.ccTouchEnd = GameLib.EntityManager.Instance.findComponentById('cgw7pwx0jg'); +this.ccBeforeRender = R3.EntityManager.Instance.findComponentById('r8wkd1wwip'); +this.ccKeyDown = R3.EntityManager.Instance.findComponentById('airpllbqpu'); +this.ccTouchStart = R3.EntityManager.Instance.findComponentById('dwln7lp0w9'); +this.ccTouchEnd = R3.EntityManager.Instance.findComponentById('cgw7pwx0jg'); /** * Images */ -this.image_0 = GameLib.EntityManager.Instance.findComponentById('l8cs0ftjfu'); -this.image_1 = GameLib.EntityManager.Instance.findComponentById('nxx7ywvjua'); -this.image_2 = GameLib.EntityManager.Instance.findComponentById('skuw2a1auy'); -this.image_3 = GameLib.EntityManager.Instance.findComponentById('egq1q2p0jv'); -this.image_4 = GameLib.EntityManager.Instance.findComponentById('nw49tomo2g'); -this.image_5 = GameLib.EntityManager.Instance.findComponentById('5j8ht73i3y'); -this.image_6 = GameLib.EntityManager.Instance.findComponentById('a9wz0y7ukl'); -this.image_grid = GameLib.EntityManager.Instance.findComponentById('qy233xuf15'); -this.image_glow = GameLib.EntityManager.Instance.findComponentById('j374jz2dlp'); -this.image_flames_small = GameLib.EntityManager.Instance.findComponentById('o4tvl5tvk6'); +this.image_0 = R3.EntityManager.Instance.findComponentById('l8cs0ftjfu'); +this.image_1 = R3.EntityManager.Instance.findComponentById('nxx7ywvjua'); +this.image_2 = R3.EntityManager.Instance.findComponentById('skuw2a1auy'); +this.image_3 = R3.EntityManager.Instance.findComponentById('egq1q2p0jv'); +this.image_4 = R3.EntityManager.Instance.findComponentById('nw49tomo2g'); +this.image_5 = R3.EntityManager.Instance.findComponentById('5j8ht73i3y'); +this.image_6 = R3.EntityManager.Instance.findComponentById('a9wz0y7ukl'); +this.image_grid = R3.EntityManager.Instance.findComponentById('qy233xuf15'); +this.image_glow = R3.EntityManager.Instance.findComponentById('j374jz2dlp'); +this.image_flames_small = R3.EntityManager.Instance.findComponentById('o4tvl5tvk6'); /** * Scene */ -this.scene = GameLib.EntityManager.Instance.findComponentById('t551yp2uw2'); +this.scene = R3.EntityManager.Instance.findComponentById('t551yp2uw2'); /** * Materials */ -this.gridMaterial = GameLib.EntityManager.Instance.findComponentById('ajx545c2rv'); +this.gridMaterial = R3.EntityManager.Instance.findComponentById('ajx545c2rv'); /** * Score */ -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('ke0mqfoxev'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('6k8p84kkgz'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('ke0mqfoxev'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('6k8p84kkgz'); /** * Animations */ -this.animation = GameLib.EntityManager.Instance.findComponentById('73b6zgwi6g'); +this.animation = R3.EntityManager.Instance.findComponentById('73b6zgwi6g'); /** * Lights */ -this.burnLight = GameLib.EntityManager.Instance.findComponentById('bprzyzukkr'); +this.burnLight = R3.EntityManager.Instance.findComponentById('bprzyzukkr'); /** * Textures */ -this.textureDisplacement = GameLib.EntityManager.Instance.findComponentById('dwooesyl8u'); +this.textureDisplacement = R3.EntityManager.Instance.findComponentById('dwooesyl8u'); /** * Initial Game Settings @@ -68,24 +68,24 @@ this.grid = []; this.gameOver = false; -GameLib.CustomCode.TETRIS_BLOCK_I = 0; -GameLib.CustomCode.TETRIS_BLOCK_L = 1; -GameLib.CustomCode.TETRIS_BLOCK_L2 = 2; -GameLib.CustomCode.TETRIS_BLOCK_Z = 3; -GameLib.CustomCode.TETRIS_BLOCK_Z2 = 4; -GameLib.CustomCode.TETRIS_BLOCK_T = 5; -GameLib.CustomCode.TETRIS_BLOCK_O = 6; -GameLib.CustomCode.TETRIS_BLOCK_MAX = 7; +R3.CustomCode.TETRIS_BLOCK_I = 0; +R3.CustomCode.TETRIS_BLOCK_L = 1; +R3.CustomCode.TETRIS_BLOCK_L2 = 2; +R3.CustomCode.TETRIS_BLOCK_Z = 3; +R3.CustomCode.TETRIS_BLOCK_Z2 = 4; +R3.CustomCode.TETRIS_BLOCK_T = 5; +R3.CustomCode.TETRIS_BLOCK_O = 6; +R3.CustomCode.TETRIS_BLOCK_MAX = 7; -GameLib.CustomCode.TETRIS_GRID_WIDTH = 11; -GameLib.CustomCode.TETRIS_GRID_HEIGHT = 24; -GameLib.CustomCode.TETRIS_GRID_HEADSPACE = 4; +R3.CustomCode.TETRIS_GRID_WIDTH = 11; +R3.CustomCode.TETRIS_GRID_HEIGHT = 24; +R3.CustomCode.TETRIS_GRID_HEADSPACE = 4; -GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; -GameLib.CustomCode.TETRIS_GRID_TAKEN = 1; -GameLib.CustomCode.TETRIS_GRID_DISAPPEARING = 2; +R3.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; +R3.CustomCode.TETRIS_GRID_TAKEN = 1; +R3.CustomCode.TETRIS_GRID_DISAPPEARING = 2; -GameLib.CustomCode.prototype.visualizeGrid = function (color) { +R3.CustomCode.prototype.visualizeGrid = function (color) { if (this.starsMesh) { this.scene.instance.remove(this.starsMesh); @@ -95,7 +95,7 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { for (var y = 0; y < this.grid.length; y++) { for (var x = 0; x < this.grid[y].length; x++) { - if (this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { this.starsGeometry.vertices.push( new THREE.Vector3( x, @@ -115,9 +115,9 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { }.bind(this) -GameLib.CustomCode.prototype.startAnimation = function (index, lines) { +R3.CustomCode.prototype.startAnimation = function (index, lines) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { var bacon = this.tile_bacon_disappearing.clone(); @@ -142,7 +142,7 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { glow.updateInstance('visible'); glow.position.y = index; - glow.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + glow.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; glow.position.z = 4; glow.updateInstance('position'); @@ -152,7 +152,7 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { flames.updateInstance('visible'); flames.position.y = index + 0.5; - flames.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + flames.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; flames.position.z = 5; flames.updateInstance('position'); @@ -164,8 +164,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { time: 0 } - animationObject.subscription = GameLib.Event.Subscribe( - GameLib.Event.BEFORE_RENDER, + animationObject.subscription = R3.Event.Subscribe( + R3.Event.BEFORE_RENDER, function (__animationObject) { return function (data) { __animationObject.time += data.delta * 4; @@ -197,15 +197,15 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { this.burnLight.intensity = 0; this.burnLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: __animationObject.glow } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: __animationObject.flames } @@ -216,8 +216,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { */ __animationObject.flamesArray.map( function (flame) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: flame } @@ -228,21 +228,21 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { /** * Remove the meshes and the baconDisappearing objects */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (!this.grid[__animationObject.rowNumber][x].mesh) { throw new Error('mesh should exist but does not'); } - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[__animationObject.rowNumber][x].mesh } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[__animationObject.rowNumber][x].baconDisappearing } @@ -257,10 +257,10 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { var row = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { row.push( { - value: GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value: R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh: null } ) @@ -271,8 +271,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { /** * Now - drop all blocks above the current index down one row */ - for (var y = __animationObject.rowNumber; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = __animationObject.rowNumber; y < R3.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (this.grid[y][x].mesh) { this.grid[y][x].mesh.position.y = y; @@ -328,18 +328,18 @@ GameLib.CustomCode.prototype.startAnimation = function (index, lines) { this.animationObjects.push(animationObject); }.bind(this) -GameLib.CustomCode.prototype.removeLines = function () { +R3.CustomCode.prototype.removeLines = function () { var indices = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { var line = true; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN || - this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING + this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_NOT_TAKEN || + this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING ) { line = false; } @@ -448,8 +448,8 @@ GameLib.CustomCode.prototype.removeLines = function () { indices.map( function (index) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { - this.grid[index][x].value = GameLib.CustomCode.TETRIS_GRID_DISAPPEARING; + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { + this.grid[index][x].value = R3.CustomCode.TETRIS_GRID_DISAPPEARING; } this.startAnimation(index, indices.length); }.bind(this) @@ -458,7 +458,7 @@ GameLib.CustomCode.prototype.removeLines = function () { }.bind(this); -GameLib.CustomCode.prototype.drawStatus = function () { +R3.CustomCode.prototype.drawStatus = function () { var context = this.scoreCanvas.instance.getContext('2d'); context.textBaseline = "middle"; @@ -534,7 +534,7 @@ GameLib.CustomCode.prototype.drawStatus = function () { }.bind(this) -GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { +R3.CustomCode.prototype.getBlockGridPositions = function (block) { var object = new THREE.Mesh(); @@ -584,7 +584,7 @@ GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { }.bind(this); -GameLib.CustomCode.prototype.drawGrid = function () { +R3.CustomCode.prototype.drawGrid = function () { var geometry = new THREE.PlaneBufferGeometry(); @@ -593,8 +593,8 @@ GameLib.CustomCode.prototype.drawGrid = function () { this.gridMaterial.instance ); - for (var y = 0; y < (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE); y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = 0; y < (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE); y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { var clone = mesh.clone(); @@ -611,7 +611,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { geometry.vertices.push( new THREE.Vector3( -0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ), new THREE.Vector3( @@ -620,13 +620,13 @@ GameLib.CustomCode.prototype.drawGrid = function () { 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, -0.5, 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ) ); @@ -646,7 +646,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { }.bind(this) -GameLib.CustomCode.prototype.checkBoundaries = function (block) { +R3.CustomCode.prototype.checkBoundaries = function (block) { /** * collisions are true only for out of bounds indexes, and if the current block is taken @@ -670,7 +670,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { leftHit = true; } - if (position.x === (GameLib.CustomCode.TETRIS_GRID_WIDTH - 1)) { + if (position.x === (R3.CustomCode.TETRIS_GRID_WIDTH - 1)) { rightHit = true; } @@ -678,7 +678,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { bottomHit = true; } - if (position.y === (GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1)) { + if (position.y === (R3.CustomCode.TETRIS_GRID_HEIGHT - 1)) { topHit = true; } @@ -689,7 +689,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.x >= GameLib.CustomCode.TETRIS_GRID_WIDTH) { + if (position.x >= R3.CustomCode.TETRIS_GRID_WIDTH) { collision = true; } @@ -697,7 +697,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.y >= GameLib.CustomCode.TETRIS_GRID_HEIGHT) { + if (position.y >= R3.CustomCode.TETRIS_GRID_HEIGHT) { collision = true; } @@ -706,14 +706,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * be sure x+1 is inside bounds */ if ( - ((position.x + 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) && + ((position.x + 1) < R3.CustomCode.TETRIS_GRID_WIDTH) && ((position.x + 1) >= 0) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.grid[position.y][position.x + 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.grid[position.y][position.x + 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - we found a block to the right - its over */ @@ -729,14 +729,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.x) > 0) && ((position.x - 1) >= 0) && - ((position.x - 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) + ((position.x - 1) < R3.CustomCode.TETRIS_GRID_WIDTH) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.grid[position.y][position.x - 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.grid[position.y][position.x - 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * We found a block to the left - its over also */ @@ -749,15 +749,15 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * Now we want to see if the block above is taken, we cannot be sure y+1 is inside bounds */ if ( - ((position.y + 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) && + ((position.y + 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) && ((position.y + 1) >= 0) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.grid[position.y + 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[position.y + 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block is at the top */ @@ -772,20 +772,20 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.y) > 0) && ((position.y - 1) >= 0) && - ((position.y - 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) + ((position.y - 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (this.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block hit bottom */ bottomHit = true; } - if (this.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING) { + if (this.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING) { bottomDisappearing = true; } } @@ -796,10 +796,10 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * we cannot be sure, x and y is inside bounds */ if ( - (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && - (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) + (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && + (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) ) { - if (this.grid[position.y][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[position.y][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { collision = true; } } @@ -817,7 +817,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { }.bind(this) -GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { +R3.CustomCode.prototype.rotateBlock = function (clockwise) { if (this.gameOver) { return; @@ -866,9 +866,9 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { }.bind(this); -GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { +R3.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { - if (GameLib.Utils.UndefinedOrNull(block)) { + if (R3.Utils.UndefinedOrNull(block)) { block = this.block; } @@ -935,7 +935,7 @@ GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, coll return moved; }.bind(this); -GameLib.CustomCode.prototype.spawnBlock = function () { +R3.CustomCode.prototype.spawnBlock = function () { var blockType = Math.floor(Math.random() * 7); @@ -962,7 +962,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { center.position.x = 0; center.position.z = 3.5; - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_I) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_I) { mesh0 = this.tile_4.clone(); mesh0.position.setFrom(center.position); @@ -994,7 +994,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.5; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1026,7 +1026,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L2) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1058,7 +1058,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1089,7 +1089,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z2) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); @@ -1121,7 +1121,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_T) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_T) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1151,7 +1151,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 16; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_O) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_O) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1242,7 +1242,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { }.bind(this) -GameLib.CustomCode.prototype.spawnTinyBlock = function () { +R3.CustomCode.prototype.spawnTinyBlock = function () { var block = this.spawnBlock(); @@ -1265,7 +1265,7 @@ GameLib.CustomCode.prototype.spawnTinyBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnNextBlock = function () { +R3.CustomCode.prototype.spawnNextBlock = function () { if (!this.tinyBlock) { this.tinyBlock = this.spawnTinyBlock(); @@ -1288,7 +1288,7 @@ GameLib.CustomCode.prototype.spawnNextBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnBigBlock = function () { +R3.CustomCode.prototype.spawnBigBlock = function () { if (!this.nextBlock) { this.nextBlock = this.spawnNextBlock(); @@ -1304,8 +1304,8 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { block.center.position.x = 0; block.center.position.y = 0; block.center.position.z = 2.5; - this.moveBlock(block, {up: true}, (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE), false); - this.moveBlock(block, {right: true}, GameLib.CustomCode.TETRIS_GRID_WIDTH / 2, false); + this.moveBlock(block, {up: true}, (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE), false); + this.moveBlock(block, {right: true}, R3.CustomCode.TETRIS_GRID_WIDTH / 2, false); this.moveBlock(block, {left: true}, block.offset.x, false); this.moveBlock(block, {down: true}, block.offset.y, false); block.center.updateInstance('position'); @@ -1315,12 +1315,12 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.getNextBlock = function () { +R3.CustomCode.prototype.getNextBlock = function () { this.block = this.spawnBigBlock(); - GameLib.Event.Emit( - GameLib.Event.COMPONENT_REGISTER, + R3.Event.Emit( + R3.Event.COMPONENT_REGISTER, { component: this.block.center } @@ -1333,7 +1333,7 @@ GameLib.CustomCode.prototype.getNextBlock = function () { /** * This code executes when the 'bottom' has been reached (the block is stopping) */ -GameLib.CustomCode.prototype.stopBlock = function() { +R3.CustomCode.prototype.stopBlock = function() { var gridPositions = this.getBlockGridPositions(this.block); @@ -1354,7 +1354,7 @@ GameLib.CustomCode.prototype.stopBlock = function() { } block = { - value : GameLib.CustomCode.TETRIS_GRID_TAKEN, + value : R3.CustomCode.TETRIS_GRID_TAKEN, mesh : position.mesh, baconDisappearing : null } @@ -1389,8 +1389,8 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * We remove the controlling block */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -1406,13 +1406,13 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * Check if the game is over */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[19][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[20][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[21][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[22][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[23][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN + this.grid[19][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[20][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[21][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[22][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[23][x].value === R3.CustomCode.TETRIS_GRID_TAKEN ) { this.gameOver = true; } @@ -1423,8 +1423,8 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * End the game if game over */ - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { score: this.score, level: this.level, @@ -1445,7 +1445,7 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * Clears the grid */ -GameLib.CustomCode.prototype.clearGrid = function() { +R3.CustomCode.prototype.clearGrid = function() { /** * Remove all stale components (if any) @@ -1471,11 +1471,11 @@ GameLib.CustomCode.prototype.clearGrid = function() { * Initialize the grid */ this.grid = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { this.grid[y] = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { this.grid[y][x] = { - value : GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value : R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh : null, baconDisappearing : null }; @@ -1484,13 +1484,13 @@ GameLib.CustomCode.prototype.clearGrid = function() { }.bind(this) -GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) { +R3.CustomCode.prototype.createTile = function(tileName, imageName, displace) { var apiMaterial; if (imageName) { if (displace) { - apiMaterial = new GameLib.D3.API.Material.Phong( + apiMaterial = new R3.D3.API.Material.Phong( null, null, null, @@ -1508,13 +1508,13 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace null, null, null, - new GameLib.D3.API.Texture.Image( + new R3.D3.API.Texture.Image( null, this[imageName] ) ) } else { - apiMaterial = new GameLib.D3.API.Material.Phong( + apiMaterial = new R3.D3.API.Material.Phong( null, null, null, @@ -1532,21 +1532,21 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace null, null, null, - new GameLib.D3.API.Texture.Image( + new R3.D3.API.Texture.Image( null, this[imageName] ) ) } } else { - apiMaterial = new GameLib.D3.API.Material.Phong(); + apiMaterial = new R3.D3.API.Material.Phong(); } - this[tileName] = new GameLib.D3.Mesh( + this[tileName] = new R3.D3.Mesh( this.graphics, - new GameLib.D3.API.Mesh( + new R3.D3.API.Mesh( null, - new GameLib.D3.API.Geometry.Buffer.Plane( + new R3.D3.API.Geometry.Buffer.Plane( null, 1, 1, @@ -1571,8 +1571,8 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace }.bind(this); -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function () { @@ -1598,8 +1598,8 @@ GameLib.Event.Subscribe( if (this.block && this.block.center) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -1609,8 +1609,8 @@ GameLib.Event.Subscribe( if (this.block && this.block.meshes) { this.block.meshes.map( function (mesh) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: mesh } @@ -1647,8 +1647,8 @@ GameLib.Event.Subscribe( }.bind(this) ); -GameLib.Event.Emit( - GameLib.Event.GET_RUNTIME, +R3.Event.Emit( + R3.Event.GET_RUNTIME, {}, function(runtime) { @@ -1702,9 +1702,9 @@ GameLib.Event.Emit( this.drawGrid(); this.drawStatus(); - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, GameLib.Utils.GetWindowSize()); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, R3.Utils.GetWindowSize()); - GameLib.Event.Emit(GameLib.Event.GAME_LOADED); + R3.Event.Emit(R3.Event.GAME_LOADED); }.bind(this) ) diff --git a/92p3h03t2s.js b/92p3h03t2s.js index b4e3314..72686d4 100644 --- a/92p3h03t2s.js +++ b/92p3h03t2s.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -24,8 +24,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -33,7 +33,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -43,12 +43,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 4); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 4); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; @@ -75,15 +75,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -166,8 +166,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/9l6o7974qx.js b/9l6o7974qx.js index b4f686e..1351082 100644 --- a/9l6o7974qx.js +++ b/9l6o7974qx.js @@ -3,8 +3,8 @@ if (!this.entityLoaded) { } if ( - GameLib.Utils.UndefinedOrNull(this.totalTime) || - GameLib.Utils.UndefinedOrNull(this.spawnTime) + R3.Utils.UndefinedOrNull(this.totalTime) || + R3.Utils.UndefinedOrNull(this.spawnTime) ) { /** @@ -13,16 +13,16 @@ if ( this.totalTime = 0; this.spawnTime = 0; - var cow = GameLib.EntityManager.Instance.findComponentById('3upawmhh8j'); - var burger = GameLib.EntityManager.Instance.findComponentById('psy2g7qsfx'); + var cow = R3.EntityManager.Instance.findComponentById('3upawmhh8j'); + var burger = R3.EntityManager.Instance.findComponentById('psy2g7qsfx'); cow.instance.visible = false; burger.instance.visible = false; this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -30,13 +30,13 @@ if ( ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 10 ); } - this.scene = GameLib.EntityManager.Instance.findComponentById('lpdxa66480'); + this.scene = R3.EntityManager.Instance.findComponentById('lpdxa66480'); this.nextSpawnTime = this.getNextSpawnTime(); @@ -47,7 +47,7 @@ if ( var y = Math.floor((Math.random() * 10) + 2); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; @@ -136,8 +136,8 @@ this.enemies = this.enemies.reduce( enemy.mesh.updateInstancePosition(); enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/9m43m5angb.js b/9m43m5angb.js index c28a0bf..d4a434e 100644 --- a/9m43m5angb.js +++ b/9m43m5angb.js @@ -4,5 +4,5 @@ if (!this.entityLoaded) { data.event.preventDefault(); -GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +R3.Event.Emit(R3.Event.MOUSE_DOWN); //@ sourceURL=SpoonLibTouchStart.js \ No newline at end of file diff --git a/9snmhsx424.js b/9snmhsx424.js index fde585c..8c1444e 100644 --- a/9snmhsx424.js +++ b/9snmhsx424.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/a0v6n942ic.js b/a0v6n942ic.js index 6a90b0f..40dd07c 100644 --- a/a0v6n942ic.js +++ b/a0v6n942ic.js @@ -9,67 +9,67 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('r3eur8ympy') -this.bull = GameLib.EntityManager.Instance.findComponentById('v59mni1ypx'); -this.star = GameLib.EntityManager.Instance.findComponentById('zgp3jux4f4'); -this.burger = GameLib.EntityManager.Instance.findComponentById('qtprmkkkfx'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('a4lb4dukzt'); -this.santa = GameLib.EntityManager.Instance.findComponentById('gc0kz1f0fw'); -this.camera = GameLib.EntityManager.Instance.findComponentById('m000roqt8v'); -this.scene = GameLib.EntityManager.Instance.findComponentById('7y72yeuncr'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('hgdsegdosa'); -this.dom = GameLib.EntityManager.Instance.findComponentById('hyvd4mfr4v'); +this.fog = R3.EntityManager.Instance.findComponentById('r3eur8ympy') +this.bull = R3.EntityManager.Instance.findComponentById('v59mni1ypx'); +this.star = R3.EntityManager.Instance.findComponentById('zgp3jux4f4'); +this.burger = R3.EntityManager.Instance.findComponentById('qtprmkkkfx'); +this.parcel = R3.EntityManager.Instance.findComponentById('a4lb4dukzt'); +this.santa = R3.EntityManager.Instance.findComponentById('gc0kz1f0fw'); +this.camera = R3.EntityManager.Instance.findComponentById('m000roqt8v'); +this.scene = R3.EntityManager.Instance.findComponentById('7y72yeuncr'); +this.cursor = R3.EntityManager.Instance.findComponentById('hgdsegdosa'); +this.dom = R3.EntityManager.Instance.findComponentById('hyvd4mfr4v'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('mcocuprwcv'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('d2az0v3lq4'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('c26kqix88a'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('ik18fh7mgv'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('jubhzsof0t'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('insxkitq6s'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('bazas19rey'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('yq6mdmw7gv'); +this.renderer = R3.EntityManager.Instance.findComponentById('mcocuprwcv'); +this.thrower = R3.EntityManager.Instance.findComponentById('d2az0v3lq4'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('c26kqix88a'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('ik18fh7mgv'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('jubhzsof0t'); +this.stone1 = R3.EntityManager.Instance.findComponentById('insxkitq6s'); +this.stone2 = R3.EntityManager.Instance.findComponentById('bazas19rey'); +this.kanister = R3.EntityManager.Instance.findComponentById('yq6mdmw7gv'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('yqgpbbse83'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('nmvw8g8zrl'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('nbeep62bcr'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('ca6ij1diws'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('vkaf0cczuz'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('0w4ljfgyth'); +this.leftLight = R3.EntityManager.Instance.findComponentById('yqgpbbse83'); +this.rightLight = R3.EntityManager.Instance.findComponentById('nmvw8g8zrl'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('nbeep62bcr'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('ca6ij1diws'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('vkaf0cczuz'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('0w4ljfgyth'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('maj3zxq83t'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('khrubylmuq'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('9lcln8oyhz'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('dh64rky3iy'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('tmv0scukj9'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('maj3zxq83t'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('khrubylmuq'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('9lcln8oyhz'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('dh64rky3iy'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('tmv0scukj9'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('vgkw1f7rv8'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('vgkw1f7rv8'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('orfy8cilgg'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('lf6lcf3rv4'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('b8gasgkbnl'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('ebpzqxnz4u'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('7kxus4p81o'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('orfy8cilgg'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('lf6lcf3rv4'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('b8gasgkbnl'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('ebpzqxnz4u'); +this.touchMove = R3.EntityManager.Instance.findComponentById('7kxus4p81o'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -84,8 +84,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -96,7 +96,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -1074,6 +1074,6 @@ mesh.updateInstance('position'); mesh.updateInstance('rotation'); mesh.updateInstance('scale'); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/a2ow5l92js.js b/a2ow5l92js.js index d0a7884..f66d3e3 100644 --- a/a2ow5l92js.js +++ b/a2ow5l92js.js @@ -2,14 +2,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } @@ -19,14 +19,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1,5); + var play = R3.Utils.GetRandomIntInclusive(1,5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -71,7 +71,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.kanister.instance.visible = false; this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -129,8 +129,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore : this.kanisterSpawnScore @@ -179,8 +179,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -211,8 +211,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level +', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level : this.level, enemySpawnInterval : this.enemySpawnInterval, @@ -224,8 +224,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function(kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); if (kanister) { meshType = 6; @@ -234,7 +234,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -285,15 +285,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -372,8 +372,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -391,8 +391,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -409,7 +409,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -421,8 +421,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -490,8 +490,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'scoreUpdate', score : this.score @@ -502,8 +502,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnKanister(); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyExploded' @@ -526,8 +526,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('burning enemy ' + mesh.name); enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyBurned' @@ -540,8 +540,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { smokeParticleEngine.enabled = true; mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -563,15 +563,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -617,8 +617,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameRunning', message : 'we have enough trees burning now to start - the enemy will spawn now' @@ -626,8 +626,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'treeBurned', treesBurning : this.treesBurning, @@ -663,8 +663,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -679,8 +679,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game : this } @@ -742,7 +742,7 @@ if (this.mouseIsDown) } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -784,7 +784,7 @@ if (this.mouseIsDown) /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -824,8 +824,8 @@ else var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'fuelUsed', used : used, @@ -839,8 +839,8 @@ if (this.kanisterTime > this.kanisterLife) { this.kanisterTime = 0; this.kanisters -= 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -848,8 +848,8 @@ if (this.kanisterTime > this.kanisterLife) { ); if (this.kanisters < 0) { - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game : this } @@ -864,7 +864,7 @@ if (this.enemySpawnTime > this.enemySpawnInterval && this.running) { // // if (this.kanister.explodeParticleEngine) { -// if (GameLib.Utils.UndefinedOrNull(this.kanister.waiting)) { +// if (R3.Utils.UndefinedOrNull(this.kanister.waiting)) { // this.kanister.waiting = true; // } else { // this.kanister.explodeParticleEngine.remove(); @@ -878,8 +878,8 @@ if (this.enemySpawnTime > this.enemySpawnInterval && this.running) { // this.kanister.visible = true; // this.kanister.updateInstance('visible'); // -// GameLib.Event.Emit( -// GameLib.Event.GAME_DATA, +// R3.Event.Emit( +// R3.Event.GAME_DATA, // { // event : 'kanisterAppeared' // } @@ -894,7 +894,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { @@ -914,8 +914,8 @@ this.enemies = this.enemies.reduce( if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'enemyLifetimeReached', enemy : enemy diff --git a/a2xc0lrac8.js b/a2xc0lrac8.js index 05383a7..fa8b60d 100644 --- a/a2xc0lrac8.js +++ b/a2xc0lrac8.js @@ -5,54 +5,54 @@ if (data.entity === this.parentEntity) { /** * Custom Code Components */ -this.ccBeforeRender = GameLib.EntityManager.Instance.findComponentById('huvjkw0lj3'); -this.ccKeyDown = GameLib.EntityManager.Instance.findComponentById('rye7qm3207'); -this.ccTouchStart = GameLib.EntityManager.Instance.findComponentById('ul1ahlwhey'); -this.ccTouchEnd = GameLib.EntityManager.Instance.findComponentById('sp1vcnd2nx'); +this.ccBeforeRender = R3.EntityManager.Instance.findComponentById('huvjkw0lj3'); +this.ccKeyDown = R3.EntityManager.Instance.findComponentById('rye7qm3207'); +this.ccTouchStart = R3.EntityManager.Instance.findComponentById('ul1ahlwhey'); +this.ccTouchEnd = R3.EntityManager.Instance.findComponentById('sp1vcnd2nx'); /** * Images */ -this.image_0 = GameLib.EntityManager.Instance.findComponentById('89p275wk2c'); -this.image_1 = GameLib.EntityManager.Instance.findComponentById('5rdjyn8gpy'); -this.image_2 = GameLib.EntityManager.Instance.findComponentById('1ty0dxd7u9'); -this.image_3 = GameLib.EntityManager.Instance.findComponentById('m9n2g7iffw'); -this.image_4 = GameLib.EntityManager.Instance.findComponentById('uf39omh133'); -this.image_5 = GameLib.EntityManager.Instance.findComponentById('3hwasqx12d'); -this.image_6 = GameLib.EntityManager.Instance.findComponentById('m0l1ibniqg'); -this.image_glow = GameLib.EntityManager.Instance.findComponentById('oxvtu4w1ve'); -this.image_flames_small = GameLib.EntityManager.Instance.findComponentById('a875nyshy2'); +this.image_0 = R3.EntityManager.Instance.findComponentById('89p275wk2c'); +this.image_1 = R3.EntityManager.Instance.findComponentById('5rdjyn8gpy'); +this.image_2 = R3.EntityManager.Instance.findComponentById('1ty0dxd7u9'); +this.image_3 = R3.EntityManager.Instance.findComponentById('m9n2g7iffw'); +this.image_4 = R3.EntityManager.Instance.findComponentById('uf39omh133'); +this.image_5 = R3.EntityManager.Instance.findComponentById('3hwasqx12d'); +this.image_6 = R3.EntityManager.Instance.findComponentById('m0l1ibniqg'); +this.image_glow = R3.EntityManager.Instance.findComponentById('oxvtu4w1ve'); +this.image_flames_small = R3.EntityManager.Instance.findComponentById('a875nyshy2'); /** * Scene */ -this.scene = GameLib.EntityManager.Instance.findComponentById('rqyrff39d5'); +this.scene = R3.EntityManager.Instance.findComponentById('rqyrff39d5'); /** * Materials */ -this.gridMaterial = GameLib.EntityManager.Instance.findComponentById('mxt0npy5we'); +this.gridMaterial = R3.EntityManager.Instance.findComponentById('mxt0npy5we'); /** * Score */ -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('zflt4fjdlp'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('hksgydkrg8'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('zflt4fjdlp'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('hksgydkrg8'); /** * Animations */ -this.animation = GameLib.EntityManager.Instance.findComponentById('pg0pjclg4h'); +this.animation = R3.EntityManager.Instance.findComponentById('pg0pjclg4h'); /** * Lights */ -this.burnLight = GameLib.EntityManager.Instance.findComponentById('39o7zhf3ay'); +this.burnLight = R3.EntityManager.Instance.findComponentById('39o7zhf3ay'); /** * Textures */ -this.textureDisplacement = GameLib.EntityManager.Instance.findComponentById('pd8jzkpui5'); +this.textureDisplacement = R3.EntityManager.Instance.findComponentById('pd8jzkpui5'); /** * Initial Game Settings @@ -67,24 +67,24 @@ this.grid = []; this.gameOver = false; -GameLib.CustomCode.TETRIS_BLOCK_I = 0; -GameLib.CustomCode.TETRIS_BLOCK_L = 1; -GameLib.CustomCode.TETRIS_BLOCK_L2 = 2; -GameLib.CustomCode.TETRIS_BLOCK_Z = 3; -GameLib.CustomCode.TETRIS_BLOCK_Z2 = 4; -GameLib.CustomCode.TETRIS_BLOCK_T = 5; -GameLib.CustomCode.TETRIS_BLOCK_O = 6; -GameLib.CustomCode.TETRIS_BLOCK_MAX = 7; +R3.CustomCode.TETRIS_BLOCK_I = 0; +R3.CustomCode.TETRIS_BLOCK_L = 1; +R3.CustomCode.TETRIS_BLOCK_L2 = 2; +R3.CustomCode.TETRIS_BLOCK_Z = 3; +R3.CustomCode.TETRIS_BLOCK_Z2 = 4; +R3.CustomCode.TETRIS_BLOCK_T = 5; +R3.CustomCode.TETRIS_BLOCK_O = 6; +R3.CustomCode.TETRIS_BLOCK_MAX = 7; -GameLib.CustomCode.TETRIS_GRID_WIDTH = 11; -GameLib.CustomCode.TETRIS_GRID_HEIGHT = 24; -GameLib.CustomCode.TETRIS_GRID_HEADSPACE = 4; +R3.CustomCode.TETRIS_GRID_WIDTH = 11; +R3.CustomCode.TETRIS_GRID_HEIGHT = 24; +R3.CustomCode.TETRIS_GRID_HEADSPACE = 4; -GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; -GameLib.CustomCode.TETRIS_GRID_TAKEN = 1; -GameLib.CustomCode.TETRIS_GRID_DISAPPEARING = 2; +R3.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; +R3.CustomCode.TETRIS_GRID_TAKEN = 1; +R3.CustomCode.TETRIS_GRID_DISAPPEARING = 2; -GameLib.CustomCode.prototype.visualizeGrid = function (color) { +R3.CustomCode.prototype.visualizeGrid = function (color) { if (this.starsMesh) { this.scene.instance.remove(this.starsMesh); @@ -94,7 +94,7 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { for (var y = 0; y < this.grid.length; y++) { for (var x = 0; x < this.grid[y].length; x++) { - if (this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { this.starsGeometry.vertices.push( new THREE.Vector3( x, @@ -114,9 +114,9 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { }.bind(this) -GameLib.CustomCode.prototype.startAnimation = function (index) { +R3.CustomCode.prototype.startAnimation = function (index) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { var bacon = this.tile_bacon_disappearing.clone(); @@ -141,7 +141,7 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { glow.updateInstance('visible'); glow.position.y = index; - glow.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + glow.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; glow.position.z = 4; glow.updateInstance('position'); @@ -151,7 +151,7 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { flames.updateInstance('visible'); flames.position.y = index + 0.5; - flames.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + flames.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; flames.position.z = 5; flames.updateInstance('position'); @@ -163,8 +163,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { time: 0 } - animationObject.subscription = GameLib.Event.Subscribe( - GameLib.Event.BEFORE_RENDER, + animationObject.subscription = R3.Event.Subscribe( + R3.Event.BEFORE_RENDER, function (__animationObject) { return function (data) { __animationObject.time += data.delta * 4; @@ -196,15 +196,15 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { this.burnLight.intensity = 0; this.burnLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: __animationObject.glow } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: __animationObject.flames } @@ -215,8 +215,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { */ __animationObject.flamesArray.map( function (flame) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: flame } @@ -227,21 +227,21 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { /** * Remove the meshes and the baconDisappearing objects */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (!this.grid[__animationObject.rowNumber][x].mesh) { throw new Error('mesh should exist but does not'); } - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[__animationObject.rowNumber][x].mesh } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[__animationObject.rowNumber][x].baconDisappearing } @@ -256,10 +256,10 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { var row = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { row.push( { - value: GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value: R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh: null } ) @@ -270,8 +270,8 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { /** * Now - drop all blocks above the current index down one row */ - for (var y = __animationObject.rowNumber; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = __animationObject.rowNumber; y < R3.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (this.grid[y][x].mesh) { this.grid[y][x].mesh.position.y = y; @@ -327,18 +327,18 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { this.animationObjects.push(animationObject); }.bind(this) -GameLib.CustomCode.prototype.removeLines = function () { +R3.CustomCode.prototype.removeLines = function () { var indices = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { var line = true; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN || - this.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING + this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_NOT_TAKEN || + this.grid[y][x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING ) { line = false; } @@ -447,8 +447,8 @@ GameLib.CustomCode.prototype.removeLines = function () { indices.map( function (index) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { - this.grid[index][x].value = GameLib.CustomCode.TETRIS_GRID_DISAPPEARING; + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { + this.grid[index][x].value = R3.CustomCode.TETRIS_GRID_DISAPPEARING; } this.startAnimation(index); }.bind(this) @@ -457,7 +457,7 @@ GameLib.CustomCode.prototype.removeLines = function () { }.bind(this); -GameLib.CustomCode.prototype.drawStatus = function () { +R3.CustomCode.prototype.drawStatus = function () { var context = this.scoreCanvas.instance.getContext('2d'); context.textBaseline = "middle"; @@ -532,7 +532,7 @@ GameLib.CustomCode.prototype.drawStatus = function () { this.scoreTexture.instance.needsUpdate = true; }.bind(this) -GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { +R3.CustomCode.prototype.getBlockGridPositions = function (block) { var object = new THREE.Mesh(); @@ -582,14 +582,14 @@ GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { }.bind(this); -GameLib.CustomCode.prototype.drawGrid = function () { +R3.CustomCode.prototype.drawGrid = function () { var geometry = new THREE.BufferGeometry(); var points = []; - for (var y = 0; y < (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE); y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = 0; y < (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE); y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { points.push(x, y, 2); } } @@ -603,7 +603,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { geometry.vertices.push( new THREE.Vector3( -0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ), new THREE.Vector3( @@ -612,13 +612,13 @@ GameLib.CustomCode.prototype.drawGrid = function () { 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, -0.5, 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ) ); @@ -638,7 +638,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { }.bind(this) -GameLib.CustomCode.prototype.checkBoundaries = function (block) { +R3.CustomCode.prototype.checkBoundaries = function (block) { /** * collisions are true only for out of bounds indexes, and if the current block is taken @@ -662,7 +662,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { leftHit = true; } - if (position.x === (GameLib.CustomCode.TETRIS_GRID_WIDTH - 1)) { + if (position.x === (R3.CustomCode.TETRIS_GRID_WIDTH - 1)) { rightHit = true; } @@ -670,7 +670,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { bottomHit = true; } - if (position.y === (GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1)) { + if (position.y === (R3.CustomCode.TETRIS_GRID_HEIGHT - 1)) { topHit = true; } @@ -681,7 +681,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.x >= GameLib.CustomCode.TETRIS_GRID_WIDTH) { + if (position.x >= R3.CustomCode.TETRIS_GRID_WIDTH) { collision = true; } @@ -689,7 +689,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.y >= GameLib.CustomCode.TETRIS_GRID_HEIGHT) { + if (position.y >= R3.CustomCode.TETRIS_GRID_HEIGHT) { collision = true; } @@ -698,14 +698,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * be sure x+1 is inside bounds */ if ( - ((position.x + 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) && + ((position.x + 1) < R3.CustomCode.TETRIS_GRID_WIDTH) && ((position.x + 1) >= 0) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.grid[position.y][position.x + 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.grid[position.y][position.x + 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - we found a block to the right - its over */ @@ -721,14 +721,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.x) > 0) && ((position.x - 1) >= 0) && - ((position.x - 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) + ((position.x - 1) < R3.CustomCode.TETRIS_GRID_WIDTH) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.grid[position.y][position.x - 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.grid[position.y][position.x - 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * We found a block to the left - its over also */ @@ -741,15 +741,15 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * Now we want to see if the block above is taken, we cannot be sure y+1 is inside bounds */ if ( - ((position.y + 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) && + ((position.y + 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) && ((position.y + 1) >= 0) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.grid[position.y + 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[position.y + 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block is at the top */ @@ -764,20 +764,20 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.y) > 0) && ((position.y - 1) >= 0) && - ((position.y - 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) + ((position.y - 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (this.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block hit bottom */ bottomHit = true; } - if (this.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING) { + if (this.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING) { bottomDisappearing = true; } } @@ -788,10 +788,10 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * we cannot be sure, x and y is inside bounds */ if ( - (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && - (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) + (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && + (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) ) { - if (this.grid[position.y][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.grid[position.y][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { collision = true; } } @@ -809,7 +809,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { }.bind(this) -GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { +R3.CustomCode.prototype.rotateBlock = function (clockwise) { if (this.gameOver) { return; @@ -858,9 +858,9 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { }.bind(this); -GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { +R3.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { - if (GameLib.Utils.UndefinedOrNull(block)) { + if (R3.Utils.UndefinedOrNull(block)) { block = this.block; } @@ -927,7 +927,7 @@ GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, coll return moved; }.bind(this); -GameLib.CustomCode.prototype.spawnBlock = function () { +R3.CustomCode.prototype.spawnBlock = function () { var blockType = Math.floor(Math.random() * 7); @@ -954,7 +954,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { center.position.x = 0; center.position.z = 3.5; - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_I) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_I) { mesh0 = this.tile_4.clone(); mesh0.position.setFrom(center.position); @@ -986,7 +986,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.5; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1018,7 +1018,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L2) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1050,7 +1050,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1081,7 +1081,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z2) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); @@ -1113,7 +1113,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_T) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_T) { mesh0 = this.tile_6.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1143,7 +1143,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 16; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_O) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_O) { mesh0 = this.tile_3.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1234,7 +1234,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { }.bind(this) -GameLib.CustomCode.prototype.spawnTinyBlock = function () { +R3.CustomCode.prototype.spawnTinyBlock = function () { var block = this.spawnBlock(); @@ -1257,7 +1257,7 @@ GameLib.CustomCode.prototype.spawnTinyBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnNextBlock = function () { +R3.CustomCode.prototype.spawnNextBlock = function () { if (!this.tinyBlock) { this.tinyBlock = this.spawnTinyBlock(); @@ -1280,7 +1280,7 @@ GameLib.CustomCode.prototype.spawnNextBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnBigBlock = function () { +R3.CustomCode.prototype.spawnBigBlock = function () { if (!this.nextBlock) { this.nextBlock = this.spawnNextBlock(); @@ -1296,8 +1296,8 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { block.center.position.x = 0; block.center.position.y = 0; block.center.position.z = 2.5; - this.moveBlock(block, {up: true}, (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE), false); - this.moveBlock(block, {right: true}, GameLib.CustomCode.TETRIS_GRID_WIDTH / 2, false); + this.moveBlock(block, {up: true}, (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE), false); + this.moveBlock(block, {right: true}, R3.CustomCode.TETRIS_GRID_WIDTH / 2, false); this.moveBlock(block, {left: true}, block.offset.x, false); this.moveBlock(block, {down: true}, block.offset.y, false); block.center.updateInstance('position'); @@ -1307,12 +1307,12 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.getNextBlock = function () { +R3.CustomCode.prototype.getNextBlock = function () { this.block = this.spawnBigBlock(); - GameLib.Event.Emit( - GameLib.Event.COMPONENT_REGISTER, + R3.Event.Emit( + R3.Event.COMPONENT_REGISTER, { component: this.block.center } @@ -1325,7 +1325,7 @@ GameLib.CustomCode.prototype.getNextBlock = function () { /** * This code executes when the 'bottom' has been reached (the block is stopping) */ -GameLib.CustomCode.prototype.stopBlock = function() { +R3.CustomCode.prototype.stopBlock = function() { var gridPositions = this.getBlockGridPositions(this.block); @@ -1346,7 +1346,7 @@ GameLib.CustomCode.prototype.stopBlock = function() { } block = { - value : GameLib.CustomCode.TETRIS_GRID_TAKEN, + value : R3.CustomCode.TETRIS_GRID_TAKEN, mesh : position.mesh, baconDisappearing : null } @@ -1381,8 +1381,8 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * We remove the controlling block */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -1398,13 +1398,13 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * Check if the game is over */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[19][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[20][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[21][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[22][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[23][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN + this.grid[19][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[20][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[21][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[22][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[23][x].value === R3.CustomCode.TETRIS_GRID_TAKEN ) { this.gameOver = true; } @@ -1415,8 +1415,8 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * End the game if game over */ - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { score: this.score, level: this.level, @@ -1437,7 +1437,7 @@ GameLib.CustomCode.prototype.stopBlock = function() { /** * Clears the grid */ -GameLib.CustomCode.prototype.clearGrid = function() { +R3.CustomCode.prototype.clearGrid = function() { /** * Remove all stale components (if any) @@ -1463,11 +1463,11 @@ GameLib.CustomCode.prototype.clearGrid = function() { * Initialize the grid */ this.grid = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { this.grid[y] = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { this.grid[y][x] = { - value : GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value : R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh : null, baconDisappearing : null }; @@ -1476,13 +1476,13 @@ GameLib.CustomCode.prototype.clearGrid = function() { }.bind(this) -GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace) { +R3.CustomCode.prototype.createTile = function(tileName, imageName, displace) { var apiMaterial; if (imageName) { if (displace) { - apiMaterial = new GameLib.D3.API.Material.Phong( + apiMaterial = new R3.D3.API.Material.Phong( null, null, null, @@ -1500,13 +1500,13 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace null, null, null, - new GameLib.D3.API.Texture.Image( + new R3.D3.API.Texture.Image( null, this[imageName] ) ) } else { - apiMaterial = new GameLib.D3.API.Material.Phong( + apiMaterial = new R3.D3.API.Material.Phong( null, null, null, @@ -1524,24 +1524,24 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace null, null, null, - new GameLib.D3.API.Texture.Image( + new R3.D3.API.Texture.Image( null, this[imageName] ) ) } } else { - apiMaterial = new GameLib.D3.API.Material.Phong(); + apiMaterial = new R3.D3.API.Material.Phong(); } - this[tileName] = new GameLib.D3.Mesh( + this[tileName] = new R3.D3.Mesh( this.graphics, - new GameLib.D3.API.Mesh( + new R3.D3.API.Mesh( null, null, null, null, - new GameLib.D3.API.Geometry.Buffer.Plane( + new R3.D3.API.Geometry.Buffer.Plane( null, 1, 1, @@ -1566,8 +1566,8 @@ GameLib.CustomCode.prototype.createTile = function(tileName, imageName, displace }.bind(this); -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function () { @@ -1593,8 +1593,8 @@ GameLib.Event.Subscribe( if (this.block && this.block.center) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -1604,8 +1604,8 @@ GameLib.Event.Subscribe( if (this.block && this.block.meshes) { this.block.meshes.map( function (mesh) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: mesh } @@ -1642,8 +1642,8 @@ GameLib.Event.Subscribe( }.bind(this) ); -GameLib.Event.Emit( - GameLib.Event.GET_RUNTIME, +R3.Event.Emit( + R3.Event.GET_RUNTIME, {}, function(runtime) { @@ -1695,7 +1695,7 @@ GameLib.Event.Emit( this.drawGrid(); this.drawStatus(); - GameLib.Event.Emit(GameLib.Event.GAME_LOADED); + R3.Event.Emit(R3.Event.GAME_LOADED); }.bind(this) ) diff --git a/abw1ga2etc.js b/abw1ga2etc.js index 8fa464e..1cbc8c9 100644 --- a/abw1ga2etc.js +++ b/abw1ga2etc.js @@ -30,8 +30,8 @@ var result = number - remainder; this.cylinder.rotation.x += result - 0.4488; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Select' } diff --git a/af6rt2k8an.js b/af6rt2k8an.js index fde585c..8c1444e 100644 --- a/af6rt2k8an.js +++ b/af6rt2k8an.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/ahm5t3rg19.js b/ahm5t3rg19.js index 832050c..ac81872 100644 --- a/ahm5t3rg19.js +++ b/ahm5t3rg19.js @@ -21,18 +21,18 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); -this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, +this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); if (this.subscription) { this.subscription.remove(); this.subscription = null; diff --git a/airpllbqpu.js b/airpllbqpu.js index cfff51d..0bab02b 100644 --- a/airpllbqpu.js +++ b/airpllbqpu.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/autqzs1rvq.js b/autqzs1rvq.js index c30da77..0377639 100644 --- a/autqzs1rvq.js +++ b/autqzs1rvq.js @@ -2,14 +2,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } @@ -19,14 +19,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1,5); + var play = R3.Utils.GetRandomIntInclusive(1,5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -71,7 +71,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.kanister.instance.visible = false; this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -129,8 +129,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore : this.kanisterSpawnScore @@ -179,8 +179,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -211,8 +211,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level +', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level : this.level, enemySpawnInterval : this.enemySpawnInterval, @@ -224,8 +224,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function(kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); if (kanister) { meshType = 6; @@ -234,7 +234,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -285,15 +285,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -372,8 +372,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -391,8 +391,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -409,7 +409,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -421,8 +421,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -490,8 +490,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'scoreUpdate', score : this.score @@ -502,8 +502,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnKanister(); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyExploded' @@ -526,8 +526,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('burning enemy ' + mesh.name); enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyBurned' @@ -540,8 +540,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { smokeParticleEngine.enabled = true; mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -563,15 +563,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -617,8 +617,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameRunning', message : 'we have enough trees burning now to start - the enemy will spawn now' @@ -626,8 +626,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'treeBurned', treesBurning : this.treesBurning, @@ -663,8 +663,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -679,8 +679,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game : this } @@ -742,7 +742,7 @@ if (this.mouseIsDown) } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -784,7 +784,7 @@ if (this.mouseIsDown) /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -824,8 +824,8 @@ else var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'fuelUsed', used : used, @@ -839,8 +839,8 @@ if (this.kanisterTime > this.kanisterLife) { this.kanisterTime = 0; this.kanisters -= 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -848,8 +848,8 @@ if (this.kanisterTime > this.kanisterLife) { ); if (this.kanisters < 0) { - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game : this } @@ -864,7 +864,7 @@ if (this.enemySpawnTime > this.enemySpawnInterval && this.running) { // // if (this.kanister.explodeParticleEngine) { -// if (GameLib.Utils.UndefinedOrNull(this.kanister.waiting)) { +// if (R3.Utils.UndefinedOrNull(this.kanister.waiting)) { // this.kanister.waiting = true; // } else { // this.kanister.explodeParticleEngine.remove(); @@ -878,8 +878,8 @@ if (this.enemySpawnTime > this.enemySpawnInterval && this.running) { // this.kanister.visible = true; // this.kanister.updateInstance('visible'); // -// GameLib.Event.Emit( -// GameLib.Event.GAME_DATA, +// R3.Event.Emit( +// R3.Event.GAME_DATA, // { // event : 'kanisterAppeared' // } @@ -894,7 +894,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { @@ -914,8 +914,8 @@ this.enemies = this.enemies.reduce( if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'enemyLifetimeReached', enemy : enemy diff --git a/b8gasgkbnl.js b/b8gasgkbnl.js index 6440feb..8d6251c 100644 --- a/b8gasgkbnl.js +++ b/b8gasgkbnl.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/bh0rnxq01q.js b/bh0rnxq01q.js index 601b6a5..58c6440 100644 --- a/bh0rnxq01q.js +++ b/bh0rnxq01q.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -36,8 +36,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -45,7 +45,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -55,10 +55,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -97,15 +97,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -330,15 +330,15 @@ this.enemies = this.enemies.reduce( /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/bwrgfra6bd.js b/bwrgfra6bd.js index 3a001f9..11857cf 100644 --- a/bwrgfra6bd.js +++ b/bwrgfra6bd.js @@ -4,14 +4,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Xmas' } @@ -21,14 +21,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function (data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1, 5); + var play = R3.Utils.GetRandomIntInclusive(1, 5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Ho ho ho' } @@ -76,7 +76,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -110,7 +110,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } if (this.score > 5000) { - var dice = GameLib.Utils.GetRandomIntInclusive(1, 10); + var dice = R3.Utils.GetRandomIntInclusive(1, 10); /** * Max average spawn = 5.41 @@ -126,8 +126,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore: this.kanisterSpawnScore @@ -173,8 +173,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function (graphics) { this.graphics = graphics @@ -207,8 +207,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level + ', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level: this.level, enemySpawnInterval: this.enemySpawnInterval, @@ -235,14 +235,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function (kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); var meshTypeIndex; if (kanister) { meshTypeIndex = 6; } else { - meshTypeIndex = GameLib.Utils.GetRandomIntInclusive(1, 5); + meshTypeIndex = R3.Utils.GetRandomIntInclusive(1, 5); } var meshType = null; @@ -300,8 +300,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'kanisterCountUpdate', kanisters: this.kanisters @@ -313,19 +313,19 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1, + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1, + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1, 100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1, 100) * 0.001; var position = {x: 0, y: y, z: 0}; @@ -408,8 +408,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { if (kanister) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -454,7 +454,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1, 3); + var sound = R3.Utils.GetRandomIntInclusive(1, 3); var name = 'Audio - Blast 1'; @@ -472,8 +472,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.explodeParticleEngine.updateInstance('position'); mesh.explodeParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: name } @@ -500,8 +500,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemiesExploded += 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy: mesh.enemy, event: 'enemyExploded' @@ -514,8 +514,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'scoreUpdate', score: this.score @@ -534,8 +534,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy: mesh.enemy, event: 'enemyBurned' @@ -554,8 +554,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.fireParticleEngine.updateInstance('position'); mesh.fireParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Burning' } @@ -610,8 +610,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'gameRunning', message: 'we have enough trees burning now to start - the enemy will spawn now' @@ -619,8 +619,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'treeBurned', treesBurning: this.treesBurning, @@ -658,8 +658,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.burningTreeParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Burning' } @@ -667,8 +667,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game: this } @@ -767,7 +767,7 @@ if (this.mouseIsDown) { /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.burnLife)) { + if (R3.Utils.UndefinedOrNull(mesh.burnLife)) { mesh.burnLife = 1; mesh.burning = false; } @@ -813,8 +813,8 @@ else { var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'fuelUsed', used: used, @@ -830,8 +830,8 @@ if (this.kanisterTime > this.kanisterLife) { console.log('kanister count: ' + this.kanisters); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'kanisterCountUpdate', kanisters: this.kanisters @@ -840,8 +840,8 @@ if (this.kanisterTime > this.kanisterLife) { if (this.kanisters < 0) { console.log('no more kanisters'); - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game: this } @@ -874,8 +874,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'enemyLifetimeReached', enemy: enemy @@ -895,7 +895,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { diff --git a/c55930et90.js b/c55930et90.js index a72560d..778a90a 100644 --- a/c55930et90.js +++ b/c55930et90.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/c7jkwjdjbk.js b/c7jkwjdjbk.js index 0fce5d9..0f9c47f 100644 --- a/c7jkwjdjbk.js +++ b/c7jkwjdjbk.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -var particleEngine = GameLib.EntityManager.Instance.findComponentById('cd9s9xhs4e'); +var particleEngine = R3.EntityManager.Instance.findComponentById('cd9s9xhs4e'); particleEngine.enabled = false; diff --git a/cb8a4ufbui.js b/cb8a4ufbui.js index 0f99e27..977bfa3 100644 --- a/cb8a4ufbui.js +++ b/cb8a4ufbui.js @@ -1,8 +1,8 @@ if (this.parentEntity === data.entity) { console.log('Entity SpoonLib Loaded'); - this.mouseMove = GameLib.EntityManager.Instance.findComponentById('stiq4tf18d'); - this.camera = GameLib.EntityManager.Instance.findComponentById('i32ckmfmh8'); + this.mouseMove = R3.EntityManager.Instance.findComponentById('stiq4tf18d'); + this.camera = R3.EntityManager.Instance.findComponentById('i32ckmfmh8'); this.mouseMove.entityLoaded = this; } diff --git a/cgw7pwx0jg.js b/cgw7pwx0jg.js index 4ea9a75..5a8dbad 100644 --- a/cgw7pwx0jg.js +++ b/cgw7pwx0jg.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } @@ -10,8 +10,8 @@ var units = Math.floor(max / 150) + 1; if (typeof max === 'number') { if (max < 5) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -20,8 +20,8 @@ if (typeof max === 'number') { if (max === touch.left) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowLeft' } @@ -31,8 +31,8 @@ if (typeof max === 'number') { if (max === touch.right) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowRight' } @@ -41,8 +41,8 @@ if (typeof max === 'number') { } if (max === touch.up) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -50,8 +50,8 @@ if (typeof max === 'number') { } if (max === touch.down) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'Space' } diff --git a/cnn8o15h2g.js b/cnn8o15h2g.js index a72560d..778a90a 100644 --- a/cnn8o15h2g.js +++ b/cnn8o15h2g.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/d5o2axpc0m.js b/d5o2axpc0m.js index 832050c..ac81872 100644 --- a/d5o2axpc0m.js +++ b/d5o2axpc0m.js @@ -21,18 +21,18 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); -this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, +this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); if (this.subscription) { this.subscription.remove(); this.subscription = null; diff --git a/d948b2nzeb.js b/d948b2nzeb.js index 2d5fada..6a28e36 100644 --- a/d948b2nzeb.js +++ b/d948b2nzeb.js @@ -6,46 +6,46 @@ if (this.parentEntity === data.entity) { this.enemies = []; -var particle = GameLib.EntityManager.Instance.findComponentById('6nywmzxido'); +var particle = R3.EntityManager.Instance.findComponentById('6nywmzxido'); particle.instance.visible = false; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('92p3h03t2s'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('92p3h03t2s'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('5vrq8rxgse'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('5vrq8rxgse'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('e555yvlbo0'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('e555yvlbo0'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('8d5c3jt4rz'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('8d5c3jt4rz'); this.mouseMove.entityLoaded = this; /** * Create references to all our 'in game' objects */ -this.bull = GameLib.EntityManager.Instance.findComponentById('4v2gexxoni'); -this.star = GameLib.EntityManager.Instance.findComponentById('aw3m3rb2h6'); -this.burger = GameLib.EntityManager.Instance.findComponentById('viqmhvhaon'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('rjtxfdh2lt'); +this.bull = R3.EntityManager.Instance.findComponentById('4v2gexxoni'); +this.star = R3.EntityManager.Instance.findComponentById('aw3m3rb2h6'); +this.burger = R3.EntityManager.Instance.findComponentById('viqmhvhaon'); +this.parcel = R3.EntityManager.Instance.findComponentById('rjtxfdh2lt'); /** * Plant all our trees */ -var treeSmall = GameLib.EntityManager.Instance.findComponentById('s1j9llsp5t'); -var treeMedium = GameLib.EntityManager.Instance.findComponentById('7i8gm25uvw'); -var treeLarge = GameLib.EntityManager.Instance.findComponentById('m37a5dj3ae'); -var stone1 = GameLib.EntityManager.Instance.findComponentById('tou8hi2nel'); -var stone2 = GameLib.EntityManager.Instance.findComponentById('mbux2d9vzq'); +var treeSmall = R3.EntityManager.Instance.findComponentById('s1j9llsp5t'); +var treeMedium = R3.EntityManager.Instance.findComponentById('7i8gm25uvw'); +var treeLarge = R3.EntityManager.Instance.findComponentById('m37a5dj3ae'); +var stone1 = R3.EntityManager.Instance.findComponentById('tou8hi2nel'); +var stone2 = R3.EntityManager.Instance.findComponentById('mbux2d9vzq'); mesh = stone2.clone(); mesh.position.x = 46.52; diff --git a/dgscoensvf.js b/dgscoensvf.js index cfff51d..0bab02b 100644 --- a/dgscoensvf.js +++ b/dgscoensvf.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/dwln7lp0w9.js b/dwln7lp0w9.js index 8609b78..ea4ddda 100644 --- a/dwln7lp0w9.js +++ b/dwln7lp0w9.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/dysneuk1ox.js b/dysneuk1ox.js index 8705111..ba1f93c 100644 --- a/dysneuk1ox.js +++ b/dysneuk1ox.js @@ -1,4 +1,4 @@ -var texture = GameLib.EntityManager.Instance.findComponentById('gm3fvv45dl'); +var texture = R3.EntityManager.Instance.findComponentById('gm3fvv45dl'); if (!texture) { return; diff --git a/dywmtohrda.js b/dywmtohrda.js index 2a0fa2c..b3bae2e 100644 --- a/dywmtohrda.js +++ b/dywmtohrda.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { /** * This component is not ready to run @@ -7,12 +7,12 @@ if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { } if ( - GameLib.Utils.UndefinedOrNull(this.totalTime) || - GameLib.Utils.UndefinedOrNull(this.spawnTime) || - GameLib.Utils.UndefinedOrNull(this.spawnBulletFrequency) || - GameLib.Utils.UndefinedOrNull(this.camera) || - GameLib.Utils.UndefinedOrNull(this.scene) || - GameLib.Utils.UndefinedOrNull(this.sceneCrosshair) + R3.Utils.UndefinedOrNull(this.totalTime) || + R3.Utils.UndefinedOrNull(this.spawnTime) || + R3.Utils.UndefinedOrNull(this.spawnBulletFrequency) || + R3.Utils.UndefinedOrNull(this.camera) || + R3.Utils.UndefinedOrNull(this.scene) || + R3.Utils.UndefinedOrNull(this.sceneCrosshair) //|| true ) { @@ -25,8 +25,8 @@ if ( this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -34,21 +34,21 @@ if ( ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( - GameLib.D3.CustomCode.MIN_SPAWN_TIME, - GameLib.D3.CustomCode.MAX_SPAWN_TIME + return R3.Utils.GetRandomIntInclusive( + R3.D3.CustomCode.MIN_SPAWN_TIME, + R3.D3.CustomCode.MAX_SPAWN_TIME ); } - this.boxMaterial = GameLib.EntityManager.Instance.findComponentById('dsaua5t19a'); + this.boxMaterial = R3.EntityManager.Instance.findComponentById('dsaua5t19a'); - this.tree = GameLib.EntityManager.Instance.findComponentById('fcj62ukx5s'); + this.tree = R3.EntityManager.Instance.findComponentById('fcj62ukx5s'); - this.camera = GameLib.EntityManager.Instance.findComponentById('yv62w8sx9r'); - this.scene = GameLib.EntityManager.Instance.findComponentById('fd2be8y1c8'); - this.sceneCrosshair = GameLib.EntityManager.Instance.findComponentById('7xkcp6x9pf'); - this.meshCrosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); - this.meshFireBall = GameLib.EntityManager.Instance.findComponentById('zmcwqlym5y'); + this.camera = R3.EntityManager.Instance.findComponentById('yv62w8sx9r'); + this.scene = R3.EntityManager.Instance.findComponentById('fd2be8y1c8'); + this.sceneCrosshair = R3.EntityManager.Instance.findComponentById('7xkcp6x9pf'); + this.meshCrosshair = R3.EntityManager.Instance.findComponentById('oxpg88pgzv'); + this.meshFireBall = R3.EntityManager.Instance.findComponentById('zmcwqlym5y'); this.flames = []; @@ -74,11 +74,11 @@ if ( var y = Math.floor((Math.random() * 40) + 2); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; - var box = new GameLib.D3.Mesh.Box(this.graphics, apiBox, 4,4,4); + var box = new R3.D3.Mesh.Box(this.graphics, apiBox, 4,4,4); var velocity = null; @@ -203,7 +203,7 @@ if (this.spawningBullets === true) { ); var intersects = raycaster.intersectObjects( - GameLib.EntityManager.Instance.queryComponents(GameLib.D3.Mesh).map( + R3.EntityManager.Instance.queryComponents(R3.D3.Mesh).map( function(mesh){ return mesh.instance; } @@ -245,8 +245,8 @@ this.enemies = this.enemies.reduce( enemy.mesh.updateInstancePosition(); enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/e555yvlbo0.js b/e555yvlbo0.js index ff7c90f..feaddb6 100644 --- a/e555yvlbo0.js +++ b/e555yvlbo0.js @@ -5,7 +5,7 @@ if (!this.entityLoaded) { /** * First we find our crosshair */ -var crosshair = GameLib.EntityManager.Instance.findComponentById('aj7cby3brc'); +var crosshair = R3.EntityManager.Instance.findComponentById('aj7cby3brc'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -20,11 +20,11 @@ particle.position.applyMatrix4( mInverse ); -var particleEngine = GameLib.EntityManager.Instance.findComponentById('xcnso20er9'); -var particle = GameLib.EntityManager.Instance.findComponentById('6nywmzxido'); +var particleEngine = R3.EntityManager.Instance.findComponentById('xcnso20er9'); +var particle = R3.EntityManager.Instance.findComponentById('6nywmzxido'); -var flamethrower = GameLib.EntityManager.Instance.findComponentById('32a4ii2ixu'); -var worldCamera = GameLib.EntityManager.Instance.findComponentById('r38gjp0opa'); +var flamethrower = R3.EntityManager.Instance.findComponentById('32a4ii2ixu'); +var worldCamera = R3.EntityManager.Instance.findComponentById('r38gjp0opa'); var end = ; diff --git a/enb2zrptsu.js b/enb2zrptsu.js index 924d99d..e75fb2e 100644 --- a/enb2zrptsu.js +++ b/enb2zrptsu.js @@ -10,68 +10,68 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; -GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE = 5; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.OBJECT_BUFFER_SIZE = 5; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('zld60yv0en') -this.bull = GameLib.EntityManager.Instance.findComponentById('2z7ztb2z95'); -this.star = GameLib.EntityManager.Instance.findComponentById('e42x936op7'); -this.burger = GameLib.EntityManager.Instance.findComponentById('swtg4s3c8w'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('e8nxn6e0mn'); -this.santa = GameLib.EntityManager.Instance.findComponentById('15xvfsnm59'); -this.camera = GameLib.EntityManager.Instance.findComponentById('pmu94nhh0v'); -this.scene = GameLib.EntityManager.Instance.findComponentById('sxlu6v7ml2'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('g53q3x9ezq'); -this.dom = GameLib.EntityManager.Instance.findComponentById('wm5c2sixt4'); +this.fog = R3.EntityManager.Instance.findComponentById('zld60yv0en') +this.bull = R3.EntityManager.Instance.findComponentById('2z7ztb2z95'); +this.star = R3.EntityManager.Instance.findComponentById('e42x936op7'); +this.burger = R3.EntityManager.Instance.findComponentById('swtg4s3c8w'); +this.parcel = R3.EntityManager.Instance.findComponentById('e8nxn6e0mn'); +this.santa = R3.EntityManager.Instance.findComponentById('15xvfsnm59'); +this.camera = R3.EntityManager.Instance.findComponentById('pmu94nhh0v'); +this.scene = R3.EntityManager.Instance.findComponentById('sxlu6v7ml2'); +this.cursor = R3.EntityManager.Instance.findComponentById('g53q3x9ezq'); +this.dom = R3.EntityManager.Instance.findComponentById('wm5c2sixt4'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('twmmm4fn2d'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('jkk66hlly4'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('tgcjolonpw'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('p8luxskfmp'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('2upmkfe1oc'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('lh9b2r6387'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('w8hur7sv7v'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('v2b635jlwg'); +this.renderer = R3.EntityManager.Instance.findComponentById('twmmm4fn2d'); +this.thrower = R3.EntityManager.Instance.findComponentById('jkk66hlly4'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('tgcjolonpw'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('p8luxskfmp'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('2upmkfe1oc'); +this.stone1 = R3.EntityManager.Instance.findComponentById('lh9b2r6387'); +this.stone2 = R3.EntityManager.Instance.findComponentById('w8hur7sv7v'); +this.kanister = R3.EntityManager.Instance.findComponentById('v2b635jlwg'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('mp5orikf3d'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('94h7iea42f'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('g79c5jahi0'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('w8c7gkzndp'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('ijf6aifk63'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('6rac8ntz4c'); +this.leftLight = R3.EntityManager.Instance.findComponentById('mp5orikf3d'); +this.rightLight = R3.EntityManager.Instance.findComponentById('94h7iea42f'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('g79c5jahi0'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('w8c7gkzndp'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('ijf6aifk63'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('6rac8ntz4c'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('1bvkk43xi7'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('0d8y39arbk'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('s4zrqm716j'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('xjbffo22em'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('nd8e7k93gr'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('1bvkk43xi7'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('0d8y39arbk'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('s4zrqm716j'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('xjbffo22em'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('nd8e7k93gr'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('w27q1qwixb'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('w27q1qwixb'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('jppoix9hqf'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('ym4wkwzzd1'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('i77xh957x4'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('t8tscvzq4e'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('lw8voyulf3'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('jppoix9hqf'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('ym4wkwzzd1'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('i77xh957x4'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('t8tscvzq4e'); +this.touchMove = R3.EntityManager.Instance.findComponentById('lw8voyulf3'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -86,8 +86,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -98,7 +98,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -164,27 +164,27 @@ this.createMesh = function(meshType) { ); }; -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('bull'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('star'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('burger'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('parcel'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('santa'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('kanister'); } @@ -1438,7 +1438,7 @@ burningTreeParticleEngine.position.y += mesh.dimensions.y + 5; burningTreeParticleEngine.updateInstance('position'); this.treeLarge.burningTreeParticleEngine = burningTreeParticleEngine; -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/eo8pf6o9st.js b/eo8pf6o9st.js index fde585c..8c1444e 100644 --- a/eo8pf6o9st.js +++ b/eo8pf6o9st.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/evwkow5289.js b/evwkow5289.js index 31d1377..7899f19 100644 --- a/evwkow5289.js +++ b/evwkow5289.js @@ -7,8 +7,8 @@ if (!this.initialized) { this.dom = this.entityLoaded.dom; - GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, + R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { this.size = data; this.x = this.size.width / 2; @@ -16,7 +16,7 @@ if (!this.initialized) { }.bind(this) ) - this.size = GameLib.Utils.GetWindowSize(); + this.size = R3.Utils.GetWindowSize(); this.x = this.size.width / 2; this.y = this.size.height / 2; @@ -66,8 +66,8 @@ this.y += Math.round(touch.down * sensitivity); // this.y = this.size.height; //} -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/f0m7ptlxf3.js b/f0m7ptlxf3.js index c9407ca..89e7d00 100644 --- a/f0m7ptlxf3.js +++ b/f0m7ptlxf3.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/f3jinliy1u.js b/f3jinliy1u.js index ccc55d8..8d65e41 100644 --- a/f3jinliy1u.js +++ b/f3jinliy1u.js @@ -22,7 +22,7 @@ ig.System.inject({ this.fps = fps; this.clock = new ig.Timer(); - this.canvas = GameLib.EntityManager.Instance.findComponentById('2km5mzakar').instance; + this.canvas = R3.EntityManager.Instance.findComponentById('2km5mzakar').instance; this.resize( width, height, scale ); this.context = this.canvas.getContext('2d'); @@ -72,7 +72,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/f8hfy0lj97.js b/f8hfy0lj97.js index 24a93bb..8da8d78 100644 --- a/f8hfy0lj97.js +++ b/f8hfy0lj97.js @@ -2,7 +2,7 @@ return; } - if (GameLib.Utils.UndefinedOrNull(this.initialized)) { + if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -81,16 +81,16 @@ this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameStarted', game : this } ); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -115,8 +115,8 @@ console.log('level : ' + this.level +', spawn interval : ' + this.spawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level : this.level, spawnInterval : this.spawnInterval, @@ -132,10 +132,10 @@ this.setLevelProperties(); - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -174,15 +174,15 @@ var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -255,8 +255,8 @@ enemy.explodingLife = 2; enemy.meshType = meshType; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned : this.enemiesSpawned, enemy : enemy, @@ -273,7 +273,7 @@ mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -285,8 +285,8 @@ name = 'Audio - Blast 3'; } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === name) { @@ -297,12 +297,12 @@ this.blastSubscription = null; - var play = GameLib.Utils.GetRandomIntInclusive(1,3); + var play = R3.Utils.GetRandomIntInclusive(1,3); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -313,8 +313,8 @@ }.bind(this) ); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -340,8 +340,8 @@ enemy.exploding = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { score : this.score, enemy : enemy, @@ -372,8 +372,8 @@ console.log('burning enemy ' + mesh.name); enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { score : this.score, enemy : enemy, @@ -387,8 +387,8 @@ smokeParticleEngine.enabled = true; mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -410,15 +410,15 @@ /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -459,8 +459,8 @@ this.treesBurning++; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'treeBurned', treesBurning : this.treesBurning @@ -495,8 +495,8 @@ } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -539,8 +539,8 @@ this.kanisterTime += data.delta; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { used : this.kanisterTime / this.kanisterLife, event : 'fuelUsed', @@ -552,8 +552,8 @@ if (this.kanisterTime > this.kanisterLife) { this.fuelFinished = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'fuelFinished' } @@ -588,7 +588,7 @@ } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -630,7 +630,7 @@ /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -672,7 +672,7 @@ if (this.kanister.explodeParticleEngine) { - if (GameLib.Utils.UndefinedOrNull(this.kanister.waiting)) { + if (R3.Utils.UndefinedOrNull(this.kanister.waiting)) { this.kanister.waiting = true; } else { this.kanister.explodeParticleEngine.remove(); @@ -686,8 +686,8 @@ this.kanister.visible = true; this.kanister.updateInstance('visible'); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterAppeared' } @@ -702,7 +702,7 @@ * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { @@ -722,8 +722,8 @@ if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'enemyLifetimeReached', enemy : enemy @@ -736,8 +736,8 @@ console.log('lives left: ' + this.lives); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { livesLeft : this.lives, event : 'lifeLost' @@ -746,15 +746,15 @@ if (this.lives < 0) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameOver', gameData : this } ); - GameLib.Event.Emit(GameLib.Event.GAME_OVER); + R3.Event.Emit(R3.Event.GAME_OVER); } } diff --git a/fhrajxd13y.js b/fhrajxd13y.js index b5f4aa2..39c6691 100644 --- a/fhrajxd13y.js +++ b/fhrajxd13y.js @@ -9,69 +9,69 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('yd37hbkh2u') -this.bull = GameLib.EntityManager.Instance.findComponentById('zgl68x3spr'); -this.star = GameLib.EntityManager.Instance.findComponentById('hgoyi0rxhb'); -this.burger = GameLib.EntityManager.Instance.findComponentById('wb2f3bn8s1'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('d96guz5nhs'); -this.santa = GameLib.EntityManager.Instance.findComponentById('7zxka13s31'); -this.camera = GameLib.EntityManager.Instance.findComponentById('hk0g45jl6t'); -this.scene = GameLib.EntityManager.Instance.findComponentById('qxdbjhklcj'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('ku3861qwrz'); +this.fog = R3.EntityManager.Instance.findComponentById('yd37hbkh2u') +this.bull = R3.EntityManager.Instance.findComponentById('zgl68x3spr'); +this.star = R3.EntityManager.Instance.findComponentById('hgoyi0rxhb'); +this.burger = R3.EntityManager.Instance.findComponentById('wb2f3bn8s1'); +this.parcel = R3.EntityManager.Instance.findComponentById('d96guz5nhs'); +this.santa = R3.EntityManager.Instance.findComponentById('7zxka13s31'); +this.camera = R3.EntityManager.Instance.findComponentById('hk0g45jl6t'); +this.scene = R3.EntityManager.Instance.findComponentById('qxdbjhklcj'); +this.cursor = R3.EntityManager.Instance.findComponentById('ku3861qwrz'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('tlx3bzh8pa'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('2ys7ylk9ei'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('6szgeawtec'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('mkhfpc3uip'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('tjtv3jsut3'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('4ojusegwih'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('z49fglxd1k'); +this.thrower = R3.EntityManager.Instance.findComponentById('tlx3bzh8pa'); +this.renderer = R3.EntityManager.Instance.findComponentById('2ys7ylk9ei'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('6szgeawtec'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('mkhfpc3uip'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('tjtv3jsut3'); +this.stone1 = R3.EntityManager.Instance.findComponentById('4ojusegwih'); +this.stone2 = R3.EntityManager.Instance.findComponentById('z49fglxd1k'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('518znfw685'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('cxa59hdcj8'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('5kr4y8fbfe'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('x609h0r0ub'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('hq7tz7v4we'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('518znfw685'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('cxa59hdcj8'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('5kr4y8fbfe'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('x609h0r0ub'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('hq7tz7v4we'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('9fa3zgrs7k'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('9fa3zgrs7k'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('to6trvr3fj'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('to6trvr3fj'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('nclnfk2gy8'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('nclnfk2gy8'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('ahm5t3rg19'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('ahm5t3rg19'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('ilfaa8svox'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('ilfaa8svox'); this.mouseMove.entityLoaded = this; -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +//R3.Event.Emit(R3.Event.MOUSE_UP); -GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } diff --git a/fs7e9y1lhh.js b/fs7e9y1lhh.js index 8609b78..ea4ddda 100644 --- a/fs7e9y1lhh.js +++ b/fs7e9y1lhh.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/fsilsam72g.js b/fsilsam72g.js index b6e6908..17ac50b 100644 --- a/fsilsam72g.js +++ b/fsilsam72g.js @@ -2,12 +2,12 @@ if (!this.entityLoaded) { return; } -var camera = GameLib.EntityManager.Instance.findComponentById('knwkksjc7n'); +var camera = R3.EntityManager.Instance.findComponentById('knwkksjc7n'); camera.lookAt.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025;//(window.clientWidth/ 2) + data.event.x; camera.lookAt.y = (((window.innerHeight / 2 - data.event.y)) * 0.05); camera.updateInstance(); -var cursorCamera = GameLib.EntityManager.Instance.findComponentById('b78qx660fo'); +var cursorCamera = R3.EntityManager.Instance.findComponentById('b78qx660fo'); var mousePosition = new THREE.Vector3( (-1 * (window.innerWidth / 2 - data.event.x)) , @@ -17,14 +17,14 @@ var mousePosition = new THREE.Vector3( mousePosition.unproject(cursorCamera.instance); -var cursor = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); +var cursor = R3.EntityManager.Instance.findComponentById('oxpg88pgzv'); cursor.position.x = mousePosition.x; cursor.position.y = mousePosition.y; //cursor.position.x = (-1 * (window.innerWidth / 2 - data.event.x)) * 0.025; //cursor.position.y = (((window.innerHeight / 2 - data.event.y)) * 0.05); cursor.updateInstance(); -var thrower = GameLib.EntityManager.Instance.findComponentById('01viz3rw6l'); +var thrower = R3.EntityManager.Instance.findComponentById('01viz3rw6l'); thrower.instance.lookAt( new THREE.Vector3( @@ -41,8 +41,8 @@ thrower.instance.lookAt( /** * First we find our crosshair */ -//var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); -var sphere = GameLib.EntityManager.Instance.findComponentById('dpol2u3xbm'); +//var crosshair = R3.EntityManager.Instance.findComponentById('oxpg88pgzv'); +var sphere = R3.EntityManager.Instance.findComponentById('dpol2u3xbm'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -81,7 +81,7 @@ raycaster.ray = new THREE.Ray( ); var intersects = raycaster.intersectObjects( - GameLib.EntityManager.Instance.queryComponents(GameLib.D3.Mesh).map( + R3.EntityManager.Instance.queryComponents(R3.D3.Mesh).map( function(mesh){ //mesh.instance.visible = true; mesh.instance.material.color.setHex(0xffffff); diff --git a/g6xexa5e4c.js b/g6xexa5e4c.js index 3dc2257..a123ddc 100644 --- a/g6xexa5e4c.js +++ b/g6xexa5e4c.js @@ -1,5 +1,5 @@ -this.topBall = GameLib.EntityManager.Instance.findComponentById('695azmtv94'); -this.bottomBall = GameLib.EntityManager.Instance.findComponentById('rseer60cqb'); +this.topBall = R3.EntityManager.Instance.findComponentById('695azmtv94'); +this.bottomBall = R3.EntityManager.Instance.findComponentById('rseer60cqb'); if (!this.initialized) { this.initialized = true; diff --git a/gcncpvsi9d.js b/gcncpvsi9d.js index f3af017..12d6ad1 100644 --- a/gcncpvsi9d.js +++ b/gcncpvsi9d.js @@ -1,5 +1,5 @@ this.spawnBullet = function() { - this.beforeRender = GameLib.EntityManager.Instance.findComponentById('dywmtohrda'); + this.beforeRender = R3.EntityManager.Instance.findComponentById('dywmtohrda'); this.beforeRender.spawnBulletTime = 0; this.beforeRender.spawningBullets = true; } diff --git a/gnz5wi7eqi.js b/gnz5wi7eqi.js index e373090..2b1ad13 100644 --- a/gnz5wi7eqi.js +++ b/gnz5wi7eqi.js @@ -9,48 +9,48 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('4jubz9thqn'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('4jubz9thqn'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('c7jkwjdjbk'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('c7jkwjdjbk'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('j1gg46ln21'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('j1gg46ln21'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('4rv4pr9m9q'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('4rv4pr9m9q'); this.mouseMove.entityLoaded = this; /** * Create references to all our 'in game' objects */ -this.bull = GameLib.EntityManager.Instance.findComponentById('g53xep7woq'); -this.star = GameLib.EntityManager.Instance.findComponentById('yc8489392s'); -this.burger = GameLib.EntityManager.Instance.findComponentById('d3lipkl5e6'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('uchnodlss4'); +this.bull = R3.EntityManager.Instance.findComponentById('g53xep7woq'); +this.star = R3.EntityManager.Instance.findComponentById('yc8489392s'); +this.burger = R3.EntityManager.Instance.findComponentById('d3lipkl5e6'); +this.parcel = R3.EntityManager.Instance.findComponentById('uchnodlss4'); -this.camera = GameLib.EntityManager.Instance.findComponentById('0ph5bo9dyi'); -this.scene = GameLib.EntityManager.Instance.findComponentById('tcoetu9g5k'); +this.camera = R3.EntityManager.Instance.findComponentById('0ph5bo9dyi'); +this.scene = R3.EntityManager.Instance.findComponentById('tcoetu9g5k'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('ah7gtz3mou'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('69a7qg3rkb'); +this.cursor = R3.EntityManager.Instance.findComponentById('ah7gtz3mou'); +this.thrower = R3.EntityManager.Instance.findComponentById('69a7qg3rkb'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Link some objects for MouseMove component @@ -65,12 +65,12 @@ this.mouseMove.thrower = this.thrower; /** * Plant all our trees */ -var treeSmall = GameLib.EntityManager.Instance.findComponentById('dpd0qnvrrp'); -var treeMedium = GameLib.EntityManager.Instance.findComponentById('n9tklzic0s'); -var treeLarge = GameLib.EntityManager.Instance.findComponentById('ib2wuwzild'); -var stone1 = GameLib.EntityManager.Instance.findComponentById('ig7vhdkoad'); -var stone2 = GameLib.EntityManager.Instance.findComponentById('bvkorlbttn'); -var materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('85ek16brbf'); +var treeSmall = R3.EntityManager.Instance.findComponentById('dpd0qnvrrp'); +var treeMedium = R3.EntityManager.Instance.findComponentById('n9tklzic0s'); +var treeLarge = R3.EntityManager.Instance.findComponentById('ib2wuwzild'); +var stone1 = R3.EntityManager.Instance.findComponentById('ig7vhdkoad'); +var stone2 = R3.EntityManager.Instance.findComponentById('bvkorlbttn'); +var materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('85ek16brbf'); var mesh = null; var material = null; diff --git a/gr0qs6v7dd.js b/gr0qs6v7dd.js index 8c7341b..50c0b3d 100644 --- a/gr0qs6v7dd.js +++ b/gr0qs6v7dd.js @@ -6,38 +6,38 @@ if (this.parentEntity === data.entity) { this.enemies = []; -var particle = GameLib.EntityManager.Instance.findComponentById('tiqzsk65l0'); +var particle = R3.EntityManager.Instance.findComponentById('tiqzsk65l0'); particle.instance.visible = false; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('9l6o7974qx'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('9l6o7974qx'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('7vjcf5lwek'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('7vjcf5lwek'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('yfdl3odo4j'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('yfdl3odo4j'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('fsilsam72g'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('fsilsam72g'); this.mouseMove.entityLoaded = this; /** * Plant all our trees */ -var treeSmall = GameLib.EntityManager.Instance.findComponentById('ctofpaaxhc'); -var treeMedium = GameLib.EntityManager.Instance.findComponentById('48l6qb40bl'); -var treeLarge = GameLib.EntityManager.Instance.findComponentById('owjdksm134'); +var treeSmall = R3.EntityManager.Instance.findComponentById('ctofpaaxhc'); +var treeMedium = R3.EntityManager.Instance.findComponentById('48l6qb40bl'); +var treeLarge = R3.EntityManager.Instance.findComponentById('owjdksm134'); -var scene = GameLib.EntityManager.Instance.findComponentById('lpdxa66480'); +var scene = R3.EntityManager.Instance.findComponentById('lpdxa66480'); var i = 0; var tempTree = null; diff --git a/gvgg7mc204.js b/gvgg7mc204.js index a72560d..778a90a 100644 --- a/gvgg7mc204.js +++ b/gvgg7mc204.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/gvykb1t0f7.js b/gvykb1t0f7.js index 24521b8..423bc70 100644 --- a/gvykb1t0f7.js +++ b/gvykb1t0f7.js @@ -9,66 +9,66 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('cfzvnhnxwg') -this.bull = GameLib.EntityManager.Instance.findComponentById('g01vfftbxg'); -this.star = GameLib.EntityManager.Instance.findComponentById('rh8szer3un'); -this.burger = GameLib.EntityManager.Instance.findComponentById('tbs08us283'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('0xjm8uxpwb'); -this.santa = GameLib.EntityManager.Instance.findComponentById('s8x66722us'); -this.camera = GameLib.EntityManager.Instance.findComponentById('8y37o6577j'); -this.scene = GameLib.EntityManager.Instance.findComponentById('i83zl98rh2'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('e1880sotm0'); +this.fog = R3.EntityManager.Instance.findComponentById('cfzvnhnxwg') +this.bull = R3.EntityManager.Instance.findComponentById('g01vfftbxg'); +this.star = R3.EntityManager.Instance.findComponentById('rh8szer3un'); +this.burger = R3.EntityManager.Instance.findComponentById('tbs08us283'); +this.parcel = R3.EntityManager.Instance.findComponentById('0xjm8uxpwb'); +this.santa = R3.EntityManager.Instance.findComponentById('s8x66722us'); +this.camera = R3.EntityManager.Instance.findComponentById('8y37o6577j'); +this.scene = R3.EntityManager.Instance.findComponentById('i83zl98rh2'); +this.cursor = R3.EntityManager.Instance.findComponentById('e1880sotm0'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('pob82zcghv'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('kwj06i89ux'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('jt9is18fu7'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('ifoj8e7bnn'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('coxiuik8xh'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('6dbzkrd3j6'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('rwno14q06z'); +this.thrower = R3.EntityManager.Instance.findComponentById('pob82zcghv'); +this.renderer = R3.EntityManager.Instance.findComponentById('kwj06i89ux'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('jt9is18fu7'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('ifoj8e7bnn'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('coxiuik8xh'); +this.stone1 = R3.EntityManager.Instance.findComponentById('6dbzkrd3j6'); +this.stone2 = R3.EntityManager.Instance.findComponentById('rwno14q06z'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('sclhg9w9q8'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('8naag5fwfz'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('q02tiwyog9'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('wbra2fdwae'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('sclhg9w9q8'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('8naag5fwfz'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('q02tiwyog9'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('wbra2fdwae'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('z3t1r68k61'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('z3t1r68k61'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('7p8dxknb7m'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('7p8dxknb7m'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('rtu7o9zz7g'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('rtu7o9zz7g'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('27ihfljfb8'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('27ihfljfb8'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('hibvg7v1d0'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('hibvg7v1d0'); this.mouseMove.entityLoaded = this; -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); -GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); +R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); /** * Plant all our trees - Below code gets generated automatically diff --git a/gx1dydxlno.js b/gx1dydxlno.js index fde585c..8c1444e 100644 --- a/gx1dydxlno.js +++ b/gx1dydxlno.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/gzewp2awcf.js b/gzewp2awcf.js index 9ae4ae4..4c4aa47 100644 --- a/gzewp2awcf.js +++ b/gzewp2awcf.js @@ -47,10 +47,10 @@ intersects.map( intersect.mesh.materials[0].visible = true; intersect.mesh.materials[0].updateInstance('visible'); - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_LEFT + keyCode : R3.System.Input.KEY_LEFT } ); } @@ -60,10 +60,10 @@ intersects.map( intersect.mesh.materials[0].visible = true; intersect.mesh.materials[0].updateInstance('visible'); - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_RIGHT + keyCode : R3.System.Input.KEY_RIGHT } ); } @@ -73,10 +73,10 @@ intersects.map( intersect.mesh.materials[0].visible = true; intersect.mesh.materials[0].updateInstance('visible'); - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_UP + keyCode : R3.System.Input.KEY_UP } ); } @@ -86,10 +86,10 @@ intersects.map( intersect.mesh.materials[0].visible = true; intersect.mesh.materials[0].updateInstance('visible'); - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { - keyCode : GameLib.System.Input.KEY_DOWN + keyCode : R3.System.Input.KEY_DOWN } ); } @@ -102,13 +102,13 @@ intersects.map( intersect.mesh.materials[0].visible = true; intersect.mesh.materials[0].updateInstance('visible'); - GameLib.Event.Emit(GameLib.Event.PAUSE_ALL_AUDIO); + R3.Event.Emit(R3.Event.PAUSE_ALL_AUDIO); } else { intersect.mesh.materials[0].visible = false; intersect.mesh.materials[0].updateInstance('visible'); - GameLib.Event.Emit(GameLib.Event.CONTINUE_ALL_AUDIO); + R3.Event.Emit(R3.Event.CONTINUE_ALL_AUDIO); } } @@ -117,7 +117,7 @@ intersects.map( this.state.muted = !this.state.muted; - GameLib.Event.Emit(GameLib.Event.MUTE_AUDIO); + R3.Event.Emit(R3.Event.MUTE_AUDIO); if (this.state.muted) { intersect.mesh.materials[0].visible = true; diff --git a/h009ftvehl.js b/h009ftvehl.js index fde585c..8c1444e 100644 --- a/h009ftvehl.js +++ b/h009ftvehl.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/h4ri7b3n05.js b/h4ri7b3n05.js index fa8b62d..a4a21ec 100644 --- a/h4ri7b3n05.js +++ b/h4ri7b3n05.js @@ -2,17 +2,17 @@ if (this.parentEntity === data.entity) { console.log('Entity FSDemo Loaded'); - this.imageSpoon = GameLib.EntityManager.Instance.findComponentById('jbs9yn11z7'); - this.imageEarth = GameLib.EntityManager.Instance.findComponentById('kyqq6wa4uq'); + this.imageSpoon = R3.EntityManager.Instance.findComponentById('jbs9yn11z7'); + this.imageEarth = R3.EntityManager.Instance.findComponentById('kyqq6wa4uq'); - this.meshBox = GameLib.EntityManager.Instance.findComponentById('41cqu6d30r'); - this.meshImageGrid = GameLib.EntityManager.Instance.findComponentById('e3lyv5xile'); + this.meshBox = R3.EntityManager.Instance.findComponentById('41cqu6d30r'); + this.meshImageGrid = R3.EntityManager.Instance.findComponentById('e3lyv5xile'); - this.instancedGeometry = GameLib.EntityManager.Instance.findComponentById('logvvoozyc'); - this.boxGeometry = GameLib.EntityManager.Instance.findComponentById('44clfy312i'); + this.instancedGeometry = R3.EntityManager.Instance.findComponentById('logvvoozyc'); + this.boxGeometry = R3.EntityManager.Instance.findComponentById('44clfy312i'); - this.ccBeforeRender = GameLib.EntityManager.Instance.findComponentById('2xpawazgoz'); - this.ccKeyUp = GameLib.EntityManager.Instance.findComponentById('194yv3pctj'); + this.ccBeforeRender = R3.EntityManager.Instance.findComponentById('2xpawazgoz'); + this.ccKeyUp = R3.EntityManager.Instance.findComponentById('194yv3pctj'); this.ccBeforeRender.entityLoaded = this; this.ccKeyUp.entityLoaded = this; diff --git a/hv7vehw7se.js b/hv7vehw7se.js index 0366bb4..6b6a89b 100644 --- a/hv7vehw7se.js +++ b/hv7vehw7se.js @@ -9,74 +9,74 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.CustomCode.MAX_SPAWN_TIME = 4; -GameLib.CustomCode.OBJECT_BUFFER_SIZE = 5; +R3.CustomCode.MIN_SPAWN_TIME = 1; +R3.CustomCode.MAX_SPAWN_TIME = 4; +R3.CustomCode.OBJECT_BUFFER_SIZE = 5; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('prn0bjxe3h') -this.bull = GameLib.EntityManager.Instance.findComponentById('cpcuzjjx27'); -this.star = GameLib.EntityManager.Instance.findComponentById('lc7boe8lul'); -this.burger = GameLib.EntityManager.Instance.findComponentById('suwsyomgc8'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('vikv0e8s04'); -this.santa = GameLib.EntityManager.Instance.findComponentById('r0gkv2m07t'); -this.camera = GameLib.EntityManager.Instance.findComponentById('2f5l1jt4yw'); -this.scene = GameLib.EntityManager.Instance.findComponentById('z3ktrimsp8'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('zfu27tmjn4'); +this.fog = R3.EntityManager.Instance.findComponentById('prn0bjxe3h') +this.bull = R3.EntityManager.Instance.findComponentById('cpcuzjjx27'); +this.star = R3.EntityManager.Instance.findComponentById('lc7boe8lul'); +this.burger = R3.EntityManager.Instance.findComponentById('suwsyomgc8'); +this.parcel = R3.EntityManager.Instance.findComponentById('vikv0e8s04'); +this.santa = R3.EntityManager.Instance.findComponentById('r0gkv2m07t'); +this.camera = R3.EntityManager.Instance.findComponentById('2f5l1jt4yw'); +this.scene = R3.EntityManager.Instance.findComponentById('z3ktrimsp8'); +this.cursor = R3.EntityManager.Instance.findComponentById('zfu27tmjn4'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('wid7sf7y35'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('xtukuakue3'); +this.renderer = R3.EntityManager.Instance.findComponentById('wid7sf7y35'); +this.thrower = R3.EntityManager.Instance.findComponentById('xtukuakue3'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('66lfvqjnsh'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('jkfx0aimom'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('53cg0zj637'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('ouacwomksb'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('zaen0snqwc'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('01hun2dd7x'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('66lfvqjnsh'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('jkfx0aimom'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('53cg0zj637'); +this.stone1 = R3.EntityManager.Instance.findComponentById('ouacwomksb'); +this.stone2 = R3.EntityManager.Instance.findComponentById('zaen0snqwc'); +this.kanister = R3.EntityManager.Instance.findComponentById('01hun2dd7x'); /** * Lights */ -this.lightDirectional = GameLib.EntityManager.Instance.findComponentById('lbzb38hku5'); -this.lightAmbient = GameLib.EntityManager.Instance.findComponentById('0z7ybu0bnb'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('z1jjutmra1'); +this.lightDirectional = R3.EntityManager.Instance.findComponentById('lbzb38hku5'); +this.lightAmbient = R3.EntityManager.Instance.findComponentById('0z7ybu0bnb'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('z1jjutmra1'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('kbwcgi1xoq'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('s9qsosyx1w'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('nnmuq10dbl'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('kbwcgi1xoq'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('s9qsosyx1w'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('nnmuq10dbl'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('ofo2ota5bo'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('ulks1tuug6'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('t15omdm43f'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('gwi8qiymy5'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('g91m1tk6so'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('ofo2ota5bo'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('ulks1tuug6'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('t15omdm43f'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('gwi8qiymy5'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('g91m1tk6so'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('jdn84unl9b'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('jdn84unl9b'); -GameLib.Event.Emit( - GameLib.Event.GET_RUNTIME, +R3.Event.Emit( + R3.Event.GET_RUNTIME, null, function(runtime) { this.graphics = runtime.graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('qemp4een6t'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('f0m7ptlxf3'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('jtmr6gmp5p'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('lxigrx11oc'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('evwkow5289'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('qemp4een6t'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('f0m7ptlxf3'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('jtmr6gmp5p'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('lxigrx11oc'); +this.touchMove = R3.EntityManager.Instance.findComponentById('evwkow5289'); /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -152,27 +152,27 @@ this.createMesh = function(meshType) { ); }; -for (var n = 0; n < GameLib.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('bull'); } -for (var n = 0; n < GameLib.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('star'); } -for (var n = 0; n < GameLib.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('burger'); } -for (var n = 0; n < GameLib.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('parcel'); } -for (var n = 0; n < GameLib.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('santa'); } -for (var n = 0; n < GameLib.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('kanister'); } @@ -1471,6 +1471,6 @@ this.treeMedium.updateInstance('visible'); this.treeLarge.visible = false; this.treeLarge.updateInstance('visible'); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js \ No newline at end of file diff --git a/i77xh957x4.js b/i77xh957x4.js index 6440feb..8d6251c 100644 --- a/i77xh957x4.js +++ b/i77xh957x4.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/i81v62aooq.js b/i81v62aooq.js index 6440feb..8d6251c 100644 --- a/i81v62aooq.js +++ b/i81v62aooq.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/ild66f6e9m.js b/ild66f6e9m.js index f770088..3f6a68a 100644 --- a/ild66f6e9m.js +++ b/ild66f6e9m.js @@ -2,12 +2,12 @@ if (!this.entityLoaded) { return; } -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); /* if (data.down > 0) { - GameLib.Event.Emit( - GameLib.Event.MOUSE_WHEEL, + R3.Event.Emit( + R3.Event.MOUSE_WHEEL, { event : { deltaY : 1 @@ -15,8 +15,8 @@ if (data.down > 0) { } ) } else { - GameLib.Event.Emit( - GameLib.Event.MOUSE_WHEEL, + R3.Event.Emit( + R3.Event.MOUSE_WHEEL, { event : { deltaY : -1 diff --git a/imyjyap4hw.js b/imyjyap4hw.js index 9667fbb..9a2027e 100644 --- a/imyjyap4hw.js +++ b/imyjyap4hw.js @@ -35,7 +35,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/iullyllylb.js b/iullyllylb.js index 67147fc..68496fe 100644 --- a/iullyllylb.js +++ b/iullyllylb.js @@ -5,7 +5,7 @@ if (!this.entityLoaded) { /** * First we find our crosshair */ -var crosshair = GameLib.EntityManager.Instance.findComponentById('1eh5eu30m6'); +var crosshair = R3.EntityManager.Instance.findComponentById('1eh5eu30m6'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -20,11 +20,11 @@ particle.position.applyMatrix4( mInverse ); -var particleEngine = GameLib.EntityManager.Instance.findComponentById('o5xi6s5myj'); -var particle = GameLib.EntityManager.Instance.findComponentById('0k1hhfy3dk'); +var particleEngine = R3.EntityManager.Instance.findComponentById('o5xi6s5myj'); +var particle = R3.EntityManager.Instance.findComponentById('0k1hhfy3dk'); -var flamethrower = GameLib.EntityManager.Instance.findComponentById('zldh9sdfuc'); -var worldCamera = GameLib.EntityManager.Instance.findComponentById('k9ain64rlp'); +var flamethrower = R3.EntityManager.Instance.findComponentById('zldh9sdfuc'); +var worldCamera = R3.EntityManager.Instance.findComponentById('k9ain64rlp'); var end = ; diff --git a/j1gg46ln21.js b/j1gg46ln21.js index 02bc108..367e921 100644 --- a/j1gg46ln21.js +++ b/j1gg46ln21.js @@ -5,7 +5,7 @@ if (!this.entityLoaded) { /** * First we find our crosshair */ -var crosshair = GameLib.EntityManager.Instance.findComponentById('ah7gtz3mou'); +var crosshair = R3.EntityManager.Instance.findComponentById('ah7gtz3mou'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -20,11 +20,11 @@ particle.position.applyMatrix4( mInverse ); -var particleEngine = GameLib.EntityManager.Instance.findComponentById('cd9s9xhs4e'); -var particle = GameLib.EntityManager.Instance.findComponentById('yployonpho'); +var particleEngine = R3.EntityManager.Instance.findComponentById('cd9s9xhs4e'); +var particle = R3.EntityManager.Instance.findComponentById('yployonpho'); -var flamethrower = GameLib.EntityManager.Instance.findComponentById('69a7qg3rkb'); -var worldCamera = GameLib.EntityManager.Instance.findComponentById('0ph5bo9dyi'); +var flamethrower = R3.EntityManager.Instance.findComponentById('69a7qg3rkb'); +var worldCamera = R3.EntityManager.Instance.findComponentById('0ph5bo9dyi'); var end = ; diff --git a/jppoix9hqf.js b/jppoix9hqf.js index 3a001f9..11857cf 100644 --- a/jppoix9hqf.js +++ b/jppoix9hqf.js @@ -4,14 +4,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Xmas' } @@ -21,14 +21,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function (data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1, 5); + var play = R3.Utils.GetRandomIntInclusive(1, 5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Ho ho ho' } @@ -76,7 +76,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -110,7 +110,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } if (this.score > 5000) { - var dice = GameLib.Utils.GetRandomIntInclusive(1, 10); + var dice = R3.Utils.GetRandomIntInclusive(1, 10); /** * Max average spawn = 5.41 @@ -126,8 +126,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore: this.kanisterSpawnScore @@ -173,8 +173,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function (graphics) { this.graphics = graphics @@ -207,8 +207,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level + ', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level: this.level, enemySpawnInterval: this.enemySpawnInterval, @@ -235,14 +235,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function (kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); var meshTypeIndex; if (kanister) { meshTypeIndex = 6; } else { - meshTypeIndex = GameLib.Utils.GetRandomIntInclusive(1, 5); + meshTypeIndex = R3.Utils.GetRandomIntInclusive(1, 5); } var meshType = null; @@ -300,8 +300,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'kanisterCountUpdate', kanisters: this.kanisters @@ -313,19 +313,19 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1, + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1, + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1, 100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1, 100) * 0.001; var position = {x: 0, y: y, z: 0}; @@ -408,8 +408,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { if (kanister) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -454,7 +454,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1, 3); + var sound = R3.Utils.GetRandomIntInclusive(1, 3); var name = 'Audio - Blast 1'; @@ -472,8 +472,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.explodeParticleEngine.updateInstance('position'); mesh.explodeParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: name } @@ -500,8 +500,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemiesExploded += 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy: mesh.enemy, event: 'enemyExploded' @@ -514,8 +514,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'scoreUpdate', score: this.score @@ -534,8 +534,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy: mesh.enemy, event: 'enemyBurned' @@ -554,8 +554,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.fireParticleEngine.updateInstance('position'); mesh.fireParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Burning' } @@ -610,8 +610,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'gameRunning', message: 'we have enough trees burning now to start - the enemy will spawn now' @@ -619,8 +619,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'treeBurned', treesBurning: this.treesBurning, @@ -658,8 +658,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.burningTreeParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Burning' } @@ -667,8 +667,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game: this } @@ -767,7 +767,7 @@ if (this.mouseIsDown) { /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.burnLife)) { + if (R3.Utils.UndefinedOrNull(mesh.burnLife)) { mesh.burnLife = 1; mesh.burning = false; } @@ -813,8 +813,8 @@ else { var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'fuelUsed', used: used, @@ -830,8 +830,8 @@ if (this.kanisterTime > this.kanisterLife) { console.log('kanister count: ' + this.kanisters); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'kanisterCountUpdate', kanisters: this.kanisters @@ -840,8 +840,8 @@ if (this.kanisterTime > this.kanisterLife) { if (this.kanisters < 0) { console.log('no more kanisters'); - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game: this } @@ -874,8 +874,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'enemyLifetimeReached', enemy: enemy @@ -895,7 +895,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { diff --git a/jtmr6gmp5p.js b/jtmr6gmp5p.js index 6440feb..8d6251c 100644 --- a/jtmr6gmp5p.js +++ b/jtmr6gmp5p.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/jtype58mzh.js b/jtype58mzh.js index fe9fa0f..e7cde97 100644 --- a/jtype58mzh.js +++ b/jtype58mzh.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/jujvqjffqw.js b/jujvqjffqw.js index 6154949..a8ada4d 100644 --- a/jujvqjffqw.js +++ b/jujvqjffqw.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -var particleEngine = GameLib.EntityManager.Instance.findComponentById('mwnydjz3ez'); +var particleEngine = R3.EntityManager.Instance.findComponentById('mwnydjz3ez'); particleEngine.enabled = false; diff --git a/kkq5j4tfm4.js b/kkq5j4tfm4.js index fe66f0c..9dcc8fb 100644 --- a/kkq5j4tfm4.js +++ b/kkq5j4tfm4.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/ktf4wzckvh.js b/ktf4wzckvh.js index be60b1d..648e7b7 100644 --- a/ktf4wzckvh.js +++ b/ktf4wzckvh.js @@ -6,8 +6,8 @@ var movementY = data.meta.totalDown - data.meta.totalUp; //console.log(movementY); -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { movementY : movementY diff --git a/l5hb4jx1ke.js b/l5hb4jx1ke.js index 8fa464e..1cbc8c9 100644 --- a/l5hb4jx1ke.js +++ b/l5hb4jx1ke.js @@ -30,8 +30,8 @@ var result = number - remainder; this.cylinder.rotation.x += result - 0.4488; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Select' } diff --git a/l5n85t1c45.js b/l5n85t1c45.js index c9407ca..89e7d00 100644 --- a/l5n85t1c45.js +++ b/l5n85t1c45.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/lf6lcf3rv4.js b/lf6lcf3rv4.js index c9407ca..89e7d00 100644 --- a/lf6lcf3rv4.js +++ b/lf6lcf3rv4.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/lrubgmvc5t.js b/lrubgmvc5t.js index a126517..520b748 100644 --- a/lrubgmvc5t.js +++ b/lrubgmvc5t.js @@ -1,7 +1,7 @@ var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, diff --git a/lu2nif2rjp.js b/lu2nif2rjp.js index fe9fa0f..e7cde97 100644 --- a/lu2nif2rjp.js +++ b/lu2nif2rjp.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/lw8voyulf3.js b/lw8voyulf3.js index a72560d..778a90a 100644 --- a/lw8voyulf3.js +++ b/lw8voyulf3.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/lwk5t658ne.js b/lwk5t658ne.js index fbc03e8..d652c5b 100644 --- a/lwk5t658ne.js +++ b/lwk5t658ne.js @@ -1,4 +1,4 @@ -var mesh = GameLib.EntityManager.Instance.findComponentById('5odj0hpf2z'); +var mesh = R3.EntityManager.Instance.findComponentById('5odj0hpf2z'); if (!this.initialized) { this.initialized = true; diff --git a/m4c2psc19l.js b/m4c2psc19l.js index 9fe4b15..242c9c9 100644 --- a/m4c2psc19l.js +++ b/m4c2psc19l.js @@ -9,62 +9,62 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('d2bii5k0ha') -this.bull = GameLib.EntityManager.Instance.findComponentById('mkanjiompv'); -this.star = GameLib.EntityManager.Instance.findComponentById('5iz2kywf68'); -this.burger = GameLib.EntityManager.Instance.findComponentById('g26i649z3j'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('s22s8m06q2'); -this.santa = GameLib.EntityManager.Instance.findComponentById('byqhlnuto0'); -this.camera = GameLib.EntityManager.Instance.findComponentById('2ya9b5if8y'); -this.scene = GameLib.EntityManager.Instance.findComponentById('f5d6aj9iiv'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('ykfzwmaw9j'); +this.fog = R3.EntityManager.Instance.findComponentById('d2bii5k0ha') +this.bull = R3.EntityManager.Instance.findComponentById('mkanjiompv'); +this.star = R3.EntityManager.Instance.findComponentById('5iz2kywf68'); +this.burger = R3.EntityManager.Instance.findComponentById('g26i649z3j'); +this.parcel = R3.EntityManager.Instance.findComponentById('s22s8m06q2'); +this.santa = R3.EntityManager.Instance.findComponentById('byqhlnuto0'); +this.camera = R3.EntityManager.Instance.findComponentById('2ya9b5if8y'); +this.scene = R3.EntityManager.Instance.findComponentById('f5d6aj9iiv'); +this.cursor = R3.EntityManager.Instance.findComponentById('ykfzwmaw9j'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('x4rhvbj8cn'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('15rh0z60fi'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('rgw0zarct7'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('pnsitmldna'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('hl3ydrafqd'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('qg4l7z9kvt'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('5gxxardq0g'); +this.thrower = R3.EntityManager.Instance.findComponentById('x4rhvbj8cn'); +this.renderer = R3.EntityManager.Instance.findComponentById('15rh0z60fi'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('rgw0zarct7'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('pnsitmldna'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('hl3ydrafqd'); +this.stone1 = R3.EntityManager.Instance.findComponentById('qg4l7z9kvt'); +this.stone2 = R3.EntityManager.Instance.findComponentById('5gxxardq0g'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('0k1sgxm2vq'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('7fciovp60k'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('uie2dpeyji'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('9mm3vw8wtb'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('0k1sgxm2vq'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('7fciovp60k'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('uie2dpeyji'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('9mm3vw8wtb'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('72d6a2a3kc'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('72d6a2a3kc'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('0vpel69zj0'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('0vpel69zj0'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('rciyhwg65b'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('rciyhwg65b'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('8a0m30eevi'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('8a0m30eevi'); this.mouseMove.entityLoaded = this; -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); /** * Plant all our trees - Below code gets generated automatically diff --git a/mc5l8q30w.js b/mc5l8q30w.js index fde585c..8c1444e 100644 --- a/mc5l8q30w.js +++ b/mc5l8q30w.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/mccud019kb.js b/mccud019kb.js index ce161a2..8e41cec 100644 --- a/mccud019kb.js +++ b/mccud019kb.js @@ -9,14 +9,14 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('dywmtohrda'); -//this.materialRusted = GameLib.EntityManager.Instance.findComponentById('0mrd2dx5np'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('dywmtohrda'); +//this.materialRusted = R3.EntityManager.Instance.findComponentById('0mrd2dx5np'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics diff --git a/mdfv5jzpqo.js b/mdfv5jzpqo.js index 8849658..7f615db 100644 --- a/mdfv5jzpqo.js +++ b/mdfv5jzpqo.js @@ -2,8 +2,8 @@ data.event.preventDefault(); var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, @@ -13,6 +13,6 @@ GameLib.Event.Emit( } ) -GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +R3.Event.Emit(R3.Event.MOUSE_DOWN); //@ sourceURL=touchStart.js \ No newline at end of file diff --git a/monq9ryw7a.js b/monq9ryw7a.js index c9407ca..89e7d00 100644 --- a/monq9ryw7a.js +++ b/monq9ryw7a.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/mq0yhwbc41.js b/mq0yhwbc41.js index fe9fa0f..e7cde97 100644 --- a/mq0yhwbc41.js +++ b/mq0yhwbc41.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/mwgnb50mpx.js b/mwgnb50mpx.js index fde585c..8c1444e 100644 --- a/mwgnb50mpx.js +++ b/mwgnb50mpx.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/mxrint4wnw.js b/mxrint4wnw.js index 3a1da78..b057c07 100644 --- a/mxrint4wnw.js +++ b/mxrint4wnw.js @@ -2,14 +2,14 @@ if (data.entity !== this.parentEntity) { return; } -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('ds7xhwnsao'); -this.topBall = GameLib.EntityManager.Instance.findComponentById('gh1x1h7rot'); -this.bottomBall = GameLib.EntityManager.Instance.findComponentById('796eyo44j8'); -this.text0 = GameLib.EntityManager.Instance.findComponentById('hzr8jx7485'); -this.text1 = GameLib.EntityManager.Instance.findComponentById('rlx2sebygk'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('ds7xhwnsao'); +this.topBall = R3.EntityManager.Instance.findComponentById('gh1x1h7rot'); +this.bottomBall = R3.EntityManager.Instance.findComponentById('796eyo44j8'); +this.text0 = R3.EntityManager.Instance.findComponentById('hzr8jx7485'); +this.text1 = R3.EntityManager.Instance.findComponentById('rlx2sebygk'); -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } diff --git a/n3ehhvglar.js b/n3ehhvglar.js index 1072394..480ed90 100644 --- a/n3ehhvglar.js +++ b/n3ehhvglar.js @@ -1,5 +1,5 @@ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('dywmtohrda'); -this.entityLoaded = GameLib.EntityManager.Instance.findComponentById('mccud019kb'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('dywmtohrda'); +this.entityLoaded = R3.EntityManager.Instance.findComponentById('mccud019kb'); this.beforeRender.entityLoaded = this.entityLoaded; diff --git a/n9fytzblie.js b/n9fytzblie.js index fde585c..8c1444e 100644 --- a/n9fytzblie.js +++ b/n9fytzblie.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/nclnfk2gy8.js b/nclnfk2gy8.js index c9407ca..89e7d00 100644 --- a/nclnfk2gy8.js +++ b/nclnfk2gy8.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/nuqb3rb3y5.js b/nuqb3rb3y5.js index 3d78bdb..38f9358 100644 --- a/nuqb3rb3y5.js +++ b/nuqb3rb3y5.js @@ -9,67 +9,67 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('vw7o32iaer') -this.bull = GameLib.EntityManager.Instance.findComponentById('lxsod72np2'); -this.star = GameLib.EntityManager.Instance.findComponentById('n084rk9unu'); -this.burger = GameLib.EntityManager.Instance.findComponentById('5vfpwd1spb'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('l7qokfbopo'); -this.santa = GameLib.EntityManager.Instance.findComponentById('6d9e62a4x1'); -this.camera = GameLib.EntityManager.Instance.findComponentById('kagldbpzc3'); -this.scene = GameLib.EntityManager.Instance.findComponentById('ahp9715pvl'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('r6wl0y7g1j'); -this.dom = GameLib.EntityManager.Instance.findComponentById('613e3jkw4b'); +this.fog = R3.EntityManager.Instance.findComponentById('vw7o32iaer') +this.bull = R3.EntityManager.Instance.findComponentById('lxsod72np2'); +this.star = R3.EntityManager.Instance.findComponentById('n084rk9unu'); +this.burger = R3.EntityManager.Instance.findComponentById('5vfpwd1spb'); +this.parcel = R3.EntityManager.Instance.findComponentById('l7qokfbopo'); +this.santa = R3.EntityManager.Instance.findComponentById('6d9e62a4x1'); +this.camera = R3.EntityManager.Instance.findComponentById('kagldbpzc3'); +this.scene = R3.EntityManager.Instance.findComponentById('ahp9715pvl'); +this.cursor = R3.EntityManager.Instance.findComponentById('r6wl0y7g1j'); +this.dom = R3.EntityManager.Instance.findComponentById('613e3jkw4b'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('swvlsw0kim'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('rzamfsuoqj'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('vw2a71fxhk'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('eqxdb9puph'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('sdnele2leu'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('ohsraf8qoh'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('ra9rntsikj'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('xosv4aw7b2'); +this.renderer = R3.EntityManager.Instance.findComponentById('swvlsw0kim'); +this.thrower = R3.EntityManager.Instance.findComponentById('rzamfsuoqj'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('vw2a71fxhk'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('eqxdb9puph'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('sdnele2leu'); +this.stone1 = R3.EntityManager.Instance.findComponentById('ohsraf8qoh'); +this.stone2 = R3.EntityManager.Instance.findComponentById('ra9rntsikj'); +this.kanister = R3.EntityManager.Instance.findComponentById('xosv4aw7b2'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('mj5pa3fxy3'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('4kkn1339ok'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('3g15twvmwf'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('uj2zfsmsa7'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('l6y7tz3y6j'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('o0dc77jkpy'); +this.leftLight = R3.EntityManager.Instance.findComponentById('mj5pa3fxy3'); +this.rightLight = R3.EntityManager.Instance.findComponentById('4kkn1339ok'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('3g15twvmwf'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('uj2zfsmsa7'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('l6y7tz3y6j'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('o0dc77jkpy'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('a62cgqthh1'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('3wx0noydgo'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('f312r1f4mh'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('vw37f5555e'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('3ijrtpaoyc'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('a62cgqthh1'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('3wx0noydgo'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('f312r1f4mh'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('vw37f5555e'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('3ijrtpaoyc'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('pf6uzftmte'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('pf6uzftmte'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('a2ow5l92js'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('7jq30brvwf'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('zjg1mprub2'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('09qvema4k8'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('gvgg7mc204'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('a2ow5l92js'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('7jq30brvwf'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('zjg1mprub2'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('09qvema4k8'); +this.touchMove = R3.EntityManager.Instance.findComponentById('gvgg7mc204'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -84,8 +84,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -96,7 +96,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -906,6 +906,6 @@ mesh.scale.y = 5; mesh.scale.z = 5; mesh.updateInstance(); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/o3xmefbbln.js b/o3xmefbbln.js index 6440feb..8d6251c 100644 --- a/o3xmefbbln.js +++ b/o3xmefbbln.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/o73bkh2tlq.js b/o73bkh2tlq.js index dc7dd39..c1043d6 100644 --- a/o73bkh2tlq.js +++ b/o73bkh2tlq.js @@ -6,54 +6,54 @@ if (this.parentEntity === data.entity) { this.enemies = []; -var particle = GameLib.EntityManager.Instance.findComponentById('0k1hhfy3dk'); +var particle = R3.EntityManager.Instance.findComponentById('0k1hhfy3dk'); particle.instance.visible = false; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('qi81k80v08'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('qi81k80v08'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('1n3iofhi8x'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('1n3iofhi8x'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('iullyllylb'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('iullyllylb'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('ud33b2z225'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('ud33b2z225'); this.mouseMove.entityLoaded = this; /** * Create references to all our 'in game' objects */ -this.bull = GameLib.EntityManager.Instance.findComponentById('y1op9hp8dz'); -this.star = GameLib.EntityManager.Instance.findComponentById('tmut3carec'); -this.burger = GameLib.EntityManager.Instance.findComponentById('j88zs01szc'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('l91pfxkwml'); +this.bull = R3.EntityManager.Instance.findComponentById('y1op9hp8dz'); +this.star = R3.EntityManager.Instance.findComponentById('tmut3carec'); +this.burger = R3.EntityManager.Instance.findComponentById('j88zs01szc'); +this.parcel = R3.EntityManager.Instance.findComponentById('l91pfxkwml'); -this.camera = GameLib.EntityManager.Instance.findComponentById('k9ain64rlp'); -this.scene = GameLib.EntityManager.Instance.findComponentById('q1f5n01iqk'); +this.camera = R3.EntityManager.Instance.findComponentById('k9ain64rlp'); +this.scene = R3.EntityManager.Instance.findComponentById('q1f5n01iqk'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('1eh5eu30m6'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('zldh9sdfuc'); +this.cursor = R3.EntityManager.Instance.findComponentById('1eh5eu30m6'); +this.thrower = R3.EntityManager.Instance.findComponentById('zldh9sdfuc'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Link some objects for MouseMove component @@ -68,11 +68,11 @@ this.mouseMove.thrower = this.thrower; /** * Plant all our trees */ -var treeSmall = GameLib.EntityManager.Instance.findComponentById('m02lo48i7y'); -var treeMedium = GameLib.EntityManager.Instance.findComponentById('g2f23vpbfg'); -var treeLarge = GameLib.EntityManager.Instance.findComponentById('3tldspycol'); -var stone1 = GameLib.EntityManager.Instance.findComponentById('tpwbl3omia'); -var stone2 = GameLib.EntityManager.Instance.findComponentById('2oma4vgtbp'); +var treeSmall = R3.EntityManager.Instance.findComponentById('m02lo48i7y'); +var treeMedium = R3.EntityManager.Instance.findComponentById('g2f23vpbfg'); +var treeLarge = R3.EntityManager.Instance.findComponentById('3tldspycol'); +var stone1 = R3.EntityManager.Instance.findComponentById('tpwbl3omia'); +var stone2 = R3.EntityManager.Instance.findComponentById('2oma4vgtbp'); mesh = stone2.clone(); mesh.position.x = 46.52; diff --git a/o7s7v9qq97.js b/o7s7v9qq97.js index 974750d..e6f6277 100644 --- a/o7s7v9qq97.js +++ b/o7s7v9qq97.js @@ -7,7 +7,7 @@ if (this.parentEntity === data.entity) { if (!this.initialized) { - var texture = GameLib.EntityManager.Instance.findComponentById('77dqs286vu'); + var texture = R3.EntityManager.Instance.findComponentById('77dqs286vu'); this.initialized = true; } @@ -17,7 +17,7 @@ ig.System.inject({ this.fps = fps; this.clock = new ig.Timer(); - this.canvas = GameLib.EntityManager.Instance.findComponentById('ov13qo2j1m').instance; + this.canvas = R3.EntityManager.Instance.findComponentById('ov13qo2j1m').instance; this.resize( width, height, scale ); this.context = this.canvas.getContext('2d'); @@ -67,7 +67,7 @@ ig.module( } ); - var size = GameLib.Utils.GetWindowSize(); + var size = R3.Utils.GetWindowSize(); // Start your game // 60fps, 320x240 pixels, scaled up by a factor of 2 diff --git a/oh07330eg6.js b/oh07330eg6.js index b3b4cf6..28b91b3 100644 --- a/oh07330eg6.js +++ b/oh07330eg6.js @@ -3,8 +3,8 @@ if (!this.entityLoaded) { } if ( - GameLib.Utils.UndefinedOrNull(this.totalTime) || - GameLib.Utils.UndefinedOrNull(this.spawnTime) + R3.Utils.UndefinedOrNull(this.totalTime) || + R3.Utils.UndefinedOrNull(this.spawnTime) ) { /** @@ -13,16 +13,16 @@ if ( this.totalTime = 0; this.spawnTime = 0; - var cow = GameLib.EntityManager.Instance.findComponentById('i91446cuuz'); - var burger = GameLib.EntityManager.Instance.findComponentById('meqitpma4p'); + var cow = R3.EntityManager.Instance.findComponentById('i91446cuuz'); + var burger = R3.EntityManager.Instance.findComponentById('meqitpma4p'); cow.instance.visible = false; burger.instance.visible = false; this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -30,13 +30,13 @@ if ( ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 10 ); } - this.scene = GameLib.EntityManager.Instance.findComponentById('0m0yxvznsa'); + this.scene = R3.EntityManager.Instance.findComponentById('0m0yxvznsa'); this.nextSpawnTime = this.getNextSpawnTime(); @@ -47,7 +47,7 @@ if ( var y = Math.floor((Math.random() * 10) + 2); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; @@ -136,8 +136,8 @@ this.enemies = this.enemies.reduce( enemy.mesh.updateInstancePosition(); enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/ohqwmnjfgf.js b/ohqwmnjfgf.js index 4ea9a75..5a8dbad 100644 --- a/ohqwmnjfgf.js +++ b/ohqwmnjfgf.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } @@ -10,8 +10,8 @@ var units = Math.floor(max / 150) + 1; if (typeof max === 'number') { if (max < 5) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -20,8 +20,8 @@ if (typeof max === 'number') { if (max === touch.left) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowLeft' } @@ -31,8 +31,8 @@ if (typeof max === 'number') { if (max === touch.right) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowRight' } @@ -41,8 +41,8 @@ if (typeof max === 'number') { } if (max === touch.up) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -50,8 +50,8 @@ if (typeof max === 'number') { } if (max === touch.down) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'Space' } diff --git a/ongcnzdgae.js b/ongcnzdgae.js index ef15bba..1edfd95 100644 --- a/ongcnzdgae.js +++ b/ongcnzdgae.js @@ -1,5 +1,5 @@ this.stopSpawnBullet = function() { - this.beforeRender = GameLib.EntityManager.Instance.findComponentById('dywmtohrda'); + this.beforeRender = R3.EntityManager.Instance.findComponentById('dywmtohrda'); this.beforeRender.spawningBullets = false; } diff --git a/opxis1pjmo.js b/opxis1pjmo.js index e3d1cff..aeb911b 100644 --- a/opxis1pjmo.js +++ b/opxis1pjmo.js @@ -19,8 +19,8 @@ if (data.event.deltaY > 0) { this.cylinder.rotation.x -= 0.897597901; } -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Select' } @@ -28,7 +28,7 @@ GameLib.Event.Emit( //this.cylinder.rotation.x += data.event.deltaY * 0.01; -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +//R3.Event.Emit(R3.Event.MOUSE_UP); //mesh.rotation.x += data.event.deltaY * 0.001; //mesh.updateInstance('rotation'); diff --git a/orfy8cilgg.js b/orfy8cilgg.js index 4e93c38..4d0beb5 100644 --- a/orfy8cilgg.js +++ b/orfy8cilgg.js @@ -3,14 +3,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } @@ -20,14 +20,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1,5); + var play = R3.Utils.GetRandomIntInclusive(1,5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -74,7 +74,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -132,8 +132,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore : this.kanisterSpawnScore @@ -182,8 +182,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -214,8 +214,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level +', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level : this.level, enemySpawnInterval : this.enemySpawnInterval, @@ -227,8 +227,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function(kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); if (kanister) { meshType = 6; @@ -237,7 +237,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -291,15 +291,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -383,8 +383,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -402,8 +402,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -446,7 +446,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -466,8 +466,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { explodeParticleEngine.enabled = true; mesh.explodeParticleEngine = explodeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -499,8 +499,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'scoreUpdate', score : this.score @@ -511,8 +511,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnKanister(); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : mesh.enemy, event : 'enemyExploded' @@ -529,8 +529,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : mesh.enemy, event : 'enemyBurned' @@ -549,8 +549,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { fireParticleEngine.enabled = true; mesh.fireParticleEngine = fireParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -562,15 +562,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -616,8 +616,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameRunning', message : 'we have enough trees burning now to start - the enemy will spawn now' @@ -625,8 +625,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'treeBurned', treesBurning : this.treesBurning, @@ -669,8 +669,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { burningTreeParticleEngine.enabled = true; mesh.burningTreeParticleEngine = burningTreeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -678,8 +678,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game : this } @@ -741,7 +741,7 @@ if (this.mouseIsDown) } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -797,7 +797,7 @@ if (this.mouseIsDown) /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.burnLife)) { + if (R3.Utils.UndefinedOrNull(mesh.burnLife)) { mesh.burnLife = 1; mesh.burning = false; } @@ -844,8 +844,8 @@ else var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'fuelUsed', used : used, @@ -859,8 +859,8 @@ if (this.kanisterTime > this.kanisterLife) { this.kanisterTime = 0; this.kanisters -= 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -868,8 +868,8 @@ if (this.kanisterTime > this.kanisterLife) { ); if (this.kanisters < 0) { - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game : this } @@ -903,8 +903,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'enemyLifetimeReached', enemy : enemy @@ -924,7 +924,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { diff --git a/osynga17uj.js b/osynga17uj.js index 9d30f90..0718947 100644 --- a/osynga17uj.js +++ b/osynga17uj.js @@ -2,49 +2,49 @@ if (data.entity === this.parentEntity) { console.log('my entity loaded'); } -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('skmfv0tk0w'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('fhfk8i6u7v'); -this.keyDown = GameLib.EntityManager.Instance.findComponentById('4sjzwfvciu'); -this.touchStart = GameLib.EntityManager.Instance.findComponentById('fs7e9y1lhh'); -this.touchEnd = GameLib.EntityManager.Instance.findComponentById('3b588t2jz1'); -this.box2 = GameLib.EntityManager.Instance.findComponentById('rr7z2fcdax'); -this.image7 = GameLib.EntityManager.Instance.findComponentById('tzoiov5vo4'); -this.image10 = GameLib.EntityManager.Instance.findComponentById('md3iest7ox'); -this.image11 = GameLib.EntityManager.Instance.findComponentById('ofn6o71n9b'); -this.image13 = GameLib.EntityManager.Instance.findComponentById('1026puir3d'); -this.image14 = GameLib.EntityManager.Instance.findComponentById('vr9yv8qd2q'); -this.image15 = GameLib.EntityManager.Instance.findComponentById('jg7m44cfjc'); -this.boxCenter = GameLib.EntityManager.Instance.findComponentById('onflseabh3'); -this.animation = GameLib.EntityManager.Instance.findComponentById('0429064v9c'); -this.canvas = GameLib.EntityManager.Instance.findComponentById('kttg10l8u6'); -this.burnLight = GameLib.EntityManager.Instance.findComponentById('zstk8iq2p2'); -this.flamesSmall = GameLib.EntityManager.Instance.findComponentById('a3s12sqr9a'); -this.camera = GameLib.EntityManager.Instance.findComponentById('gruhmdgjmi'); -this.glow = GameLib.EntityManager.Instance.findComponentById('8ygsthn4n8'); -this.glowMaterial = GameLib.EntityManager.Instance.findComponentById('3kg5h22b3h'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('9azkxtbiaf'); -this.scene = GameLib.EntityManager.Instance.findComponentById('h30wqcvha0'); -this.gridMaterial = GameLib.EntityManager.Instance.findComponentById('jkpel4rvsy'); -this.animationSystems = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION); +this.beforeRender = R3.EntityManager.Instance.findComponentById('skmfv0tk0w'); +this.renderer = R3.EntityManager.Instance.findComponentById('fhfk8i6u7v'); +this.keyDown = R3.EntityManager.Instance.findComponentById('4sjzwfvciu'); +this.touchStart = R3.EntityManager.Instance.findComponentById('fs7e9y1lhh'); +this.touchEnd = R3.EntityManager.Instance.findComponentById('3b588t2jz1'); +this.box2 = R3.EntityManager.Instance.findComponentById('rr7z2fcdax'); +this.image7 = R3.EntityManager.Instance.findComponentById('tzoiov5vo4'); +this.image10 = R3.EntityManager.Instance.findComponentById('md3iest7ox'); +this.image11 = R3.EntityManager.Instance.findComponentById('ofn6o71n9b'); +this.image13 = R3.EntityManager.Instance.findComponentById('1026puir3d'); +this.image14 = R3.EntityManager.Instance.findComponentById('vr9yv8qd2q'); +this.image15 = R3.EntityManager.Instance.findComponentById('jg7m44cfjc'); +this.boxCenter = R3.EntityManager.Instance.findComponentById('onflseabh3'); +this.animation = R3.EntityManager.Instance.findComponentById('0429064v9c'); +this.canvas = R3.EntityManager.Instance.findComponentById('kttg10l8u6'); +this.burnLight = R3.EntityManager.Instance.findComponentById('zstk8iq2p2'); +this.flamesSmall = R3.EntityManager.Instance.findComponentById('a3s12sqr9a'); +this.camera = R3.EntityManager.Instance.findComponentById('gruhmdgjmi'); +this.glow = R3.EntityManager.Instance.findComponentById('8ygsthn4n8'); +this.glowMaterial = R3.EntityManager.Instance.findComponentById('3kg5h22b3h'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('9azkxtbiaf'); +this.scene = R3.EntityManager.Instance.findComponentById('h30wqcvha0'); +this.gridMaterial = R3.EntityManager.Instance.findComponentById('jkpel4rvsy'); +this.animationSystems = R3.EntityManager.Instance.queryComponents(R3.Component.SYSTEM_ANIMATION); -GameLib.CustomCode.TETRIS_BLOCK_I = 0; -GameLib.CustomCode.TETRIS_BLOCK_L = 1; -GameLib.CustomCode.TETRIS_BLOCK_L2 = 2; -GameLib.CustomCode.TETRIS_BLOCK_Z = 3; -GameLib.CustomCode.TETRIS_BLOCK_Z2 = 4; -GameLib.CustomCode.TETRIS_BLOCK_T = 5; -GameLib.CustomCode.TETRIS_BLOCK_O = 6; -GameLib.CustomCode.TETRIS_BLOCK_MAX = 7; +R3.CustomCode.TETRIS_BLOCK_I = 0; +R3.CustomCode.TETRIS_BLOCK_L = 1; +R3.CustomCode.TETRIS_BLOCK_L2 = 2; +R3.CustomCode.TETRIS_BLOCK_Z = 3; +R3.CustomCode.TETRIS_BLOCK_Z2 = 4; +R3.CustomCode.TETRIS_BLOCK_T = 5; +R3.CustomCode.TETRIS_BLOCK_O = 6; +R3.CustomCode.TETRIS_BLOCK_MAX = 7; -GameLib.CustomCode.TETRIS_GRID_WIDTH = 11; -GameLib.CustomCode.TETRIS_GRID_HEIGHT = 24; -GameLib.CustomCode.TETRIS_GRID_HEADSPACE = 4; +R3.CustomCode.TETRIS_GRID_WIDTH = 11; +R3.CustomCode.TETRIS_GRID_HEIGHT = 24; +R3.CustomCode.TETRIS_GRID_HEADSPACE = 4; -GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; -GameLib.CustomCode.TETRIS_GRID_TAKEN = 1; -GameLib.CustomCode.TETRIS_GRID_DISAPPEARING = 2; +R3.CustomCode.TETRIS_GRID_NOT_TAKEN = 0; +R3.CustomCode.TETRIS_GRID_TAKEN = 1; +R3.CustomCode.TETRIS_GRID_DISAPPEARING = 2; -GameLib.CustomCode.prototype.visualizeGrid = function (color) { +R3.CustomCode.prototype.visualizeGrid = function (color) { if (this.starsMesh) { this.scene.instance.remove(this.starsMesh); @@ -54,7 +54,7 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { for (var y = 0; y < this.beforeRender.grid.length; y++) { for (var x = 0; x < this.beforeRender.grid[y].length; x++) { - if (this.beforeRender.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.beforeRender.grid[y][x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { this.starsGeometry.vertices.push( new THREE.Vector3( x, @@ -74,19 +74,19 @@ GameLib.CustomCode.prototype.visualizeGrid = function (color) { }.bind(this) -GameLib.CustomCode.prototype.startAnimation = function (index) { +R3.CustomCode.prototype.startAnimation = function (index) { var glow = this.glow.clone(); glow.position.y = index; - glow.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + glow.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; glow.position.z = 2; glow.updateInstance('position'); var flames = this.flamesSmall.clone(); flames.position.y = index + 1; - flames.position.x = (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; + flames.position.x = (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5; flames.position.z = 2; flames.updateInstance('position'); @@ -102,18 +102,18 @@ GameLib.CustomCode.prototype.startAnimation = function (index) { }.bind(this) -GameLib.CustomCode.prototype.removeLines = function () { +R3.CustomCode.prototype.removeLines = function () { var indices = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { var line = true; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.beforeRender.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN || - this.beforeRender.grid[y][x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING + this.beforeRender.grid[y][x].value === R3.CustomCode.TETRIS_GRID_NOT_TAKEN || + this.beforeRender.grid[y][x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING ) { line = false; } @@ -222,8 +222,8 @@ GameLib.CustomCode.prototype.removeLines = function () { indices.map( function (index) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { - this.beforeRender.grid[index][x].value = GameLib.CustomCode.TETRIS_GRID_DISAPPEARING; + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { + this.beforeRender.grid[index][x].value = R3.CustomCode.TETRIS_GRID_DISAPPEARING; } this.startAnimation(index); }.bind(this) @@ -232,7 +232,7 @@ GameLib.CustomCode.prototype.removeLines = function () { }.bind(this); -GameLib.CustomCode.prototype.drawStatus = function () { +R3.CustomCode.prototype.drawStatus = function () { var context = this.canvas.instance.getContext('2d'); context.textBaseline = "middle"; @@ -307,7 +307,7 @@ GameLib.CustomCode.prototype.drawStatus = function () { this.scoreTexture.instance.needsUpdate = true; }.bind(this) -GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { +R3.CustomCode.prototype.getBlockGridPositions = function (block) { var object = new THREE.Mesh(); @@ -357,7 +357,7 @@ GameLib.CustomCode.prototype.getBlockGridPositions = function (block) { }.bind(this); -GameLib.CustomCode.prototype.stopAnimations = function () { +R3.CustomCode.prototype.stopAnimations = function () { this.animationSystems.map( function (system) { if (system.started) { @@ -367,7 +367,7 @@ GameLib.CustomCode.prototype.stopAnimations = function () { ); }.bind(this) -GameLib.CustomCode.prototype.startAnimations = function () { +R3.CustomCode.prototype.startAnimations = function () { this.animationSystems.map( function (system) { if (!system.started) { @@ -377,15 +377,15 @@ GameLib.CustomCode.prototype.startAnimations = function () { ); }.bind(this) -GameLib.CustomCode.prototype.drawGrid = function () { +R3.CustomCode.prototype.drawGrid = function () { this.gridMaterial.color.fromHex('#3db5e6'); this.gridMaterial.color.updateInstance('color'); var geometry = new THREE.Geometry(); - for (var y = 0; y < (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE); y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = 0; y < (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE); y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { geometry.vertices.push( new THREE.Vector3( x, @@ -403,7 +403,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { geometry.vertices.push( new THREE.Vector3( -0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ), new THREE.Vector3( @@ -412,13 +412,13 @@ GameLib.CustomCode.prototype.drawGrid = function () { 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, -0.5, 5 ), new THREE.Vector3( - GameLib.CustomCode.TETRIS_GRID_WIDTH - 0.5, - GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, + R3.CustomCode.TETRIS_GRID_WIDTH - 0.5, + R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE - 0.5, 5 ) ); @@ -438,7 +438,7 @@ GameLib.CustomCode.prototype.drawGrid = function () { }.bind(this) -GameLib.CustomCode.prototype.checkBoundaries = function (block) { +R3.CustomCode.prototype.checkBoundaries = function (block) { /** * collisions are true only for out of bounds indexes, and if the current block is taken @@ -462,7 +462,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { leftHit = true; } - if (position.x === (GameLib.CustomCode.TETRIS_GRID_WIDTH - 1)) { + if (position.x === (R3.CustomCode.TETRIS_GRID_WIDTH - 1)) { rightHit = true; } @@ -470,7 +470,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { bottomHit = true; } - if (position.y === (GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1)) { + if (position.y === (R3.CustomCode.TETRIS_GRID_HEIGHT - 1)) { topHit = true; } @@ -481,7 +481,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.x >= GameLib.CustomCode.TETRIS_GRID_WIDTH) { + if (position.x >= R3.CustomCode.TETRIS_GRID_WIDTH) { collision = true; } @@ -489,7 +489,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { collision = true; } - if (position.y >= GameLib.CustomCode.TETRIS_GRID_HEIGHT) { + if (position.y >= R3.CustomCode.TETRIS_GRID_HEIGHT) { collision = true; } @@ -498,14 +498,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * be sure x+1 is inside bounds */ if ( - ((position.x + 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) && + ((position.x + 1) < R3.CustomCode.TETRIS_GRID_WIDTH) && ((position.x + 1) >= 0) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.beforeRender.grid[position.y][position.x + 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.beforeRender.grid[position.y][position.x + 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - we found a block to the right - its over */ @@ -521,14 +521,14 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.x) > 0) && ((position.x - 1) >= 0) && - ((position.x - 1) < GameLib.CustomCode.TETRIS_GRID_WIDTH) + ((position.x - 1) < R3.CustomCode.TETRIS_GRID_WIDTH) ) { /** * But we cannot be sure y is inside bounds */ - if (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { - if (this.beforeRender.grid[position.y][position.x - 1].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) { + if (this.beforeRender.grid[position.y][position.x - 1].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * We found a block to the left - its over also */ @@ -541,15 +541,15 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * Now we want to see if the block above is taken, we cannot be sure y+1 is inside bounds */ if ( - ((position.y + 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) && + ((position.y + 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) && ((position.y + 1) >= 0) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.beforeRender.grid[position.y + 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.beforeRender.grid[position.y + 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block is at the top */ @@ -564,20 +564,20 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { if ( ((position.y) > 0) && ((position.y - 1) >= 0) && - ((position.y - 1) < GameLib.CustomCode.TETRIS_GRID_HEIGHT) + ((position.y - 1) < R3.CustomCode.TETRIS_GRID_HEIGHT) ) { /** * We cannot be sure, position.x is inside bounds */ - if (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { - if (this.beforeRender.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) { + if (this.beforeRender.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { /** * Ok - this block hit bottom */ bottomHit = true; } - if (this.beforeRender.grid[position.y - 1][position.x].value === GameLib.CustomCode.TETRIS_GRID_DISAPPEARING) { + if (this.beforeRender.grid[position.y - 1][position.x].value === R3.CustomCode.TETRIS_GRID_DISAPPEARING) { bottomDisappearing = true; } } @@ -588,10 +588,10 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { * we cannot be sure, x and y is inside bounds */ if ( - (position.x < GameLib.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && - (position.y < GameLib.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) + (position.x < R3.CustomCode.TETRIS_GRID_WIDTH && position.x >= 0) && + (position.y < R3.CustomCode.TETRIS_GRID_HEIGHT && position.y >= 0) ) { - if (this.beforeRender.grid[position.y][position.x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN) { + if (this.beforeRender.grid[position.y][position.x].value === R3.CustomCode.TETRIS_GRID_TAKEN) { collision = true; } } @@ -609,7 +609,7 @@ GameLib.CustomCode.prototype.checkBoundaries = function (block) { }.bind(this) -GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { +R3.CustomCode.prototype.rotateBlock = function (clockwise) { if (this.beforeRender.gameOver) { return; @@ -650,7 +650,7 @@ GameLib.CustomCode.prototype.rotateBlock = function (clockwise) { }.bind(this); -GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { +R3.CustomCode.prototype.moveBlock = function (block, direction, units, collisionCheck) { if (!units) { units = 1; @@ -719,7 +719,7 @@ GameLib.CustomCode.prototype.moveBlock = function (block, direction, units, coll return moved; }.bind(this); -GameLib.CustomCode.prototype.spawnBlock = function () { +R3.CustomCode.prototype.spawnBlock = function () { var blockType = Math.floor(Math.random() * 7); @@ -743,7 +743,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { center.position.x = 0; center.position.z = 0.4; - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_I) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_I) { mesh0 = this.box11.clone(); mesh0.position.setFrom(center.position); @@ -775,7 +775,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.5; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L) { mesh0 = this.box14.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -807,7 +807,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_L2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_L2) { mesh0 = this.box14.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -839,7 +839,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z) { mesh0 = this.box10.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -870,7 +870,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_Z2) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_Z2) { mesh0 = this.box10.clone(); mesh0.position.setFrom(center.position); @@ -902,7 +902,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 15.3; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_T) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_T) { mesh0 = this.box14.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -932,7 +932,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { nextPositionY = 16; } - if (blockType === GameLib.CustomCode.TETRIS_BLOCK_O) { + if (blockType === R3.CustomCode.TETRIS_BLOCK_O) { mesh0 = this.box10.clone(); mesh0.position.setFrom(center.position); mesh0.position.z = -0.1; @@ -1007,7 +1007,7 @@ GameLib.CustomCode.prototype.spawnBlock = function () { }.bind(this) -GameLib.CustomCode.prototype.spawnTinyBlock = function () { +R3.CustomCode.prototype.spawnTinyBlock = function () { var block = this.spawnBlock(); @@ -1030,7 +1030,7 @@ GameLib.CustomCode.prototype.spawnTinyBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnNextBlock = function () { +R3.CustomCode.prototype.spawnNextBlock = function () { if (!this.tinyBlock) { this.tinyBlock = this.spawnTinyBlock(); @@ -1053,7 +1053,7 @@ GameLib.CustomCode.prototype.spawnNextBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.spawnBigBlock = function () { +R3.CustomCode.prototype.spawnBigBlock = function () { if (!this.nextBlock) { this.nextBlock = this.spawnNextBlock(); @@ -1071,8 +1071,8 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { block.center.position.z = 0.4; block.center.updateInstance('position'); - this.moveBlock(block, {up: true}, (GameLib.CustomCode.TETRIS_GRID_HEIGHT - GameLib.CustomCode.TETRIS_GRID_HEADSPACE), false); - this.moveBlock(block, {right: true}, GameLib.CustomCode.TETRIS_GRID_WIDTH / 2, false); + this.moveBlock(block, {up: true}, (R3.CustomCode.TETRIS_GRID_HEIGHT - R3.CustomCode.TETRIS_GRID_HEADSPACE), false); + this.moveBlock(block, {right: true}, R3.CustomCode.TETRIS_GRID_WIDTH / 2, false); this.moveBlock(block, {left: true}, block.offset.x, false); this.moveBlock(block, {down: true}, block.offset.y, false); @@ -1081,7 +1081,7 @@ GameLib.CustomCode.prototype.spawnBigBlock = function () { return block; }.bind(this) -GameLib.CustomCode.prototype.getNextBlock = function () { +R3.CustomCode.prototype.getNextBlock = function () { this.stopAnimations(); @@ -1089,8 +1089,8 @@ GameLib.CustomCode.prototype.getNextBlock = function () { this.block = this.beforeRender.block; - GameLib.Event.Emit( - GameLib.Event.COMPONENT_REGISTER, + R3.Event.Emit( + R3.Event.COMPONENT_REGISTER, { component: this.block.center } @@ -1102,27 +1102,27 @@ GameLib.CustomCode.prototype.getNextBlock = function () { }.bind(this); -if (GameLib.Utils.UndefinedOrNull(this.subscriptions)) { +if (R3.Utils.UndefinedOrNull(this.subscriptions)) { this.subscriptions = []; - GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_CODE_WINDOW_RESIZE, + R3.Event.Subscribe( + R3.Event.CUSTOM_CODE_WINDOW_RESIZE, function (data) { //var aspect = data.width / data.height; - this.camera.offsetX = -((this.camera.maxX - this.camera.minX) / 2) + (GameLib.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5 - (0.5 * this.camera.aspect); + this.camera.offsetX = -((this.camera.maxX - this.camera.minX) / 2) + (R3.CustomCode.TETRIS_GRID_WIDTH / 2) - 0.5 - (0.5 * this.camera.aspect); this.camera.updateInstance('offsetX'); }.bind(this) ) this.subscriptions.push( - new GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, + new R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function () { - GameLib.Event.Emit( - GameLib.Event.WINDOW_RESIZE, + R3.Event.Emit( + R3.Event.WINDOW_RESIZE, { width : window.innerWidth, height : window.innerHeight @@ -1219,6 +1219,6 @@ material.diffuseMap = texture; this.box15.materials = [material]; this.box15.materials[0].updateInstance('diffuseMap'); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js \ No newline at end of file diff --git a/ot5qabk55a.js b/ot5qabk55a.js index 5e872b3..3ebbb61 100644 --- a/ot5qabk55a.js +++ b/ot5qabk55a.js @@ -1,5 +1,5 @@ -if (GameLib.Utils.UndefinedOrNull(this.camera)) { - this.camera = GameLib.EntityManager.Instance.findComponentById('yv62w8sx9r'); +if (R3.Utils.UndefinedOrNull(this.camera)) { + this.camera = R3.EntityManager.Instance.findComponentById('yv62w8sx9r'); } if (data.event.deltaY < 0 && this.camera.fov > 30) { diff --git a/oy9qzqcgth.js b/oy9qzqcgth.js index c9407ca..89e7d00 100644 --- a/oy9qzqcgth.js +++ b/oy9qzqcgth.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/p175o1nwha.js b/p175o1nwha.js index f023c10..f8d4ac6 100644 --- a/p175o1nwha.js +++ b/p175o1nwha.js @@ -10,68 +10,68 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; -GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE = 5; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.OBJECT_BUFFER_SIZE = 5; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('i0rg1l361y') -this.bull = GameLib.EntityManager.Instance.findComponentById('c9yng00y8l'); -this.star = GameLib.EntityManager.Instance.findComponentById('dbwtz4gotd'); -this.burger = GameLib.EntityManager.Instance.findComponentById('u45te6io01'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('53jpk7dje0'); -this.santa = GameLib.EntityManager.Instance.findComponentById('9fkp3k62qq'); -this.camera = GameLib.EntityManager.Instance.findComponentById('9z6gqq0fpl'); -this.scene = GameLib.EntityManager.Instance.findComponentById('42uoeb9fu9'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('yrlzsmgme5'); -this.dom = GameLib.EntityManager.Instance.findComponentById('y4w6cabsb3'); +this.fog = R3.EntityManager.Instance.findComponentById('i0rg1l361y') +this.bull = R3.EntityManager.Instance.findComponentById('c9yng00y8l'); +this.star = R3.EntityManager.Instance.findComponentById('dbwtz4gotd'); +this.burger = R3.EntityManager.Instance.findComponentById('u45te6io01'); +this.parcel = R3.EntityManager.Instance.findComponentById('53jpk7dje0'); +this.santa = R3.EntityManager.Instance.findComponentById('9fkp3k62qq'); +this.camera = R3.EntityManager.Instance.findComponentById('9z6gqq0fpl'); +this.scene = R3.EntityManager.Instance.findComponentById('42uoeb9fu9'); +this.cursor = R3.EntityManager.Instance.findComponentById('yrlzsmgme5'); +this.dom = R3.EntityManager.Instance.findComponentById('y4w6cabsb3'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('9bimw7t8ga'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('b0gygwrgqv'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('ja3zch4ok1'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('th685xsq4d'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('t7r4ygcgvd'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('zd27xo2y2e'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('8urqko5itn'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('tfrkuqvu5a'); +this.renderer = R3.EntityManager.Instance.findComponentById('9bimw7t8ga'); +this.thrower = R3.EntityManager.Instance.findComponentById('b0gygwrgqv'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('ja3zch4ok1'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('th685xsq4d'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('t7r4ygcgvd'); +this.stone1 = R3.EntityManager.Instance.findComponentById('zd27xo2y2e'); +this.stone2 = R3.EntityManager.Instance.findComponentById('8urqko5itn'); +this.kanister = R3.EntityManager.Instance.findComponentById('tfrkuqvu5a'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('a23enuucn3'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('wy14shlwj5'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('ogixyaoskt'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('hr3ex6kn17'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('j8txhzx9p4'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('8k7j0kfuh6'); +this.leftLight = R3.EntityManager.Instance.findComponentById('a23enuucn3'); +this.rightLight = R3.EntityManager.Instance.findComponentById('wy14shlwj5'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('ogixyaoskt'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('hr3ex6kn17'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('j8txhzx9p4'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('8k7j0kfuh6'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('o41wzbhvrz'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('vprs3w929e'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('itpnoks54l'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('zvobdfh9gq'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('0u6t21ddt1'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('o41wzbhvrz'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('vprs3w929e'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('itpnoks54l'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('zvobdfh9gq'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('0u6t21ddt1'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('ei9eku91s3'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('ei9eku91s3'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('bwrgfra6bd'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('oy9qzqcgth'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('i81v62aooq'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('1gr377k5r6'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('ypiqj5r40j'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('bwrgfra6bd'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('oy9qzqcgth'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('i81v62aooq'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('1gr377k5r6'); +this.touchMove = R3.EntityManager.Instance.findComponentById('ypiqj5r40j'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -86,8 +86,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -98,7 +98,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -164,27 +164,27 @@ this.createMesh = function(meshType) { ); }; -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('bull'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('star'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('burger'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('parcel'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('santa'); } -for (var n = 0; n < GameLib.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { +for (var n = 0; n < R3.D3.CustomCode.OBJECT_BUFFER_SIZE; n++) { this.createMesh('kanister'); } @@ -1438,7 +1438,7 @@ burningTreeParticleEngine.position.y += mesh.dimensions.y + 5; burningTreeParticleEngine.updateInstance('position'); this.treeLarge.burningTreeParticleEngine = burningTreeParticleEngine; -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/p6aqxjt7ku.js b/p6aqxjt7ku.js index 832050c..ac81872 100644 --- a/p6aqxjt7ku.js +++ b/p6aqxjt7ku.js @@ -21,18 +21,18 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); -this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, +this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); if (this.subscription) { this.subscription.remove(); this.subscription = null; diff --git a/p8vrkr6fx6.js b/p8vrkr6fx6.js index fde585c..8c1444e 100644 --- a/p8vrkr6fx6.js +++ b/p8vrkr6fx6.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/pgx4qp38d4.js b/pgx4qp38d4.js index fe9fa0f..e7cde97 100644 --- a/pgx4qp38d4.js +++ b/pgx4qp38d4.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/plccpu9dx0.js b/plccpu9dx0.js index e849323..1596836 100644 --- a/plccpu9dx0.js +++ b/plccpu9dx0.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -37,8 +37,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -46,7 +46,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -56,10 +56,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -98,15 +98,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -182,7 +182,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('exploding enemy'); enemy.exploding = true; - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -194,8 +194,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === name) { @@ -206,8 +206,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription = null; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -217,8 +217,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { }.bind(this) ); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -249,8 +249,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { smokeParticleEngine.enabled = true; enemy.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -272,15 +272,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -325,8 +325,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { // mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -421,7 +421,7 @@ if (this.mouseIsDown) { /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -478,7 +478,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; enemy.mesh.visible = false; enemy.mesh.updateInstance('visible'); diff --git a/pxcqbyldn.js b/pxcqbyldn.js index 7019058..046d570 100644 --- a/pxcqbyldn.js +++ b/pxcqbyldn.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -36,8 +36,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -45,7 +45,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -55,10 +55,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -97,15 +97,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -330,15 +330,15 @@ this.enemies = this.enemies.reduce( /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/qemp4een6t.js b/qemp4een6t.js index 2c204a4..f071eaa 100644 --- a/qemp4een6t.js +++ b/qemp4een6t.js @@ -2,14 +2,14 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Xmas' } @@ -19,14 +19,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function (data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1, 5); + var play = R3.Utils.GetRandomIntInclusive(1, 5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Ho ho ho' } @@ -72,7 +72,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -106,7 +106,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } if (this.score > 5000) { - var dice = GameLib.Utils.GetRandomIntInclusive(1, 10); + var dice = R3.Utils.GetRandomIntInclusive(1, 10); /** * Max average spawn = 5.41 @@ -122,8 +122,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore: this.kanisterSpawnScore @@ -194,8 +194,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('level : ' + this.level + ', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level: this.level, enemySpawnInterval: this.enemySpawnInterval, @@ -222,14 +222,14 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function (kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); var meshTypeIndex; if (kanister) { meshTypeIndex = 6; } else { - meshTypeIndex = GameLib.Utils.GetRandomIntInclusive(1, 5); + meshTypeIndex = R3.Utils.GetRandomIntInclusive(1, 5); } var meshType = null; @@ -287,8 +287,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'kanisterCountUpdate', kanisters: this.kanisters @@ -300,19 +300,19 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1, 10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1, + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1, + R3.Utils.GetRandomIntInclusive(1, 10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1, 100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1, 100) * 0.001; var position = {x: 0, y: y, z: 0}; @@ -395,8 +395,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { if (kanister) { enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -441,7 +441,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1, 3); + var sound = R3.Utils.GetRandomIntInclusive(1, 3); var name = 'Audio - Blast 1'; @@ -459,8 +459,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.explodeParticleEngine.updateInstance('position'); mesh.explodeParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: name } @@ -487,8 +487,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemiesExploded += 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy: mesh.enemy, event: 'enemyExploded' @@ -501,8 +501,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'scoreUpdate', score: this.score @@ -521,8 +521,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy: mesh.enemy, event: 'enemyBurned' @@ -541,8 +541,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.fireParticleEngine.updateInstance('position'); mesh.fireParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Burning' } @@ -597,8 +597,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'gameRunning', message: 'we have enough trees burning now to start - the enemy will spawn now' @@ -606,8 +606,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'treeBurned', treesBurning: this.treesBurning, @@ -631,8 +631,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { mesh.burningTreeParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name: 'Audio - Burning' } @@ -640,8 +640,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game: this } @@ -734,7 +734,7 @@ if (this.mouseIsDown) { /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.burnLife)) { + if (R3.Utils.UndefinedOrNull(mesh.burnLife)) { mesh.burnLife = 1; mesh.burning = false; } @@ -774,8 +774,8 @@ else { var used = this.kanisterTime / this.kanisterLife; -GameLib.Event.Emit( - GameLib.Event.GAME_DATA, +R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'fuelUsed', used: used, @@ -791,8 +791,8 @@ if (this.kanisterTime > this.kanisterLife) { console.log('kanister count: ' + this.kanisters); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'kanisterCountUpdate', kanisters: this.kanisters @@ -801,8 +801,8 @@ if (this.kanisterTime > this.kanisterLife) { if (this.kanisters < 0) { console.log('no more kanisters'); - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game: this } @@ -835,8 +835,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event: 'enemyLifetimeReached', enemy: enemy @@ -856,7 +856,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { diff --git a/qi81k80v08.js b/qi81k80v08.js index b4e3314..72686d4 100644 --- a/qi81k80v08.js +++ b/qi81k80v08.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -24,8 +24,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -33,7 +33,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -43,12 +43,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 4); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 4); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; @@ -75,15 +75,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -166,8 +166,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/r17o00dvgo.js b/r17o00dvgo.js index f770088..3f6a68a 100644 --- a/r17o00dvgo.js +++ b/r17o00dvgo.js @@ -2,12 +2,12 @@ if (!this.entityLoaded) { return; } -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); /* if (data.down > 0) { - GameLib.Event.Emit( - GameLib.Event.MOUSE_WHEEL, + R3.Event.Emit( + R3.Event.MOUSE_WHEEL, { event : { deltaY : 1 @@ -15,8 +15,8 @@ if (data.down > 0) { } ) } else { - GameLib.Event.Emit( - GameLib.Event.MOUSE_WHEEL, + R3.Event.Emit( + R3.Event.MOUSE_WHEEL, { event : { deltaY : -1 diff --git a/rc9spzn6vm.js b/rc9spzn6vm.js index 142f832..7807b93 100644 --- a/rc9spzn6vm.js +++ b/rc9spzn6vm.js @@ -9,62 +9,62 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('ewwv18l4w9') -this.bull = GameLib.EntityManager.Instance.findComponentById('h6ei4ea9ed'); -this.star = GameLib.EntityManager.Instance.findComponentById('82sqqz9utj'); -this.burger = GameLib.EntityManager.Instance.findComponentById('xlqe8f2w0a'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('qyvchg9yl2'); -this.santa = GameLib.EntityManager.Instance.findComponentById('2v80p9w7c1'); -this.camera = GameLib.EntityManager.Instance.findComponentById('3juvwku8s2'); -this.scene = GameLib.EntityManager.Instance.findComponentById('2o63veksyv'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('1j2rdo7brt'); +this.fog = R3.EntityManager.Instance.findComponentById('ewwv18l4w9') +this.bull = R3.EntityManager.Instance.findComponentById('h6ei4ea9ed'); +this.star = R3.EntityManager.Instance.findComponentById('82sqqz9utj'); +this.burger = R3.EntityManager.Instance.findComponentById('xlqe8f2w0a'); +this.parcel = R3.EntityManager.Instance.findComponentById('qyvchg9yl2'); +this.santa = R3.EntityManager.Instance.findComponentById('2v80p9w7c1'); +this.camera = R3.EntityManager.Instance.findComponentById('3juvwku8s2'); +this.scene = R3.EntityManager.Instance.findComponentById('2o63veksyv'); +this.cursor = R3.EntityManager.Instance.findComponentById('1j2rdo7brt'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('cv0623pwmc'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('febclnt5j2'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('2kpab5ax4s'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('wutefzk43m'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('lw0dk2bl2x'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('uylp0ge3c2'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('cqre1tfjen'); +this.thrower = R3.EntityManager.Instance.findComponentById('cv0623pwmc'); +this.renderer = R3.EntityManager.Instance.findComponentById('febclnt5j2'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('2kpab5ax4s'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('wutefzk43m'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('lw0dk2bl2x'); +this.stone1 = R3.EntityManager.Instance.findComponentById('uylp0ge3c2'); +this.stone2 = R3.EntityManager.Instance.findComponentById('cqre1tfjen'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('mva3di62vs'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('cgmtjsp2gp'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('cb37us9z47'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('jsfrmbkdev'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('mva3di62vs'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('cgmtjsp2gp'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('cb37us9z47'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('jsfrmbkdev'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('bh0rnxq01q'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('bh0rnxq01q'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('y10x7l8mj6'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('y10x7l8mj6'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('yywxa78hfp'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('yywxa78hfp'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('iv4irhd4cz'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('iv4irhd4cz'); this.mouseMove.entityLoaded = this; -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); /** * Plant all our trees - Below code gets generated automatically diff --git a/rr19ue5nsp.js b/rr19ue5nsp.js index 8ce1a5f..58b70d6 100644 --- a/rr19ue5nsp.js +++ b/rr19ue5nsp.js @@ -1,8 +1,8 @@ if (this.parentEntity === data.entity) { console.log('Entity SpoonLib Loaded'); - this.mouseMove = GameLib.EntityManager.Instance.findComponentById('r8z71ver1l'); - this.camera = GameLib.EntityManager.Instance.findComponentById('yk1vij1p1e'); + this.mouseMove = R3.EntityManager.Instance.findComponentById('r8z71ver1l'); + this.camera = R3.EntityManager.Instance.findComponentById('yk1vij1p1e'); this.mouseMove.entityLoaded = this; } diff --git a/rye7qm3207.js b/rye7qm3207.js index cfff51d..0bab02b 100644 --- a/rye7qm3207.js +++ b/rye7qm3207.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/s2rs6hclk6.js b/s2rs6hclk6.js index fde585c..8c1444e 100644 --- a/s2rs6hclk6.js +++ b/s2rs6hclk6.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/schmhl1bp5.js b/schmhl1bp5.js index e3d1cff..aeb911b 100644 --- a/schmhl1bp5.js +++ b/schmhl1bp5.js @@ -19,8 +19,8 @@ if (data.event.deltaY > 0) { this.cylinder.rotation.x -= 0.897597901; } -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Select' } @@ -28,7 +28,7 @@ GameLib.Event.Emit( //this.cylinder.rotation.x += data.event.deltaY * 0.01; -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +//R3.Event.Emit(R3.Event.MOUSE_UP); //mesh.rotation.x += data.event.deltaY * 0.001; //mesh.updateInstance('rotation'); diff --git a/sihhl2ejqe.js b/sihhl2ejqe.js index fe66f0c..9dcc8fb 100644 --- a/sihhl2ejqe.js +++ b/sihhl2ejqe.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/skmfv0tk0w.js b/skmfv0tk0w.js index c47dc3f..555df22 100644 --- a/skmfv0tk0w.js +++ b/skmfv0tk0w.js @@ -38,11 +38,11 @@ if (!this.initialized) { * Initialize the grid */ this.grid = []; - for (var y = 0; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT; y++) { + for (var y = 0; y < R3.CustomCode.TETRIS_GRID_HEIGHT; y++) { this.grid[y] = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { this.grid[y][x] = { - value: GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value: R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh: null }; } @@ -52,8 +52,8 @@ if (!this.initialized) { this.animation.removeMesh(this.block.center); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -63,8 +63,8 @@ if (!this.initialized) { if (this.block && this.block.meshes) { this.block.meshes.map( function (mesh) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: mesh } @@ -110,15 +110,15 @@ this.animationObjects.map( this.burnLight.intensity = 0; this.burnLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: animationObject.glow } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: animationObject.flames } @@ -128,14 +128,14 @@ this.animationObjects.map( /** * Remove the meshes */ - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (!this.grid[animationObject.rowNumber][x].mesh) { throw new Error('mesh should exist but does not'); } - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.grid[animationObject.rowNumber][x].mesh } @@ -150,10 +150,10 @@ this.animationObjects.map( var row = []; - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { row.push( { - value: GameLib.CustomCode.TETRIS_GRID_NOT_TAKEN, + value: R3.CustomCode.TETRIS_GRID_NOT_TAKEN, mesh: null } ) @@ -164,8 +164,8 @@ this.animationObjects.map( /** * Now - drop all blocks above the current index down one row */ - for (var y = animationObject.rowNumber; y < GameLib.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var y = animationObject.rowNumber; y < R3.CustomCode.TETRIS_GRID_HEIGHT - 1; y++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if (this.grid[y][x].mesh) { this.grid[y][x].mesh.position.y = y; @@ -267,7 +267,7 @@ if (moved === false) { } this.grid[position.y][position.x] = { - value: GameLib.CustomCode.TETRIS_GRID_TAKEN, + value: R3.CustomCode.TETRIS_GRID_TAKEN, mesh: position.mesh }; }.bind(this) @@ -295,8 +295,8 @@ if (moved === false) { this.animation.removeMesh(this.block.center); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component: this.block.center } @@ -306,13 +306,13 @@ if (moved === false) { //this.visualizeGrid(0xff0000); - for (var x = 0; x < GameLib.CustomCode.TETRIS_GRID_WIDTH; x++) { + for (var x = 0; x < R3.CustomCode.TETRIS_GRID_WIDTH; x++) { if ( - this.grid[19][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[20][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[21][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[22][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN || - this.grid[23][x].value === GameLib.CustomCode.TETRIS_GRID_TAKEN + this.grid[19][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[20][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[21][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[22][x].value === R3.CustomCode.TETRIS_GRID_TAKEN || + this.grid[23][x].value === R3.CustomCode.TETRIS_GRID_TAKEN ) { this.gameOver = true; } @@ -328,8 +328,8 @@ if (moved === false) { delete this.block; - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { score: this.entityLoaded.score, level: this.entityLoaded.level, diff --git a/sp1vcnd2nx.js b/sp1vcnd2nx.js index 4ea9a75..5a8dbad 100644 --- a/sp1vcnd2nx.js +++ b/sp1vcnd2nx.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } @@ -10,8 +10,8 @@ var units = Math.floor(max / 150) + 1; if (typeof max === 'number') { if (max < 5) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -20,8 +20,8 @@ if (typeof max === 'number') { if (max === touch.left) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowLeft' } @@ -31,8 +31,8 @@ if (typeof max === 'number') { if (max === touch.right) { for (var i = 0; i < units; i++) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowRight' } @@ -41,8 +41,8 @@ if (typeof max === 'number') { } if (max === touch.up) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'ArrowUp' } @@ -50,8 +50,8 @@ if (typeof max === 'number') { } if (max === touch.down) { - GameLib.Event.Emit( - GameLib.Event.KEY_DOWN, + R3.Event.Emit( + R3.Event.KEY_DOWN, { code : 'Space' } diff --git a/ssnsx133fu.js b/ssnsx133fu.js index fe9fa0f..e7cde97 100644 --- a/ssnsx133fu.js +++ b/ssnsx133fu.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/t3ks0fx53q.js b/t3ks0fx53q.js index fe9fa0f..e7cde97 100644 --- a/t3ks0fx53q.js +++ b/t3ks0fx53q.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/th7uharr0r.js b/th7uharr0r.js index fe66f0c..9dcc8fb 100644 --- a/th7uharr0r.js +++ b/th7uharr0r.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/tkon6j88hn.js b/tkon6j88hn.js index fe66f0c..9dcc8fb 100644 --- a/tkon6j88hn.js +++ b/tkon6j88hn.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/tlfd3vbn9k.js b/tlfd3vbn9k.js index be60b1d..648e7b7 100644 --- a/tlfd3vbn9k.js +++ b/tlfd3vbn9k.js @@ -6,8 +6,8 @@ var movementY = data.meta.totalDown - data.meta.totalUp; //console.log(movementY); -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { movementY : movementY diff --git a/to6trvr3fj.js b/to6trvr3fj.js index 175063f..bde640a 100644 --- a/to6trvr3fj.js +++ b/to6trvr3fj.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -37,8 +37,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -46,7 +46,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -56,10 +56,10 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -98,15 +98,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -182,7 +182,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { console.log('exploding enemy'); enemy.exploding = true; - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -194,8 +194,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { name = 'Audio - Blast 3'; } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === name) { @@ -206,8 +206,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.blastSubscription = null; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -217,8 +217,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { }.bind(this) ); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -249,8 +249,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { smokeParticleEngine.enabled = true; enemy.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -272,15 +272,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { /** * We only remove the things we cloned */ - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -319,8 +319,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { // mesh.smokeParticleEngine = smokeParticleEngine; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -415,7 +415,7 @@ if (this.mouseIsDown) { /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -472,7 +472,7 @@ this.enemies = this.enemies.reduce( * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; enemy.mesh.visible = false; enemy.mesh.updateInstance('visible'); diff --git a/tuby5lj4di.js b/tuby5lj4di.js index 6b100c8..6ce13ee 100644 --- a/tuby5lj4di.js +++ b/tuby5lj4di.js @@ -7,10 +7,10 @@ if (this.parentEntity === data.entity) { /** * Images */ -this.imageSpoon = GameLib.EntityManager.Instance.findComponentById('g6oggbsg5k'); -this.imageEarth = GameLib.EntityManager.Instance.findComponentById('fo1einfper'); -this.imageBK = GameLib.EntityManager.Instance.findComponentById('3ufmzrnewa'); -this.imageHorse = GameLib.EntityManager.Instance.findComponentById('w4koth16uf'); +this.imageSpoon = R3.EntityManager.Instance.findComponentById('g6oggbsg5k'); +this.imageEarth = R3.EntityManager.Instance.findComponentById('fo1einfper'); +this.imageBK = R3.EntityManager.Instance.findComponentById('3ufmzrnewa'); +this.imageHorse = R3.EntityManager.Instance.findComponentById('w4koth16uf'); this.images = [ this.imageSpoon, @@ -22,42 +22,42 @@ this.images = [ /** * Meshes */ -this.meshBox = GameLib.EntityManager.Instance.findComponentById('2ehdod2g2a'); -this.meshImageGrid = GameLib.EntityManager.Instance.findComponentById('9qkka13nor'); +this.meshBox = R3.EntityManager.Instance.findComponentById('2ehdod2g2a'); +this.meshImageGrid = R3.EntityManager.Instance.findComponentById('9qkka13nor'); /** * Camera */ -this.camera = GameLib.EntityManager.Instance.findComponentById('j36eiamn0s'); +this.camera = R3.EntityManager.Instance.findComponentById('j36eiamn0s'); /** * Geometry */ -this.instancedGeometry = GameLib.EntityManager.Instance.findComponentById('s5dfh75zza'); -this.boxGeometry = GameLib.EntityManager.Instance.findComponentById('pwzyukkviy'); +this.instancedGeometry = R3.EntityManager.Instance.findComponentById('s5dfh75zza'); +this.boxGeometry = R3.EntityManager.Instance.findComponentById('pwzyukkviy'); /** * Textures */ -this.textureWhite = GameLib.EntityManager.Instance.findComponentById('642tyh30uo'); +this.textureWhite = R3.EntityManager.Instance.findComponentById('642tyh30uo'); /** * Materials */ -this.materialRawPhong = GameLib.EntityManager.Instance.findComponentById('r153c4450d'); +this.materialRawPhong = R3.EntityManager.Instance.findComponentById('r153c4450d'); /** * Mouse and Raycasting */ -this.mouse = GameLib.EntityManager.Instance.findComponentById('znif4n23an'); -this.raycaster = GameLib.EntityManager.Instance.findComponentById('69s5vsshb9'); +this.mouse = R3.EntityManager.Instance.findComponentById('znif4n23an'); +this.raycaster = R3.EntityManager.Instance.findComponentById('69s5vsshb9'); /** * Custom Code Components */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('wlw063ovw9'); -this.keyUp = GameLib.EntityManager.Instance.findComponentById('ip0443a52d'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('n9evs68jpd'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('wlw063ovw9'); +this.keyUp = R3.EntityManager.Instance.findComponentById('ip0443a52d'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('n9evs68jpd'); /** * Program parameters @@ -76,7 +76,7 @@ this.scaleAttribute = null; /** * Generates new Attribute Data based on the image index according to 'width' and 'height' */ -GameLib.CustomCode.prototype.generateAttributeData = function(index) { +R3.CustomCode.prototype.generateAttributeData = function(index) { var width = this.images[index].width; var height = this.images[index].height; @@ -113,7 +113,7 @@ GameLib.CustomCode.prototype.generateAttributeData = function(index) { /** * Builds our instanced geometry */ -GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) { +R3.CustomCode.prototype.buildInstancedGeometry = function(index) { this.attributeData = this.generateAttributeData(index); @@ -165,7 +165,7 @@ GameLib.CustomCode.prototype.buildInstancedGeometry = function(index) { /** * Builds update information holding our current position and scale, and our target position and scale */ -GameLib.CustomCode.prototype.generateAnimationVectors = function(attributeData) { +R3.CustomCode.prototype.generateAnimationVectors = function(attributeData) { if (!attributeData) { console.warn('animation not ready'); @@ -218,7 +218,7 @@ GameLib.CustomCode.prototype.generateAnimationVectors = function(attributeData) /** * Load the next animation */ -GameLib.CustomCode.prototype.loadNext = function() { +R3.CustomCode.prototype.loadNext = function() { this.currentIndex++ @@ -240,7 +240,7 @@ GameLib.CustomCode.prototype.loadNext = function() { /** * Performs the actual update to our instanced geometry */ -GameLib.CustomCode.prototype.updateAttributeArrays = function(alpha) { +R3.CustomCode.prototype.updateAttributeArrays = function(alpha) { var i, offset, scale; @@ -292,7 +292,7 @@ this.mouseMove.entityLoaded = this; window.setInterval(this.loadNext, 10000); -GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, GameLib.Utils.GetWindowSize()); +R3.Event.Emit(R3.Event.WINDOW_RESIZE, R3.Utils.GetWindowSize()); this.meshImageGrid.updateInstance('lookAt'); diff --git a/uchezypj8k.js b/uchezypj8k.js index 267cae4..071d946 100644 --- a/uchezypj8k.js +++ b/uchezypj8k.js @@ -7,16 +7,16 @@ if (data.entity === this.parentEntity) { /** * Custom Code Components */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('rlley2ki2i'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('8nu6b5p9pb'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('rlley2ki2i'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('8nu6b5p9pb'); /** * Meshes */ -this.road = GameLib.EntityManager.Instance.findComponentById('07f38e7wvv'); -this.snail = GameLib.EntityManager.Instance.findComponentById('dbpoic48wm'); -this.cloud = GameLib.EntityManager.Instance.findComponentById('y5ckpgqf0z'); -this.solar = GameLib.EntityManager.Instance.findComponentById('yoy8llsbtn'); +this.road = R3.EntityManager.Instance.findComponentById('07f38e7wvv'); +this.snail = R3.EntityManager.Instance.findComponentById('dbpoic48wm'); +this.cloud = R3.EntityManager.Instance.findComponentById('y5ckpgqf0z'); +this.solar = R3.EntityManager.Instance.findComponentById('yoy8llsbtn'); /** * Activate our custom code components diff --git a/uf82exxae4.js b/uf82exxae4.js index fe9fa0f..e7cde97 100644 --- a/uf82exxae4.js +++ b/uf82exxae4.js @@ -5,8 +5,8 @@ var touches = Object.keys(data); * This code is rediculous - but it fixes the bug in ios where audio does not play */ -/*GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +/*R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } @@ -14,10 +14,10 @@ var touches = Object.keys(data); if (touches.length > 2) { */ - GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); + R3.Event.Emit(R3.Event.MOUSE_DOWN); /*} else { - GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, + R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/ul1ahlwhey.js b/ul1ahlwhey.js index 8609b78..ea4ddda 100644 --- a/ul1ahlwhey.js +++ b/ul1ahlwhey.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/um7f1tzijv.js b/um7f1tzijv.js index c9407ca..89e7d00 100644 --- a/um7f1tzijv.js +++ b/um7f1tzijv.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/ut6enca0nt.js b/ut6enca0nt.js index ac3e734..06b2a2d 100644 --- a/ut6enca0nt.js +++ b/ut6enca0nt.js @@ -9,74 +9,74 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('onur6a0ofn') -this.bull = GameLib.EntityManager.Instance.findComponentById('3ictrzefcv'); -this.star = GameLib.EntityManager.Instance.findComponentById('67pygl4wt9'); -this.burger = GameLib.EntityManager.Instance.findComponentById('49n2643a7g'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('vp7cm1k6bg'); -this.santa = GameLib.EntityManager.Instance.findComponentById('ovd8u9s2ax'); -this.camera = GameLib.EntityManager.Instance.findComponentById('xn8e1u5rfh'); -this.scene = GameLib.EntityManager.Instance.findComponentById('k5odzputev'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('h2n5sgtbbx'); +this.fog = R3.EntityManager.Instance.findComponentById('onur6a0ofn') +this.bull = R3.EntityManager.Instance.findComponentById('3ictrzefcv'); +this.star = R3.EntityManager.Instance.findComponentById('67pygl4wt9'); +this.burger = R3.EntityManager.Instance.findComponentById('49n2643a7g'); +this.parcel = R3.EntityManager.Instance.findComponentById('vp7cm1k6bg'); +this.santa = R3.EntityManager.Instance.findComponentById('ovd8u9s2ax'); +this.camera = R3.EntityManager.Instance.findComponentById('xn8e1u5rfh'); +this.scene = R3.EntityManager.Instance.findComponentById('k5odzputev'); +this.cursor = R3.EntityManager.Instance.findComponentById('h2n5sgtbbx'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('o6yeit4778'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('mfnm6j8akn'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('ni3fsnrww1'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('2q6a6zv190'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('zrzaw8h0zv'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('9waq8pdwdm'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('gj2o01uh6e'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('ox0yg1y3af'); +this.thrower = R3.EntityManager.Instance.findComponentById('o6yeit4778'); +this.renderer = R3.EntityManager.Instance.findComponentById('mfnm6j8akn'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('ni3fsnrww1'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('2q6a6zv190'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('zrzaw8h0zv'); +this.stone1 = R3.EntityManager.Instance.findComponentById('9waq8pdwdm'); +this.stone2 = R3.EntityManager.Instance.findComponentById('gj2o01uh6e'); +this.kanister = R3.EntityManager.Instance.findComponentById('ox0yg1y3af'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('cymx6j7pxu'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('ljxqbkv9us'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('b3ftpojh09'); +this.leftLight = R3.EntityManager.Instance.findComponentById('cymx6j7pxu'); +this.rightLight = R3.EntityManager.Instance.findComponentById('ljxqbkv9us'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('b3ftpojh09'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('pxc4fpzsjx'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('2vpm8ovxlj'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('5vqds288ln'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('1y4thfy4ho'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('6h7ztfwing'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('pxc4fpzsjx'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('2vpm8ovxlj'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('5vqds288ln'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('1y4thfy4ho'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('6h7ztfwing'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('9wilwde2i9'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('9wilwde2i9'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); /** * Tell all our custom code components that we loaded */ -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('080g209iov'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('080g209iov'); this.beforeRender.entityLoaded = this; -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('zycnjvl6f4'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('zycnjvl6f4'); this.mouseUp.entityLoaded = this; -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('xthva3e5s8'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('xthva3e5s8'); this.mouseDown.entityLoaded = this; -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('5at8009mwh'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('5at8009mwh'); this.mouseMove.entityLoaded = this; -//GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +//R3.Event.Emit(R3.Event.MOUSE_UP); -GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } diff --git a/v6a7eh2o29.js b/v6a7eh2o29.js index b6342c7..6c2ce9e 100644 --- a/v6a7eh2o29.js +++ b/v6a7eh2o29.js @@ -10,66 +10,66 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('v8r4pl37b0') -this.bull = GameLib.EntityManager.Instance.findComponentById('vff1tr1qyr'); -this.star = GameLib.EntityManager.Instance.findComponentById('bjm2i7hmvh'); -this.burger = GameLib.EntityManager.Instance.findComponentById('v69wzachaa'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('5nlg7iima8'); -this.santa = GameLib.EntityManager.Instance.findComponentById('c7g6doldd1'); -this.camera = GameLib.EntityManager.Instance.findComponentById('8qnubk16xn'); -this.scene = GameLib.EntityManager.Instance.findComponentById('0toh3aoclv'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('znib57tdrp'); -this.dom = GameLib.EntityManager.Instance.findComponentById('5wo9ve6emu'); +this.fog = R3.EntityManager.Instance.findComponentById('v8r4pl37b0') +this.bull = R3.EntityManager.Instance.findComponentById('vff1tr1qyr'); +this.star = R3.EntityManager.Instance.findComponentById('bjm2i7hmvh'); +this.burger = R3.EntityManager.Instance.findComponentById('v69wzachaa'); +this.parcel = R3.EntityManager.Instance.findComponentById('5nlg7iima8'); +this.santa = R3.EntityManager.Instance.findComponentById('c7g6doldd1'); +this.camera = R3.EntityManager.Instance.findComponentById('8qnubk16xn'); +this.scene = R3.EntityManager.Instance.findComponentById('0toh3aoclv'); +this.cursor = R3.EntityManager.Instance.findComponentById('znib57tdrp'); +this.dom = R3.EntityManager.Instance.findComponentById('5wo9ve6emu'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('hat9imrjl1'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('fn4ywfqnho'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('xcmk2jzxwa'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('wxc9hpu4vx'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('rio8uzlafp'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('zki44p55pf'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('p6tfu3w2iu'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('d2hsvzdogp'); +this.renderer = R3.EntityManager.Instance.findComponentById('hat9imrjl1'); +this.thrower = R3.EntityManager.Instance.findComponentById('fn4ywfqnho'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('xcmk2jzxwa'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('wxc9hpu4vx'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('rio8uzlafp'); +this.stone1 = R3.EntityManager.Instance.findComponentById('zki44p55pf'); +this.stone2 = R3.EntityManager.Instance.findComponentById('p6tfu3w2iu'); +this.kanister = R3.EntityManager.Instance.findComponentById('d2hsvzdogp'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('bcenhz1l43'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('6c8rddtddt'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('b6u7j4is7e'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('jy111vetuj'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('dacwh1kd3g'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('gl3q5o9502'); +this.leftLight = R3.EntityManager.Instance.findComponentById('bcenhz1l43'); +this.rightLight = R3.EntityManager.Instance.findComponentById('6c8rddtddt'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('b6u7j4is7e'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('jy111vetuj'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('dacwh1kd3g'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('gl3q5o9502'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('651d2vqbfv'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('qh7dk4k74w'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('3fdvo3fjow'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('76lee9zgqo'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('q7n859oz6y'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('651d2vqbfv'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('qh7dk4k74w'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('3fdvo3fjow'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('76lee9zgqo'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('q7n859oz6y'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('r4rrqfe9gt'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('r4rrqfe9gt'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('zo950m57cc'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('l5n85t1c45'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('42igil3g39'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('2ab32q45bg'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('4ylf5b2dne'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('zo950m57cc'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('l5n85t1c45'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('42igil3g39'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('2ab32q45bg'); +this.touchMove = R3.EntityManager.Instance.findComponentById('4ylf5b2dne'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -84,8 +84,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -96,7 +96,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -1137,7 +1137,7 @@ mesh.updateInstance('position'); mesh.updateInstance('rotation'); mesh.updateInstance('scale'); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/vaq8lxuek1.js b/vaq8lxuek1.js index d710569..473be21 100644 --- a/vaq8lxuek1.js +++ b/vaq8lxuek1.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } /* -var texture = GameLib.EntityManager.Instance.findComponentById('gm3fvv45dl'); +var texture = R3.EntityManager.Instance.findComponentById('gm3fvv45dl'); if (!this.initialized) { texture.offset.x = 0; diff --git a/vinuf6amoi.js b/vinuf6amoi.js index c9407ca..89e7d00 100644 --- a/vinuf6amoi.js +++ b/vinuf6amoi.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/vl9ykxrhfu.js b/vl9ykxrhfu.js index a126517..520b748 100644 --- a/vl9ykxrhfu.js +++ b/vl9ykxrhfu.js @@ -1,7 +1,7 @@ var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, diff --git a/vwedxjt37t.js b/vwedxjt37t.js index fde585c..8c1444e 100644 --- a/vwedxjt37t.js +++ b/vwedxjt37t.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchCancel.js \ No newline at end of file diff --git a/wgo3mtlzfc.js b/wgo3mtlzfc.js index fe66f0c..9dcc8fb 100644 --- a/wgo3mtlzfc.js +++ b/wgo3mtlzfc.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/wz0b7jbagn.js b/wz0b7jbagn.js index a126517..520b748 100644 --- a/wz0b7jbagn.js +++ b/wz0b7jbagn.js @@ -1,7 +1,7 @@ var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, diff --git a/x6shtke1dz.js b/x6shtke1dz.js index f88bf8d..18f2789 100644 --- a/x6shtke1dz.js +++ b/x6shtke1dz.js @@ -1,31 +1,31 @@ if (this.parentEntity === data.entity) { console.log('Entity SpoonLib Loaded'); - this.animationSystem = GameLib.EntityManager.Instance.queryComponents(GameLib.Component.SYSTEM_ANIMATION)[0]; + this.animationSystem = R3.EntityManager.Instance.queryComponents(R3.Component.SYSTEM_ANIMATION)[0]; - this.beforeRender = GameLib.EntityManager.Instance.findComponentById('98ckiy76lb'); + this.beforeRender = R3.EntityManager.Instance.findComponentById('98ckiy76lb'); - this.touchStart = GameLib.EntityManager.Instance.findComponentById('3hydxnm019'); - this.touchMove = GameLib.EntityManager.Instance.findComponentById('tlfd3vbn9k'); - this.touchEnd = GameLib.EntityManager.Instance.findComponentById('ild66f6e9m'); + this.touchStart = R3.EntityManager.Instance.findComponentById('3hydxnm019'); + this.touchMove = R3.EntityManager.Instance.findComponentById('tlfd3vbn9k'); + this.touchEnd = R3.EntityManager.Instance.findComponentById('ild66f6e9m'); - this.mouseUp = GameLib.EntityManager.Instance.findComponentById('l5hb4jx1ke'); - this.mouseDown = GameLib.EntityManager.Instance.findComponentById('xcuv7akc4v'); - this.mouseWheel = GameLib.EntityManager.Instance.findComponentById('schmhl1bp5'); - this.mouseMove = GameLib.EntityManager.Instance.findComponentById('n2spe826mj'); + this.mouseUp = R3.EntityManager.Instance.findComponentById('l5hb4jx1ke'); + this.mouseDown = R3.EntityManager.Instance.findComponentById('xcuv7akc4v'); + this.mouseWheel = R3.EntityManager.Instance.findComponentById('schmhl1bp5'); + this.mouseMove = R3.EntityManager.Instance.findComponentById('n2spe826mj'); - this.cylinder = GameLib.EntityManager.Instance.findComponentById('2jpfk3eve6'); + this.cylinder = R3.EntityManager.Instance.findComponentById('2jpfk3eve6'); - this.camera = GameLib.EntityManager.Instance.findComponentById('fa2c27w63p'); - this.textCanvas = GameLib.EntityManager.Instance.findComponentById('tba7fmj5ve'); - this.textTexture = GameLib.EntityManager.Instance.findComponentById('b1ygasug5p'); - this.particleEngine = GameLib.EntityManager.Instance.findComponentById('5qvnngmqv6'); - this.particle = GameLib.EntityManager.Instance.findComponentById('p1d8f1q774'); + this.camera = R3.EntityManager.Instance.findComponentById('fa2c27w63p'); + this.textCanvas = R3.EntityManager.Instance.findComponentById('tba7fmj5ve'); + this.textTexture = R3.EntityManager.Instance.findComponentById('b1ygasug5p'); + this.particleEngine = R3.EntityManager.Instance.findComponentById('5qvnngmqv6'); + this.particle = R3.EntityManager.Instance.findComponentById('p1d8f1q774'); - this.camera2d = GameLib.EntityManager.Instance.findComponentById('w69e7e2mmy'); + this.camera2d = R3.EntityManager.Instance.findComponentById('w69e7e2mmy'); - this.audioDrone = GameLib.EntityManager.Instance.findComponentById('mau1fe4qw2'); + this.audioDrone = R3.EntityManager.Instance.findComponentById('mau1fe4qw2'); this.beforeRender.entityLoaded = this; @@ -38,8 +38,8 @@ if (this.parentEntity === data.entity) { this.mouseWheel.entityLoaded = this; this.mouseMove.entityLoaded = this; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Drone' } diff --git a/xjaoh824ff.js b/xjaoh824ff.js index 8609b78..ea4ddda 100644 --- a/xjaoh824ff.js +++ b/xjaoh824ff.js @@ -1,4 +1,4 @@ -if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) { +if (R3.Utils.UndefinedOrNull(this.entityLoaded)) { return; } diff --git a/xthva3e5s8.js b/xthva3e5s8.js index 832050c..ac81872 100644 --- a/xthva3e5s8.js +++ b/xthva3e5s8.js @@ -21,18 +21,18 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); -this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, +this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); if (this.subscription) { this.subscription.remove(); this.subscription = null; diff --git a/xtihcyhagp.js b/xtihcyhagp.js index dfa9dbe..1214f70 100644 --- a/xtihcyhagp.js +++ b/xtihcyhagp.js @@ -9,67 +9,67 @@ this.enemies = []; /** * Min and max spawn time is in seconds */ -GameLib.D3.CustomCode.MIN_SPAWN_TIME = 1; -GameLib.D3.CustomCode.MAX_SPAWN_TIME = 4; +R3.D3.CustomCode.MIN_SPAWN_TIME = 1; +R3.D3.CustomCode.MAX_SPAWN_TIME = 4; /** * Create references to all our 'in game' objects */ -this.fog = GameLib.EntityManager.Instance.findComponentById('2wgl4d7uch') -this.bull = GameLib.EntityManager.Instance.findComponentById('aqu0o39q3g'); -this.star = GameLib.EntityManager.Instance.findComponentById('ucaqp8rzty'); -this.burger = GameLib.EntityManager.Instance.findComponentById('r8ztuba1ni'); -this.parcel = GameLib.EntityManager.Instance.findComponentById('ai3o44wd0a'); -this.santa = GameLib.EntityManager.Instance.findComponentById('kcp1y8q5p7'); -this.camera = GameLib.EntityManager.Instance.findComponentById('48qet53m86'); -this.scene = GameLib.EntityManager.Instance.findComponentById('3nolkbbc7j'); -this.cursor = GameLib.EntityManager.Instance.findComponentById('gkkoz2irxe'); -this.dom = GameLib.EntityManager.Instance.findComponentById('bagyiej8o9'); +this.fog = R3.EntityManager.Instance.findComponentById('2wgl4d7uch') +this.bull = R3.EntityManager.Instance.findComponentById('aqu0o39q3g'); +this.star = R3.EntityManager.Instance.findComponentById('ucaqp8rzty'); +this.burger = R3.EntityManager.Instance.findComponentById('r8ztuba1ni'); +this.parcel = R3.EntityManager.Instance.findComponentById('ai3o44wd0a'); +this.santa = R3.EntityManager.Instance.findComponentById('kcp1y8q5p7'); +this.camera = R3.EntityManager.Instance.findComponentById('48qet53m86'); +this.scene = R3.EntityManager.Instance.findComponentById('3nolkbbc7j'); +this.cursor = R3.EntityManager.Instance.findComponentById('gkkoz2irxe'); +this.dom = R3.EntityManager.Instance.findComponentById('bagyiej8o9'); -this.renderer = GameLib.EntityManager.Instance.findComponentById('4mkwbx1vku'); -this.thrower = GameLib.EntityManager.Instance.findComponentById('w176oinkdw'); -//this.renderer = GameLib.EntityManager.Instance.findComponentById('e4xb4aw01w'); -this.treeSmall = GameLib.EntityManager.Instance.findComponentById('7tovvhn9qf'); -this.treeMedium = GameLib.EntityManager.Instance.findComponentById('doum0joyd1'); -this.treeLarge = GameLib.EntityManager.Instance.findComponentById('uhl0lar6qn'); -this.stone1 = GameLib.EntityManager.Instance.findComponentById('jnlpuzn81z'); -this.stone2 = GameLib.EntityManager.Instance.findComponentById('i6ysiguhsh'); -this.kanister = GameLib.EntityManager.Instance.findComponentById('81wsdpbgut'); +this.renderer = R3.EntityManager.Instance.findComponentById('4mkwbx1vku'); +this.thrower = R3.EntityManager.Instance.findComponentById('w176oinkdw'); +//this.renderer = R3.EntityManager.Instance.findComponentById('e4xb4aw01w'); +this.treeSmall = R3.EntityManager.Instance.findComponentById('7tovvhn9qf'); +this.treeMedium = R3.EntityManager.Instance.findComponentById('doum0joyd1'); +this.treeLarge = R3.EntityManager.Instance.findComponentById('uhl0lar6qn'); +this.stone1 = R3.EntityManager.Instance.findComponentById('jnlpuzn81z'); +this.stone2 = R3.EntityManager.Instance.findComponentById('i6ysiguhsh'); +this.kanister = R3.EntityManager.Instance.findComponentById('81wsdpbgut'); -this.leftLight = GameLib.EntityManager.Instance.findComponentById('wn2mdb2orv'); -this.rightLight = GameLib.EntityManager.Instance.findComponentById('2vhyv0dz59'); -this.throwerLight = GameLib.EntityManager.Instance.findComponentById('u50c6rjo5o'); -this.scoreCanvas = GameLib.EntityManager.Instance.findComponentById('2yex7s9vhe'); -this.scoreTexture = GameLib.EntityManager.Instance.findComponentById('yfu1ilad2y'); -this.scoreMesh = GameLib.EntityManager.Instance.findComponentById('l050l1fbi9'); +this.leftLight = R3.EntityManager.Instance.findComponentById('wn2mdb2orv'); +this.rightLight = R3.EntityManager.Instance.findComponentById('2vhyv0dz59'); +this.throwerLight = R3.EntityManager.Instance.findComponentById('u50c6rjo5o'); +this.scoreCanvas = R3.EntityManager.Instance.findComponentById('2yex7s9vhe'); +this.scoreTexture = R3.EntityManager.Instance.findComponentById('yfu1ilad2y'); +this.scoreMesh = R3.EntityManager.Instance.findComponentById('l050l1fbi9'); -this.throwerParticleEngine = GameLib.EntityManager.Instance.findComponentById('0og8p6ts36'); -this.smokeParticleEngine = GameLib.EntityManager.Instance.findComponentById('3kyiu5cokv'); -this.fireParticleEngine = GameLib.EntityManager.Instance.findComponentById('z4pucpscf3'); -this.explodeParticleEngine = GameLib.EntityManager.Instance.findComponentById('uatorrbo9e'); -this.materialTreesAndRocks = GameLib.EntityManager.Instance.findComponentById('8anoe7g9or'); +this.throwerParticleEngine = R3.EntityManager.Instance.findComponentById('0og8p6ts36'); +this.smokeParticleEngine = R3.EntityManager.Instance.findComponentById('3kyiu5cokv'); +this.fireParticleEngine = R3.EntityManager.Instance.findComponentById('z4pucpscf3'); +this.explodeParticleEngine = R3.EntityManager.Instance.findComponentById('uatorrbo9e'); +this.materialTreesAndRocks = R3.EntityManager.Instance.findComponentById('8anoe7g9or'); -this.burningTreeParticleEngine = GameLib.EntityManager.Instance.findComponentById('oapz1hoxki'); +this.burningTreeParticleEngine = R3.EntityManager.Instance.findComponentById('oapz1hoxki'); -GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, +R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics }.bind(this) ); -this.mouse = new GameLib.Mouse(this.graphics); -this.raycaster = new GameLib.D3.Raycaster(this.graphics); +this.mouse = new R3.Mouse(this.graphics); +this.raycaster = new R3.D3.Raycaster(this.graphics); -this.beforeRender = GameLib.EntityManager.Instance.findComponentById('6rskhzgjog'); -this.mouseUp = GameLib.EntityManager.Instance.findComponentById('vinuf6amoi'); -this.mouseDown = GameLib.EntityManager.Instance.findComponentById('o3xmefbbln'); -this.mouseMove = GameLib.EntityManager.Instance.findComponentById('kbn8blxfe5'); -this.touchMove = GameLib.EntityManager.Instance.findComponentById('cnn8o15h2g'); +this.beforeRender = R3.EntityManager.Instance.findComponentById('6rskhzgjog'); +this.mouseUp = R3.EntityManager.Instance.findComponentById('vinuf6amoi'); +this.mouseDown = R3.EntityManager.Instance.findComponentById('o3xmefbbln'); +this.mouseMove = R3.EntityManager.Instance.findComponentById('kbn8blxfe5'); +this.touchMove = R3.EntityManager.Instance.findComponentById('cnn8o15h2g'); -GameLib.Event.Subscribe( - GameLib.Event.WINDOW_RESIZE, +R3.Event.Subscribe( + R3.Event.WINDOW_RESIZE, function(data) { var aspect = (data.width / data.height); this.camera.aspect = aspect; @@ -84,8 +84,8 @@ GameLib.Event.Subscribe( /** * Tell all our custom code components that we loaded */ -GameLib.Event.Subscribe( - GameLib.Event.CUSTOM_GAME_START, +R3.Event.Subscribe( + R3.Event.CUSTOM_GAME_START, function() { delete this.beforeRender.initialized; @@ -96,7 +96,7 @@ GameLib.Event.Subscribe( this.mouseMove.entityLoaded = this; this.touchMove.entityLoaded = this; - GameLib.Event.Emit(GameLib.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); + R3.Event.Emit(R3.Event.WINDOW_RESIZE, {width : window.innerWidth, height:window.innerHeight}); this.camera.lookAt.x = 0; this.camera.lookAt.y = 0; @@ -1074,6 +1074,6 @@ mesh.updateInstance('position'); mesh.updateInstance('rotation'); mesh.updateInstance('scale'); -GameLib.Event.Emit(GameLib.Event.GAME_LOADED); +R3.Event.Emit(R3.Event.GAME_LOADED); //@ sourceURL=entityLoaded.js diff --git a/y1gyht3k6t.js b/y1gyht3k6t.js index 832050c..ac81872 100644 --- a/y1gyht3k6t.js +++ b/y1gyht3k6t.js @@ -21,18 +21,18 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } ); -this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, +this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); if (this.subscription) { this.subscription.remove(); this.subscription = null; diff --git a/y6lzcabyhi.js b/y6lzcabyhi.js index fe66f0c..9dcc8fb 100644 --- a/y6lzcabyhi.js +++ b/y6lzcabyhi.js @@ -1,2 +1,2 @@ -GameLib.Event.Emit(GameLib.Event.MOUSE_UP); +R3.Event.Emit(R3.Event.MOUSE_UP); //@ sourceURL=TouchEnd.js \ No newline at end of file diff --git a/yauacnrf0v.js b/yauacnrf0v.js index b4e3314..72686d4 100644 --- a/yauacnrf0v.js +++ b/yauacnrf0v.js @@ -2,7 +2,7 @@ if (!this.entityLoaded) { return; } -if (GameLib.Utils.UndefinedOrNull(this.initialized)) { +if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; @@ -24,8 +24,8 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.enemies = []; - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -33,7 +33,7 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { ); this.getNextSpawnTime = function() { - return GameLib.Utils.GetRandomIntInclusive( + return R3.Utils.GetRandomIntInclusive( 1, 1 ); @@ -43,12 +43,12 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { this.spawnEnemy = function() { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 4); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 4); - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); - var apiBox = new GameLib.D3.API.Mesh(); + var apiBox = new R3.D3.API.Mesh(); apiBox.materials = [this.boxMaterial]; @@ -75,15 +75,15 @@ if (GameLib.Utils.UndefinedOrNull(this.initialized)) { var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -166,8 +166,8 @@ this.enemies = this.enemies.reduce( enemy.lifeTime += data.delta; if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } diff --git a/ybqnmrkghr.js b/ybqnmrkghr.js index 8849658..7f615db 100644 --- a/ybqnmrkghr.js +++ b/ybqnmrkghr.js @@ -2,8 +2,8 @@ data.event.preventDefault(); var touch = data[Object.keys(data)[0]]; -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : touch.pageX, @@ -13,6 +13,6 @@ GameLib.Event.Emit( } ) -GameLib.Event.Emit(GameLib.Event.MOUSE_DOWN); +R3.Event.Emit(R3.Event.MOUSE_DOWN); //@ sourceURL=touchStart.js \ No newline at end of file diff --git a/yfdl3odo4j.js b/yfdl3odo4j.js index b039426..07b6904 100644 --- a/yfdl3odo4j.js +++ b/yfdl3odo4j.js @@ -5,7 +5,7 @@ if (!this.entityLoaded) { /** * First we find our crosshair */ -var crosshair = GameLib.EntityManager.Instance.findComponentById('oxpg88pgzv'); +var crosshair = R3.EntityManager.Instance.findComponentById('oxpg88pgzv'); /** * Target, is the x / y postion of the crosshair on the z=0 plane in the crosshair scene @@ -20,11 +20,11 @@ particle.position.applyMatrix4( mInverse ); -var particleEngine = GameLib.EntityManager.Instance.findComponentById('w4gg7woov2'); -var particle = GameLib.EntityManager.Instance.findComponentById('tiqzsk65l0'); +var particleEngine = R3.EntityManager.Instance.findComponentById('w4gg7woov2'); +var particle = R3.EntityManager.Instance.findComponentById('tiqzsk65l0'); -var flamethrower = GameLib.EntityManager.Instance.findComponentById('01viz3rw6l'); -var worldCamera = GameLib.EntityManager.Instance.findComponentById('knwkksjc7n'); +var flamethrower = R3.EntityManager.Instance.findComponentById('01viz3rw6l'); +var worldCamera = R3.EntityManager.Instance.findComponentById('knwkksjc7n'); var end = ; diff --git a/ym4wkwzzd1.js b/ym4wkwzzd1.js index c9407ca..89e7d00 100644 --- a/ym4wkwzzd1.js +++ b/ym4wkwzzd1.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/ypiqj5r40j.js b/ypiqj5r40j.js index a72560d..778a90a 100644 --- a/ypiqj5r40j.js +++ b/ypiqj5r40j.js @@ -55,8 +55,8 @@ if (this.y > window.innerHeight) { this.y = window.innerHeight; } -GameLib.Event.Emit( - GameLib.Event.MOUSE_MOVE, +R3.Event.Emit( + R3.Event.MOUSE_MOVE, { event : { offsetX : this.x, diff --git a/zjg1mprub2.js b/zjg1mprub2.js index 6440feb..8d6251c 100644 --- a/zjg1mprub2.js +++ b/zjg1mprub2.js @@ -15,12 +15,12 @@ if (!this.initialized) { this.subscription = null; } - this.subscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.subscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name === 'Audio - Flamethrower') { if (!data.audio.paused) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); } } }.bind(this) @@ -38,8 +38,8 @@ this.throwerParticleEngine.updateInstance('particlesPerSecond'); this.throwerParticleEngine.templateParticle.speed = 300; this.throwerParticleEngine.templateParticle.scale.x = 15; -GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, +R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Flamethrower' } diff --git a/zo950m57cc.js b/zo950m57cc.js index 12e053a..9cb0fe8 100644 --- a/zo950m57cc.js +++ b/zo950m57cc.js @@ -3,14 +3,14 @@ return; } - if (GameLib.Utils.UndefinedOrNull(this.initialized)) { + if (R3.Utils.UndefinedOrNull(this.initialized)) { this.initialized = true; - GameLib.Event.Emit(GameLib.Event.STOP_ALL_AUDIO); + R3.Event.Emit(R3.Event.STOP_ALL_AUDIO); - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Xmas' } @@ -20,14 +20,14 @@ this.blastSubscription.remove(); } - this.blastSubscription = GameLib.Event.Subscribe( - GameLib.Event.AUDIO_ENDED, + this.blastSubscription = R3.Event.Subscribe( + R3.Event.AUDIO_ENDED, function(data) { if (data.audio.name.indexOf('Blast') !== -1) { - var play = GameLib.Utils.GetRandomIntInclusive(1,5); + var play = R3.Utils.GetRandomIntInclusive(1,5); if (play === 1) { - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Ho ho ho' } @@ -66,7 +66,7 @@ this.toRed = new THREE.Color(data.delta, 0, 0); this.treesBurning = 0; - this.treesBurningToStart = GameLib.Utils.GetRandomIntInclusive(1, 3); + this.treesBurningToStart = R3.Utils.GetRandomIntInclusive(1, 3); this.running = false; @@ -124,8 +124,8 @@ console.log('next kanister spawn score: ' + this.kanisterSpawnScore); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'nextKanisterSpawnScoreUpdate', kanisterSpawnScore : this.kanisterSpawnScore @@ -174,8 +174,8 @@ this.rightLight.intensity = 0.3; this.rightLight.updateInstance('intensity'); - GameLib.Event.Emit( - GameLib.Event.GET_GRAPHICS_IMPLEMENTATION, + R3.Event.Emit( + R3.Event.GET_GRAPHICS_IMPLEMENTATION, null, function(graphics) { this.graphics = graphics @@ -206,8 +206,8 @@ console.log('level : ' + this.level +', spawn interval : ' + this.enemySpawnInterval); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { level : this.level, enemySpawnInterval : this.enemySpawnInterval, @@ -238,8 +238,8 @@ this.spawnEnemy = function(kanister) { - var enemyType = GameLib.Utils.GetRandomIntInclusive(1, 5); - var meshType = GameLib.Utils.GetRandomIntInclusive(1, 5); + var enemyType = R3.Utils.GetRandomIntInclusive(1, 5); + var meshType = R3.Utils.GetRandomIntInclusive(1, 5); if (kanister) { meshType = 6; @@ -256,7 +256,7 @@ this.setLevelProperties(); } - var y = GameLib.Utils.GetRandomIntInclusive(2, 10); + var y = R3.Utils.GetRandomIntInclusive(2, 10); var speed = 1; @@ -287,15 +287,15 @@ var velocity = null; - var axis = new GameLib.API.Vector3( - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1, - GameLib.Utils.GetRandomIntInclusive(1,10) * 0.1 + var axis = new R3.API.Vector3( + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1, + R3.Utils.GetRandomIntInclusive(1,10) * 0.1 ); axis = axis.normalize(); - var angle = GameLib.Utils.GetRandomIntInclusive(1,100) * 0.001; + var angle = R3.Utils.GetRandomIntInclusive(1,100) * 0.001; var position = {x : 0, y: y, z :0}; @@ -377,8 +377,8 @@ enemy.isKanister = true; } else { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemiesSpawned: this.enemiesSpawned, enemy: enemy, @@ -396,8 +396,8 @@ this.setNextKanisterSpawnScore(); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -414,7 +414,7 @@ mesh.updateInstance('visible'); - var sound = GameLib.Utils.GetRandomIntInclusive(1,3); + var sound = R3.Utils.GetRandomIntInclusive(1,3); var name = 'Audio - Blast 1'; @@ -426,8 +426,8 @@ name = 'Audio - Blast 3'; } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : name } @@ -496,8 +496,8 @@ console.log('score : ' + this.score); - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'scoreUpdate', score : this.score @@ -508,8 +508,8 @@ this.spawnKanister(); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyExploded' @@ -532,8 +532,8 @@ console.log('burning enemy ' + mesh.name); enemy.burning = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { enemy : enemy, event : 'enemyBurned' @@ -552,8 +552,8 @@ mesh.fireParticleEngine.updateInstance('position'); mesh.fireParticleEngine.enabled = true; - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -586,15 +586,15 @@ * We only remove the things we cloned */ /* - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh.materials[0] } ); - GameLib.Event.Emit( - GameLib.Event.REMOVE_COMPONENT, + R3.Event.Emit( + R3.Event.REMOVE_COMPONENT, { component : enemy.mesh } @@ -637,8 +637,8 @@ !this.running ) { this.running = true; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'gameRunning', message : 'we have enough trees burning now to start - the enemy will spawn now' @@ -646,8 +646,8 @@ ); } - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'treeBurned', treesBurning : this.treesBurning, @@ -683,8 +683,8 @@ } - GameLib.Event.Emit( - GameLib.Event.PLAY_AUDIO, + R3.Event.Emit( + R3.Event.PLAY_AUDIO, { name : 'Audio - Burning' } @@ -699,8 +699,8 @@ } }; - GameLib.Event.Emit( - GameLib.Event.GAME_STARTED, + R3.Event.Emit( + R3.Event.GAME_STARTED, { game : this } @@ -764,7 +764,7 @@ } if (this.fuelFinished) { - GameLib.Event.Emit(GameLib.Event.MOUSE_UP); + R3.Event.Emit(R3.Event.MOUSE_UP); return; } @@ -815,7 +815,7 @@ /** * This happens to trees */ - if (GameLib.Utils.UndefinedOrNull(mesh.life)) { + if (R3.Utils.UndefinedOrNull(mesh.life)) { mesh.life = 1.2; } @@ -847,8 +847,8 @@ var used = this.kanisterTime / this.kanisterLife; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'fuelUsed', used : used, @@ -862,8 +862,8 @@ this.kanisterTime = 0; this.kanisters -= 1; - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'kanisterCountUpdate', kanisters : this.kanisters @@ -871,8 +871,8 @@ ); if (this.kanisters < 0) { - GameLib.Event.Emit( - GameLib.Event.GAME_OVER, + R3.Event.Emit( + R3.Event.GAME_OVER, { game : this } @@ -894,7 +894,7 @@ * We need to wait one render cycle for the smoke explode particle engine * and then kill the enemy */ - if (GameLib.Utils.UndefinedOrNull(enemy.waiting)) { + if (R3.Utils.UndefinedOrNull(enemy.waiting)) { enemy.waiting = true; result.push(enemy); } else { @@ -914,8 +914,8 @@ if (enemy.lifeTime > enemy.life) { - GameLib.Event.Emit( - GameLib.Event.GAME_DATA, + R3.Event.Emit( + R3.Event.GAME_DATA, { event : 'enemyLifetimeReached', enemy : enemy diff --git a/zycnjvl6f4.js b/zycnjvl6f4.js index c9407ca..89e7d00 100644 --- a/zycnjvl6f4.js +++ b/zycnjvl6f4.js @@ -20,8 +20,8 @@ this.throwerParticleEngine.templateParticle.positionOffset.x = 0.3; this.throwerParticleEngine.templateParticle.positionOffset.y = 0.3; this.throwerParticleEngine.templateParticle.scale.x = 3; -GameLib.Event.Emit( - GameLib.Event.STOP_AUDIO, +R3.Event.Emit( + R3.Event.STOP_AUDIO, { name : 'Audio - Flamethrower' }