Skip to content

Commit

Permalink
UPS Fix bordes de casillas
Browse files Browse the repository at this point in the history
  • Loading branch information
asanzo committed Sep 25, 2023
1 parent 4d80aff commit 2ded53c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/actores/Casilla.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ class Casilla extends ActorAnimado {
this.nroColumna = nroC;
this.actores = [];

let opciones = cuadricula.getOpcionesCasilla();
if (opciones.bordesDecorados) {
opciones.cuadrosParado = [this.cuadroSegunPosicion()];
opciones.cuadrosCorrer = opciones.cuadrosParado;
}

super(0, 0, opciones);
super(0, 0, cuadricula.getOpcionesCasilla());

this.reubicate();
}
Expand Down Expand Up @@ -155,6 +149,11 @@ class Casilla extends ActorAnimado {
return this.actores.filter(actor => actor.tiene_etiqueta(unaEtq));
}

decorarBordes(){
this.definirAnimacion("parado", [this.cuadroSegunPosicion()], 5);
this.cargarAnimacion("parado")
}

cuadroSegunPosicion() : number {
return 8 * Number(! this.casillaDeArriba())
+ 4 * Number(! this.casillaASuIzquierda())
Expand Down
3 changes: 3 additions & 0 deletions src/actores/Cuadricula.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ class Cuadricula extends Actor {
this.forEachFilaCol((fila, col) =>
this.agregarCasilla(fila, col)
);
if (this.opcionesCasilla.bordesDecorados) {
this.forEachCasilla( casilla => casilla.decorarBordes() );
}
}

agregarCasilla(fila, col) {
Expand Down

0 comments on commit 2ded53c

Please sign in to comment.