generated from wollok/empty-game
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
344172d
commit 4c7a5c8
Showing
4 changed files
with
144 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,3 +64,5 @@ object tablero { | |
|
||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
|
||
} | ||
|