Skip to content

Commit

Permalink
adding border sensors on actor
Browse files Browse the repository at this point in the history
  • Loading branch information
dlopezalvas committed Oct 2, 2024
1 parent 1f42c09 commit 5d5270b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/actores/ActorAnimado.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ class ActorAnimado extends Actor {
return !this.casillaActual().hayAbajo() && !this.casillaActual().hayDerecha();
}

enBordeArriba(): boolean {
return !this.casillaActual().hayArriba()
}

enBordeAbajo(): boolean {
return !this.casillaActual().hayAbajo()
}

enBordeIzquierdo(): boolean {
return !this.casillaActual().hayIzquierda()
}

enBordeDerecho(): boolean {
return !this.casillaActual().hayDerecha()
}

estoyUltimaFila(): boolean {
return this.cuadricula.cantFilas - 1 == this.casillaActual().nroFila;
}
Expand Down

0 comments on commit 5d5270b

Please sign in to comment.