Ver a proveniência

fixed a bug where explosions would never stop exploding

tags/v0.3.0
Big Bad Waffle há 5 anos
ascendente
cometimento
c4916b0d96
2 ficheiros alterados com 8 adições e 7 eliminações
  1. +4
    -6
      src/client/js/components/explosion.js
  2. +4
    -1
      src/client/js/components/particles.js

+ 4
- 6
src/client/js/components/explosion.js Ver ficheiro

@@ -6,10 +6,7 @@ define([
return {
type: 'explosion',

count: 10,

blueprint: null,
particles: null,

init: function (blueprint) {
this.blueprint = {
@@ -69,10 +66,11 @@ define([
},

explode: function (blueprint) {
this.particles = this.obj.addComponent('particles', this.blueprint);
let particles = this.obj.addComponent('particles', this.blueprint);

this.particles.emitter.update(0.2);
this.particles.emitter.emit = false;
particles.emitter.update(0.2);
particles.emitter.emit = false;
particles.emitter.disabled = true;
}
};
});

+ 4
- 1
src/client/js/components/particles.js Ver ficheiro

@@ -20,7 +20,10 @@ define([
},

setVisible: function (visible) {
this.emitter.emit = visible;
//Sometimes, we make emitters stop emitting for a reason
// for example, when an explosion stops
if (!this.emitter.disabled)
this.emitter.emit = visible;
},

update: function () {


Carregando…
Cancelar
Guardar