Skip to content

Commit

Permalink
Merge pull request #37 from obj1unq/final
Browse files Browse the repository at this point in the history
con tests
  • Loading branch information
Malena-Sciutto authored Nov 22, 2023
2 parents 453a22f + e7fa807 commit 07dde55
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/enemigos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ object guardiasPerseguidores inherits ListaGuardias {}
class CaminoInvalido {

const property position
var property posicionEntrada = tunel.position()
method posicionEntrada() = tunel.position()

method image(){
return "baldoza.png"
Expand All @@ -204,7 +204,7 @@ class CaminoInvalido {
}

method arribaDeLaEntrada() {
return arriba.siguiente(posicionEntrada)
return arriba.siguiente(self.posicionEntrada())
}

method esSolidoPara(personaje) {
Expand Down
1 change: 0 additions & 1 deletion src/nivelx.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ object nivel4 inherits NivelDeJuego {

override method generar(){
super()
tunel.position(game.at(7, 2))
game.addVisual(sirius)
sirius.position(game.at(1,0))
}
Expand Down
24 changes: 13 additions & 11 deletions src/tests.wtest
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe "hechizos Harry" {
}
}

describe "nivel1" {
describe "nivel4" {

method initialize(){
nivel4.iniciar()
Expand All @@ -60,22 +60,24 @@ describe "nivel1" {

}

test "harry entra a la zona invisible. Los dos pueden moverse"{
harry.perder()
sirius.perder()
test "harry entra a la zona invisible. Sirius puede moverse"{
harry.estado(harryHumano)
sirius.estado(siriusHumano)
harry.transformarse()
assert.equals(harryInvisible, harry.estado())
harry.entrarEnZonaGuardias()
assert.that(harry.sePuedeMover(arriba))
assert.that(sirius.sePuedeMover(arriba))
}

test "harry choca contra una pared"{
harry.position(game.at(2, 1))
test "sirius choca contra una pared y no puede moverse"{
sirius.position(game.at(2,1))
harry.mover(arriba)
sirius.mover(arriba)
assert.notThat(harry.sePuedeMover(arriba))
assert.notThat(sirius.sePuedeMover(arriba))
}
}

test "sirius pisa la zona invalida y vuelve al principio del camino"{
const caminoInvalido = new CaminoInvalido(position = game.at(4, 13))
caminoInvalido.colisionarCon(sirius)
assert.equals(caminoInvalido.arribaDeLaEntrada(), sirius.position())
}
}

0 comments on commit 07dde55

Please sign in to comment.