Skip to content

Commit

Permalink
0.7.13: arreglado lo de disparar
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlacorrona committed Nov 26, 2019
1 parent d25c995 commit 332b348
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Globales.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var version ="v0.7.12.2";
var version ="v0.7.13";

var pulsaciones = []; // actuales registradas

Expand Down
17 changes: 12 additions & 5 deletions src/layers/GameLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ class GameLayer extends Layer {

this.puntuacionFinal = undefined;

this.disparado = false;

this.iniciar();
}

Expand Down Expand Up @@ -317,12 +319,17 @@ class GameLayer extends Layer {

// disparar
if ( controles.disparo ){
let nuevoDisparo = this.jugador.disparar();
if ( nuevoDisparo != null ) {
this.espacio.agregarCuerpoDinamico(nuevoDisparo);
this.disparosJugador.push(nuevoDisparo);
this.controladorAudio.playDisparar();
if(!this.disparado) {
let nuevoDisparo = this.jugador.disparar();
if (nuevoDisparo != null) {
this.espacio.agregarCuerpoDinamico(nuevoDisparo);
this.disparosJugador.push(nuevoDisparo);
this.controladorAudio.playDisparar();
}
this.disparado = true;
}
} else {
this.disparado = false;
}

// Eje X
Expand Down

0 comments on commit 332b348

Please sign in to comment.