CustomCode to R3
parent
52f47a1a13
commit
731cad12a0
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.js
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
110
0r2manr3lz.js
110
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
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchCancel.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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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
|
718
21g30t1e75.js
718
21g30t1e75.js
File diff suppressed because it is too large
Load Diff
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
298
2xswm1bwq8.js
298
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)
|
||||
)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
if (R3.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.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,
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchCancel.js
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.js
|
130
6rskhzgjog.js
130
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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchEnd.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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
298
8ia8dlk7l5.js
298
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)
|
||||
)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchCancel.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
|
||||
|
|
130
a2ow5l92js.js
130
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
|
||||
|
|
294
a2xc0lrac8.js
294
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)
|
||||
)
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchCancel.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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
if (R3.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
130
autqzs1rvq.js
130
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
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
116
bwrgfra6bd.js
116
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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
if (R3.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
if (R3.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var texture = GameLib.EntityManager.Instance.findComponentById('gm3fvv45dl');
|
||||
var texture = R3.EntityManager.Instance.findComponentById('gm3fvv45dl');
|
||||
|
||||
if (!texture) {
|
||||
return;
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 = ;
|
||||
|
||||
|
|
110
enb2zrptsu.js
110
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
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchCancel.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,
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
112
f8hfy0lj97.js
112
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
if (GameLib.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
if (R3.Utils.UndefinedOrNull(this.entityLoaded)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
GameLib.Event.Emit(GameLib.Event.MOUSE_UP);
|
||||
R3.Event.Emit(R3.Event.MOUSE_UP);
|
||||
//@ sourceURL=TouchCancel.js
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue