-
Notifications
You must be signed in to change notification settings - Fork 0
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
92e8ab8
commit 2de700a
Showing
2 changed files
with
38 additions
and
186 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
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,33 @@ | ||
class Bloque{ | ||
var property position = game.center() //habrá que posicionar los limites | ||
method image() = "bloque_slime.png" | ||
method soyBloque() = true | ||
method ubicarYDibujar(x,y){ | ||
self.position(game.at(x,y)) | ||
game.addVisual(self) | ||
} | ||
} | ||
|
||
object muros{ | ||
method crearLaterales(){ | ||
const ancho = game.width() - 1 | ||
const alto = game.height() - 1 | ||
(0 .. ancho).forEach({x => (new Bloque()).ubicarYDibujar(x, 0)}) // Borde inferior | ||
(0 .. ancho).forEach({x => (new Bloque()).ubicarYDibujar(x, alto)}) // Borde superior | ||
(0 .. alto).forEach({y => (new Bloque()).ubicarYDibujar(0, y)}) // Borde izquierdo | ||
(0 .. alto).forEach({y => (new Bloque()).ubicarYDibujar(ancho, y)}) // Borde derecho | ||
} | ||
} | ||
|
||
object escenario{ | ||
var lista = [[2,6], [2,7], [7,7], [7,6], [7,4], [2,4], [4,2], [5,2], [3,3], [6,3]] | ||
method generarEscenario(){ | ||
(0 .. 9).forEach({x => self.dibujar(x)}) | ||
} | ||
method dibujar(x){ | ||
const listaAux = lista.get(x) | ||
const j = listaAux.get(0) | ||
const z = listaAux.get(1) | ||
new Bloque().ubicarYDibujar(j, z) | ||
} | ||
} |