Skip to content

Commit

Permalink
añadi slime explosivo
Browse files Browse the repository at this point in the history
  • Loading branch information
NahuelMarek committed Nov 17, 2024
1 parent 5af248f commit 9f1501e
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 4 deletions.
4 changes: 3 additions & 1 deletion administradorDeOleadas.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ object administradorDeOleadas {
numeroOleada = 1
oleadaActual = oleadaNormal
}
method recibeDanioMago(danio){}
}


// ===============================
// Oleada Normal: Configuración y gestión de una oleada estándar
// ===============================
object oleadaNormal {
var property enemigos = [slimeBasico]
var property enemigos = [/* slimeBasico */slimeDeMedioOriente]
var property cantidadEnemigos = 10
var property enemigosRestantes = cantidadEnemigos
var property enemigosGenerados = 0
Expand Down Expand Up @@ -133,6 +134,7 @@ object oleadaNormal {
enemigosGenerados = 0
tiempoSpawn = 3000
}

}


Expand Down
Binary file added assets/s.slimeMedioOriente.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion magos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class MagoTienda{
const mago = self.magoQueGenera(posicionMago)
return mago
}

method recibeDanioMago(danio){}
// method efectoDeInvocacion(){} //esto estaba porque antes los magos irlandeses interactuaban directamente con el contador de puntos
}

Expand Down
2 changes: 1 addition & 1 deletion pala.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object pala {
method eliminarMago(magoSeleccionado){
magoSeleccionado.eliminar()
}

method recibeDanioMago(danio){}
}
// Me da ansiedad la pala
//⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣶⣶⣶⣶⣤⣀⠀⠀⠀⠀⠀⠀
Expand Down
1 change: 1 addition & 0 deletions puntaje.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ object puntaje {
method reset() {
puntos = puntajeInicial
}
method recibeDanioMago(danio){}
}
26 changes: 25 additions & 1 deletion slime.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Slime {
const posicionEnFrente = new MutablePosition(x = slime.position().x() - 1, y = slime.position().y())
const objetoEnCeldaEnFrente = game.getObjectsIn(posicionEnFrente)

if (objetoEnCeldaEnFrente.any({ objeto => objeto.frenarEnemigo() })) {
if (objetoEnCeldaEnFrente.any({ objeto => objeto.frenarEnemigo()})) {
slime.enMovimiento(false)
objetoEnCeldaEnFrente.forEach({ objeto => objeto.recibeDanioMago(danio) })
} else {
Expand Down Expand Up @@ -192,3 +192,27 @@ object slimeDorado {
return slime.sinVida() || slime.llegoACasa()
}
}

object slimeDeMedioOriente{
const property danio = 500
const property vida= 180
method desplazamiento() = 1
const imagen="s.slimeMedioOriente.png"
method imagen() {return imagen}
method moverse()= slimeBasico.moverse()
method meFreno()={slime=>
const posicionEnFrente = new MutablePosition(x = slime.position().x(), y = slime.position().y())
const objetoEnCeldaSiguiente = game.getObjectsIn(posicionEnFrente)

if (objetoEnCeldaSiguiente.any({ objeto => objeto.frenarEnemigo() && !objeto.recibeDanioEnemigo(0)})) {
slime.enMovimiento(false)
const posicionArriba = new MutablePosition(x = slime.position().x(), y = slime.position().y()+1)
const posicionAbajo = new MutablePosition(x = slime.position().x(), y = slime.position().y()-1)
const objetosAmatar= game.getObjectsIn(posicionArriba)+game.getObjectsIn(posicionAbajo)+objetoEnCeldaSiguiente
objetosAmatar.forEach({ objeto => objeto.recibeDanioMago(danio) })
slime.eliminar()
} else {
slime.enMovimiento(true)
}}
method estaMuerto()=slimeBasico.estaMuerto()
}

0 comments on commit 9f1501e

Please sign in to comment.