Skip to content

Commit

Permalink
intente cosas pero no concreté
Browse files Browse the repository at this point in the history
  • Loading branch information
biancapicchio committed Nov 9, 2023
1 parent 344172d commit 4c7a5c8
Show file tree
Hide file tree
Showing 4 changed files with 144 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/direcciones.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ object tablero {

}



8 changes: 1 addition & 7 deletions src/juego.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ program juego {

game.onTick(1000, "caminataGuardias", {listaGuardias.caminar()})

//<<<<<<< HEAD
// nivelx.generar()
// //a
//=======
// //nivelx.generar()
//
//>>>>>>> refs/remotes/origin/branch_mateo
nivelx.generar()
keyboard.up().onPressDo({ harry.mover(arriba) })
keyboard.down().onPressDo({ harry.mover(abajo) })
keyboard.left().onPressDo({ harry.mover(izquierda) })
Expand Down
26 changes: 26 additions & 0 deletions src/musica.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
object musica {

var cancion = default.cancion()

method iniciar() {
self.configuracion()
game.schedule(20, { cancion.play()}) // cambie el tiempo de arranque
}

method reproducir() {
if (self.estaPausada()) {
cancion.resume()
} else {
cancion.play()
}
}

method configuracion() {
cancion.shouldLoop(true)
cancion.volume(0.2)
}
}

object default {
const property cancion = game.sound()
}
115 changes: 115 additions & 0 deletions src/nivel2.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import wollok.game.*
import enemigos.*
import personajes.*
import objetosUtiles.*

class Nivel {

const celdas
const property cancion

method iniciar() {
self.terminar()
self.generar()
.cambiar(self.cancion())
}

method terminar() {
game.clear()
}

method generar() {
(0 .. game.width() - 1).forEach({ x => (0 .. game.height() - 1).forEach({ y => self.generarCelda(x, y)})})
}

method generarCelda(x, y) {
const celda = celdas.get(y).get(x)
celda.forEach({ objeto => objeto.generar(game.at(x, y))})
}

}

object _ {

method generar(position) {
}

}

object i {

method generar(_position) {
game.addVisual(new CaminoInvalido(position = _position))
}

}

object tn {

method validarEntrada(personaje) {
if (not personaje.puedePasarCueva()) {
self.error("No puedo entrar ahi!")
}
}

method generar(position) {
game.addVisual(tunel)
tunel.position(position)
}

}

object o {

method generar(position) {
const oculto = new Oculto(position = position)
game.addVisual(oculto)
objetosUsables.agregarObjeto(oculto)
}

}

object p {

method generar(position) {
game.addVisual(new Pared(position = position))
}

}

object g {

method generar(position) {
const guardia = new Guardia(position = position)
game.addVisual(guardia)
listaGuardias.agregarGuardia(guardia)
}

}

object a {

method generar(position) {
game.addVisual(new ZonaDeGuardias(position = position))
}

}

object h {

method generar(position) {
harry.position(position)
game.addVisual(harry)
}

}

object s {

method generar(position) {
sirius.position(position)
game.addVisual(sirius)
}

}

0 comments on commit 4c7a5c8

Please sign in to comment.