Skip to content

Commit

Permalink
Tercera Entrega
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanter134 committed Nov 7, 2024
1 parent 14c23cf commit 3d8ae65
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
Binary file added assets/261.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions entorno.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Cinematica inherits Visual {
}
}

const derrota = new Visual (position = game.origin(), image = "celda_gris.png")
const derrota = new Visual (position = game.origin(), image = "261.jpg")

const cartelAtaque = new Visual (position = new Position(x=17, y=20), image = "proto_cartel_ataque.png")

Expand Down Expand Up @@ -100,13 +100,16 @@ class BossFight {
}

method habilitarAtaque() {
morcilla.posicionDeAtaque()
game.addVisual(cartelAtaque)
turnoMorcilla = true
if(!morcilla.derrotado())
{
morcilla.posicionDeAtaque()
game.addVisual(cartelAtaque)
turnoMorcilla = true
}
}

method gestionarAtaque() {
if(jefeEnBatalla && turnoMorcilla){
if(jefeEnBatalla && turnoMorcilla && !morcilla.derrotado()){

turnoMorcilla = false
game.removeVisual(cartelAtaque)
Expand Down
7 changes: 4 additions & 3 deletions morcilla.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import jefe.*

object morcilla {
var property position = new PositionMejorada(x=15, y=2)
method image() = "morcilla256.png"
var property image = "morcilla256.png"

// ================================== MOVIMIENTO ==================================
var saltando = false
Expand Down Expand Up @@ -72,7 +72,7 @@ object morcilla {

// ================================== BATALLA ==================================

var property vidas = 5
var property vidas = 3
var inmunidadActiva = false
var property puedeAtacar = false
var derrotado = false
Expand Down Expand Up @@ -112,7 +112,8 @@ object morcilla {

method derrota() {
derrotado = true
game.addVisual(derrota)
image = "261.jpg"
self.desactivarMovimiento()
}

method derrotado() = derrotado
Expand Down

0 comments on commit 3d8ae65

Please sign in to comment.