Skip to content

Commit

Permalink
Mapa mejorado y con los elementos
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin-Sosa committed Oct 2, 2024
1 parent dc5bdb9 commit e8de9ee
Show file tree
Hide file tree
Showing 25 changed files with 90 additions and 17 deletions.
Binary file added assets/acido46.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 removed assets/bloque.png
Binary file not shown.
Binary file removed assets/bloqueAgua.png
Binary file not shown.
Binary file removed assets/bloqueBoton.png
Binary file not shown.
Binary file removed assets/bloqueConAcido6.png
Binary file not shown.
Binary file removed assets/bloqueConBoton.png
Binary file not shown.
Binary file added assets/bloqueDeAgua.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/bloqueDeFuego.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 removed assets/bloqueFuego.png
Binary file not shown.
Binary file added assets/bloqueTierra2.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 modified assets/boton.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 modified assets/cubo.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 removed assets/elevador.png
Binary file not shown.
Binary file added assets/elevador2.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 removed assets/fireboy3.png
Binary file not shown.
Binary file added assets/fireboy6.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 modified assets/puertaAbierta.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 modified assets/puertaAgua.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 modified assets/puertaFuego.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 removed assets/watergirl.png
Binary file not shown.
Binary file added assets/watergirl3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions elementos.wlk
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
object boton
{
var property position = game.at(5,7)
method image() = "boton.png"
}

object elevadorPorPalanca
{
var property position = game.at(0,6)
method image() = "elevador2.png"
}

object elevadorPorBoton
{
var property position = game.at(14,9)
method image() = "elevador2.png"
}

object palanca
{
var property position = game.at(3,4)
method image() = "palanca.png"
}

object puertaFuego
{
var property position = game.at(12,14)
method image() = "puertaFuego.png"
}

object puertaAgua
{
var property position = game.at(8,14)
method image() = "puertaAgua.png"
}

object cubo
{
var property position = game.at(6,10)
method image() = "cubo.png"
}
2 changes: 1 addition & 1 deletion main.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ program FireboyAndWatergirl {
game.title("Fireboy and Watergirl")
game.height(16)
game.width(15)
game.cellSize(80)
game.cellSize(50)
game.boardGround("bg.png")
game.addVisual(fireboy)
game.addVisual(watergirl)
Expand Down
53 changes: 39 additions & 14 deletions mapa.wlk
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import elementos.*

object mapa
{
method crearBloques(y, xi, xf, tipo)
Expand All @@ -10,27 +12,50 @@ object mapa
})
}

method inciar()
{
self.crearBloques(1, 0, 2, "bloque.png")
self.crearBloques(1, 13, 15, "bloque.png")
self.crearBloques(2, 6, 10, "bloque.png")
self.crearBloques(3, 0, 4, "bloque.png")
self.crearBloques(6, 2, 15, "bloque.png")
self.crearBloques(9, 0, 12, "bloque.png")
self.crearBloques(12, 0, 2, "bloque.png")
self.crearBloques(13, 4, 15, "bloque.png")
method agregarElementos()
{
game.addVisual(boton)
game.addVisual(palanca)
game.addVisual(elevadorPorBoton)
game.addVisual(elevadorPorPalanca)
game.addVisual(puertaAgua)
game.addVisual(puertaFuego)
game.addVisual(cubo)
}

method crearBloquesDeTierra()
{
self.crearBloques(1, 0, 2, "bloqueTierra2.png")
self.crearBloques(1, 13, 15, "bloqueTierra2.png")
self.crearBloques(2, 6, 11, "bloqueTierra2.png")
self.crearBloques(3, 0, 4, "bloqueTierra2.png")
self.crearBloques(6, 2, 15, "bloqueTierra2.png")
self.crearBloques(9, 0, 12, "bloqueTierra2.png")
self.crearBloques(12, 0, 1, "bloqueTierra2.png")
self.crearBloques(13, 3, 15, "bloqueTierra2.png")
}

self.crearBloques(0, 5, 6, "bloqueFuego.png")
self.crearBloques(0, 9, 10, "bloqueAgua.png")
self.crearBloques(2, 8, 8, "bloqueConAcido6.png")
self.crearBloques(6, 4, 4, "bloqueBoton.png")
method crearBloquesEspeciales()
{
self.crearBloques(0, 5, 6, "bloqueDeFuego.png")
self.crearBloques(0, 9, 10, "bloqueDeAgua.png")
self.crearBloques(3, 8, 9, "acido46.png")
}

method inciar()
{
self.crearBloquesDeTierra()
self.crearBloquesEspeciales()
self.agregarElementos()
}
}

class Bloque
{
var property position = game.at(0,0)
var property image = ""

method tratarColision(personaje)
{
}
}
11 changes: 9 additions & 2 deletions personajes.wlk
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
object fireboy
{
var property position = game.at(0,0)
var posicionAnt = null
var cantSaltos = 0
method image() = "fireboy3.png"
method image() = "fireboy6.png"
method movIzquierda()
{
posicionAnt = position
position = position.left(1)
}
method movDerecha()
{
posicionAnt = position
position = position.right(1)
}
method movSaltar()
{
if(cantSaltos < 2)
{
posicionAnt = position
position = position.up(1)
cantSaltos += 1
game.schedule(800, {
Expand All @@ -23,13 +27,16 @@ object fireboy
})
}
}
method retroceder() {
position = posicionAnt
}
}

object watergirl
{
var property position = game.at(0,2)
var cantSaltos = 0
method image() = "watergirl.png"
method image() = "watergirl3.png"
method movIzquierda()
{
position = position.left(1)
Expand Down

0 comments on commit e8de9ee

Please sign in to comment.