Skip to content

Commit

Permalink
Merge pull request #18 from obj1unq/camino__iluminado
Browse files Browse the repository at this point in the history
Se ilumina el camino
  • Loading branch information
Malena-Sciutto authored Nov 17, 2023
2 parents cf66344 + 035cff6 commit 3c23683
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 26 deletions.
Binary file added assets/baldozaAzul.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/pisoNormal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
67 changes: 63 additions & 4 deletions src/enemigos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ class CaminoInvalido {

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

method image(){
return "pisoNormal.png"
}

method colisionarCon(personaje) {
personaje.position(self.arribaDeLaEntrada())
caminosValidos.iluminar()
}

method arribaDeLaEntrada() {
Expand All @@ -188,23 +193,73 @@ class CaminoInvalido {
method esSolidoPara(personaje) {
return false
}


}

object caminosInvalidos {

const property caminos = #{}
//object caminosInvalidos {
//
// const property caminos = #{}
//
// method agregarCamino(camino) {
// caminos.add(camino)
// }
//
// method iluminar(){
// caminos.forEach({camino=> camino.iluminar()})
// }
//
//}

class CaminoValido{
const property position
var estado = caminoNormal

method image(){
return estado.image()
}

method iluminar(){
estado = caminoIluminado
game.schedule(3000, {estado = caminoNormal})
}

method esSolidoPara(personaje) {
return false
}

method colisionarCon(personaje){}
}

object caminosValidos{
const caminos = #{}

method iluminar(){
caminos.forEach({camino => camino.iluminar()})
}

method agregarCamino(camino) {
caminos.add(camino)
}
}

object caminoNormal{
method image(){
return "pisoNormal.png"
}
}

object caminoIluminado{
method image(){
return "baldozaAzul.png"
}
}

object tunel {

var property position = game.at(0, 0)


method image() = return "tunel.png"

method esSolidoPara(personaje) {
return not personaje.puedePasar(self)
Expand All @@ -228,6 +283,10 @@ class Pared {

}

class ParedVisible inherits Pared{
method image() = "pared.png"
}

class ZonaDeGuardias {

const property position
Expand Down
2 changes: 1 addition & 1 deletion src/juego.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ program juego {
game.width(30)
game.height(18)

nivelM.iniciar()
nivel1.iniciar()

keyboard.up().onPressDo({ harry.mover(arriba) })
keyboard.down().onPressDo({ harry.mover(abajo) })
Expand Down
55 changes: 34 additions & 21 deletions src/nivelx.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,24 @@ object nivel1 inherits Nivel {

override method celdas(){
return
[[i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, p, _, _, _, _, _, _, _, _, _, _, _, _, _, f],
[i, i, i, i, i, i, i, i, i, i, i, i, i, i, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _],
[i, i, i, i, i, i, i, i, i, _, _, _, i, i, _, p, a, a, a, a, a, ag, a, a, a, a, a, a, a, a],
[i, i, i, i, i, i, i, i, i, _, i, _, _, i, _, p, a, a, a, a, a, a, a, a, a, a, a, ag, a, a],
[i, i, i, i, i, i, i, i, i, _, _, i, _, _, _, p, a, a, a, ag, a, a, a, a, a, a, a, a, a, a],
[i, i, i, i, i, i, i, i, i, i, _, i, i, i, i, p, a, a, a, a, a, ag, a, a, a, a, a, a, a, a],
[i, i, i, i, i, i, i, i, i, i, _, _, i, i, i, p, a, a, a, a, a, a, a, ag, a, a, a, a, a, a],
[i, i, i, i, _, _, _, _, i, i, i, _, i, i, i, p, ao, a, a, a, a, a, a, a, a, a, a, a, a, a],
[i, i, _, _, _, i, i, _, _, _, i, _, i, i, i, p, a, a, ag, a, a, ag, a, a, a, a, ag, a, a, a],
[i, i, _, i, i, i, i, i, i, _, i, _, i, i, i, p, a, a, a, a, a, a, a, a, ag, a, a, a, a, a],
[i, i, _, i, i, i, i, i, i, _, _, _, i, i, i, p, a, a, a, a, a, a, a, a, a, a, a, a, a, a],
[i, i, _, i, i, i, i, i, i, i, i, i, i, i, i, p, a, a, a, a, a, a, a, a, a, a, ag, a, a, a],
[i, i, _, i, i, i, i, i, i, i, i, i, i, i, i, p, a, a, a, a, a, a, a, a, a, a, a, a, a, a],
[i, i, _, _, i, _, _, _, i, i, i, i, i, i, i, p, a, a, a, ag, a, a, a, a, ag, a, a, a, a, a],
[i, i, i, _, _, _, i, _, i, i, i, i, i, i, i, p, a, a, a, a, ag, a, a, a, a, a, a, a, a, a],
[p, p, p, p, p, p, p, tn, p, p, p, p, p, p, p, p, _, _, _, _, _, _, _, _, _, _, _, _, _, _],
[[i, i, i, i, i, i, i, i, i, i, i, i, i, i, i, m, _, _, _, _, _, _, _, _, _, _, _, _, _, f],
[i, i, i, i, i, i, i, i, i, i, i, i, i, i, c, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _],
[i, i, i, i, i, i, i, i, i, c, c, c, i, i, c, m, a, a, a, a, a, ag, a, a, a, a, a, a, a, a],
[i, i, i, i, i, i, i, i, i, c, i, c, c, i, c, m, a, a, a, a, a, a, a, a, a, a, a, ag, a, a],
[i, i, i, i, i, i, i, i, i, c, c, i, c, c, c, m, a, a, a, ag, a, a, a, a, a, a, a, a, a, a],
[i, i, i, i, i, i, i, i, i, i, c, i, i, i, i, m, a, a, a, a, a, ag, a, a, a, a, a, a, a, a],
[i, i, i, i, i, i, i, i, i, i, c, c, i, i, i, m, a, a, a, a, a, a, a, ag, a, a, a, a, a, a],
[i, i, i, i, c, c, c, c, i, i, i, c, i, i, i, m, ao, a, a, a, a, a, a, a, a, a, a, a, a, a],
[i, i, c, c, c, i, i, c, c, c, i, c, i, i, i, m, a, a, ag, a, a, ag, a, a, a, a, ag, a, a, a],
[i, i, c, i, i, i, i, i, i, c, i, c, i, i, i, m, a, a, a, a, a, a, a, a, ag, a, a, a, a, a],
[i, i, c, i, i, i, i, i, i, c, c, c, i, i, i, m, a, a, a, a, a, a, a, a, a, a, a, a, a, a],
[i, i, c, i, i, i, i, i, i, i, i, i, i, i, i, m, a, a, a, a, a, a, a, a, a, a, ag, a, a, a],
[i, i, c, i, i, i, i, i, i, i, i, i, i, i, i, m, a, a, a, a, a, a, a, a, a, a, a, a, a, a],
[i, i, c, c, i, c, c, c, i, i, i, i, i, i, i, m, a, a, a, ag, a, a, a, a, ag, a, a, a, a, a],
[i, i, i, c, c, c, i, c, i, i, i, i, i, i, i, m, a, a, a, a, ag, a, a, a, a, a, a, a, a, a],
[m, m, m, m, m, m, m, tn, m, m, m, m, m, m, m, m, _, _, _, _, _, _, _, _, _, _, _, _, _, _],
[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, o, _, _, _, _, _, _, _, _, _, _, _, _, _, _],
[h, s, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]
[h, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]
].reverse()
}

Expand All @@ -168,9 +168,10 @@ object nivel1 inherits Nivel {
}

override method generar(){
tunel.position(game.at(7, 2))
super()
sirius.position(game.at(17,17))
tunel.position(game.at(7, 2))
game.addVisual(sirius)
sirius.position(game.at(1,0))
}

override method siguiente(){
Expand Down Expand Up @@ -220,7 +221,15 @@ object i{
method generar(_position){
const camino = new CaminoInvalido(position = _position)
game.addVisual(camino)
caminosInvalidos.agregarCamino(self)
// caminosInvalidos.agregarCamino(self)
}
}

object c{
method generar(_position){
const camino = new CaminoValido(position = _position)
game.addVisual(camino)
caminosValidos.agregarCamino(camino)
}
}

Expand Down Expand Up @@ -250,8 +259,12 @@ object p{
method generar(position){
game.addVisual(new Pared(position = position))
}
}

object m{
method generar(position){
game.addVisual(new ParedVisible(position = position))
}
}

object dr{
Expand Down

0 comments on commit 3c23683

Please sign in to comment.