diff --git a/src/game-lib-a-1-event.js b/src/game-lib-a-1-event.js index 2b6adc6..d89aed0 100644 --- a/src/game-lib-a-1-event.js +++ b/src/game-lib-a-1-event.js @@ -33,7 +33,7 @@ GameLib.Event.COMPONENT_CLONED = 0xf; GameLib.Event.TEXTURE_ANIMATED_CHANGE = 0x10; GameLib.Event.ANIMATE_TEXTURE_INSTANCE = 0x11; GameLib.Event.REMOVE_PARTICLE_ENGINE = 0x12; -//GameLib.Event.TEXTURE_INSTANCE_CREATED = 0x13; +GameLib.Event.PAUSE = 0x13; GameLib.Event.TEXTURE_INSTANCE_UPDATED = 0x14; //GameLib.Event.MATERIAL_INSTANCE_CREATED = 0x15; GameLib.Event.MATERIAL_INSTANCE_UPDATED = 0x16; @@ -140,7 +140,7 @@ GameLib.Event.GetEventName = function(number) { case 0x10 : return 'texture_animated_change'; case 0x11 : return 'animate_texture_instance'; case 0x12 : return 'remove_particle_engine'; - case 0x13 : return 'unused';//'texture_instance_created'; + case 0x13 : return 'pause'; case 0x14 : return 'texture_instance_updated'; case 0x15 : return 'unused';//'material_instance_created'; case 0x16 : return 'material_instance_updated'; diff --git a/src/game-lib-d3-particle.js b/src/game-lib-d3-particle.js index 54763ed..2494395 100644 --- a/src/game-lib-d3-particle.js +++ b/src/game-lib-d3-particle.js @@ -203,20 +203,32 @@ GameLib.D3.Particle.prototype.cloneInstance = function() { clone.position.add(this.positionOffset.instance); } - var add = 1; + var addX = 1; + var addY = 1; + var addZ = 1; if (this.positionOffsetType === GameLib.D3.Particle.POSITION_OFFSET_TYPE_RANDOM) { - add = GameLib.Utils.GetRandomIntInclusive(1,2); + addX = GameLib.Utils.GetRandomIntInclusive(1,2); + addY = GameLib.Utils.GetRandomIntInclusive(1,2); + addZ = GameLib.Utils.GetRandomIntInclusive(1,2); - if (add === 1) { + if (addX === 1) { clone.position.x += Math.random() * this.positionOffset.x; - clone.position.y += Math.random() * this.positionOffset.y; - clone.position.z += Math.random() * this.positionOffset.z; } else { clone.position.x -= Math.random() * this.positionOffset.x; + } + + if (addY === 1) { clone.position.y -= Math.random() * this.positionOffset.y; + } else { + clone.position.y += Math.random() * this.positionOffset.y; + } + + if (addZ === 1) { clone.position.z -= Math.random() * this.positionOffset.z; + } else { + clone.position.z += Math.random() * this.positionOffset.z; } } diff --git a/src/game-lib-system-input.js b/src/game-lib-system-input.js index 7b0c4dd..5bbe6c6 100644 --- a/src/game-lib-system-input.js +++ b/src/game-lib-system-input.js @@ -763,6 +763,10 @@ GameLib.System.Input.prototype.onKeyDown = function(event) { ) } + + if (event.code === 'KeyP') { + GameLib.Event.Emit(GameLib.Event.PAUSE); + } }; GameLib.System.Input.prototype.onKeyUp = function(event) {