Skip to content

Commit

Permalink
CODIGO PANZA
Browse files Browse the repository at this point in the history
  • Loading branch information
FrancoVinaccia committed Nov 13, 2024
1 parent 6ff42d3 commit 2927a36
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 24 deletions.
Binary file modified assets/alfil.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/alfilGolpeado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/bala.png
Binary file not shown.
Binary file added assets/balaEscopeta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/balaNormal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/caballo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/caballoGolpeado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/caballodañado.png
Binary file not shown.
Binary file modified assets/peon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/peonGolpeado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reina.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/reinaGolpeada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/reyNegro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/reyNegroEscopeta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/torre.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/torreGolpeada.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 22 additions & 17 deletions src/piezasBlancas.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ class PiezaBlanca {
}
}

method consecuenciaDisparo() {
position = position.right(1)
}

method consecuenciaDisparo()

// FUNCIONES PARA TESTS
method vida() = vida
Expand All @@ -59,7 +56,14 @@ class PiezaBlanca {
}

class Peon inherits PiezaBlanca(vida = 100, puntajeDado = 50, danioAEfectuar = 25) {
method image() = "peon.png"
var imagenActual = "peon.png"
method image() = imagenActual

override method consecuenciaDisparo() {
position = position.right(1)
imagenActual = "peonGolpeado.png"
game.schedule(1000, { imagenActual = "peon.png" })
}
}

class Caballo inherits PiezaBlanca(vida = 75, puntajeDado = 75, danioAEfectuar = 15) {
Expand All @@ -77,22 +81,22 @@ class Caballo inherits PiezaBlanca(vida = 75, puntajeDado = 75, danioAEfectuar =
}

override method consecuenciaDisparo() {
imagenActual = "caballodañado.png"
game.schedule(1000, { imagenActual = "caballo.png" })
imagenActual = "caballoGolpeado.png"
}


}

class Torre inherits PiezaBlanca(vida = 200, puntajeDado = 100, danioAEfectuar = 50, moverse = new Tick(interval = 3500, action = {self.moverse()})) {
method image() = "torre.png"
override method consecuenciaDisparo(){}
var imagenActual = "torre.png"
method image() = imagenActual override method consecuenciaDisparo(){
imagenActual = "torreGolpeada.png"
}
}

class Alfil inherits PiezaBlanca(vida = 100, puntajeDado = 75, danioAEfectuar = 35, moverse = new Tick(interval = 3500, action = {if(!stun) self.moverse()})) {
var movimiento = [1,2].anyOne() // 1 = Moverse siempre hacia arriba || 2 = Moverse siempre hacia abajo
var stun = false
method image() = "alfil.png"
var imagenActual = "alfil.png"
method image() = imagenActual

override method accionExtra() {
if(position.y() == 0) {
Expand All @@ -109,17 +113,18 @@ class Alfil inherits PiezaBlanca(vida = 100, puntajeDado = 75, danioAEfectuar =
}

override method consecuenciaDisparo() {
imagenActual = "alfilGolpeado.png"
game.schedule(2000, { imagenActual = "alfil.png"})
stun = true
game.schedule(1000, {stun = false})
// cambiar imagen a una con pajaritos en la cabeza
game.schedule(2000, {stun = false})
}
}

class Reina inherits Caballo(vida = 150, puntajeDado = 200, danioAEfectuar = 50, moverse = new Tick(interval = 1000, action = {self.moverse()})) {
override method image() = "reina.png"
override method image() = imagen
var imagen = "reina.png"
override method consecuenciaDisparo() {
//imagenActual = "reinadañada.png"
//game.schedule(1000, { imagenActual = "reina.png" })
imagen = "reinaGolpeada.png"
danioAEfectuar *= 1.5
}
}
4 changes: 2 additions & 2 deletions src/reyNegro.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ object reyNegro {


method vida() = vida
method image() = "reyNegro.png"
method image() = "reyNegroEscopeta.png"
method puntaje() = puntaje

method moverArriba() {
Expand Down Expand Up @@ -74,7 +74,7 @@ class Bala {
const moverse = new Tick(interval = 200, action = {if(!juegoAjedrez2.estaPausado()) self.moverse()})
var position = reyNegro.position().right(1)

method image() = "bala.png"
method image() = "balaEscopeta.png"
method position() = position

method moverse() {
Expand Down
12 changes: 7 additions & 5 deletions src/spawn.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ object spawnEnemigo {
// ALFIL = 20%
// TORRE = 20%
// REINA = 10%
const pieza = [new Peon(), new Peon(), new Peon()
, new Caballo(), new Caballo()
, new Alfil(), new Alfil()
,new Torre(), new Torre()
,new Reina()].anyOne()
// const pieza = [new Peon(), new Peon(), new Peon()
// , new Caballo(), new Caballo()
// , new Alfil(), new Alfil()
// ,new Torre(), new Torre()
// ,new Reina()].anyOne()

const pieza = [new Reina()].anyOne()
juegoAjedrez2.agregarVisual(pieza)
pieza.empezarMoverse()
}
Expand Down

0 comments on commit 2927a36

Please sign in to comment.