Skip to content

Commit

Permalink
arreglo collide
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoVinaccia committed Oct 10, 2024
1 parent 9029b89 commit bc43c9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions juegoAjedrez2.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ object juegoAjedrez2{
keyboard.w().onPressDo({reyNegro.moverArriba()})
keyboard.s().onPressDo({reyNegro.moverAbajo()})
keyboard.space().onPressDo({reyNegro.disparar()})

// game.onCollideDo(balaNueva, {peonNuevo=>peonNuevo.recibirDanio()})

}
}

Expand Down Expand Up @@ -44,6 +41,7 @@ object reyNegro {
const balaNueva = new Bala()
game.addVisual(balaNueva)
balaNueva.empezarMoverse()
game.onCollideDo(balaNueva, {peonNuevo=>peonNuevo.recibirDanio()})
}

method recibirDanio() {
Expand Down Expand Up @@ -308,6 +306,8 @@ object spawnEnemigo {
numeroPieza = numeroPieza.round()
}


// para usar menos ifs podriamos hacer que cada tropa spawnee cada cierto tick
method aparecerPieza() {
self.numeroRandom()
if(numeroPieza == 1) {
Expand Down

0 comments on commit bc43c9b

Please sign in to comment.