Skip to content

Commit

Permalink
0.6: controles moviles colocados donde deben
Browse files Browse the repository at this point in the history
  • Loading branch information
martinlacorrona committed Nov 24, 2019
1 parent a133396 commit 3c105d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/layers/GameLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class GameLayer extends Layer {
}

iniciar() {
this.botonDisparo = new Boton(imagenes.boton_disparo,480*0.75,320*0.83);
this.pad = new Pad(480*0.14,320*0.8);
this.botonDisparo = new Boton(imagenes.boton_disparo,480*0.87,320*0.55, 0.5, 0.5);
this.pad = new Pad(480*0.75,320*0.8);
this.fondo = new Fondo(imagenes.fondo, 480*0.5,320*0.5)

this.espacio = new Espacio(0);
Expand Down
6 changes: 5 additions & 1 deletion src/modelos/Boton.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
class Boton extends Modelo {

constructor(rutaImagen, x, y) {
constructor(rutaImagen, x, y, anchoRedimension, altoRedimension) {
super(rutaImagen, x, y)
this.pulsado = false;
if(anchoRedimension != undefined && altoRedimension != undefined) {
this.ancho = this.imagen.width * anchoRedimension;
this.alto = this.imagen.height * altoRedimension;
}
}

contienePunto(pX, pY){
Expand Down
2 changes: 1 addition & 1 deletion src/modelos/Pad.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Pad extends Boton {

constructor(x, y) {
super(imagenes.pad, x, y)
super(imagenes.pad, x, y);
}

obtenerOrientacionX(pX){
Expand Down

0 comments on commit 3c105d8

Please sign in to comment.