diff --git a/assets/FondoSeleccion.png b/assets/FondoSeleccion.png new file mode 100644 index 0000000..bf5e9a0 Binary files /dev/null and b/assets/FondoSeleccion.png differ diff --git a/assets/FondoSeleccion2.png b/assets/FondoSeleccion2.png deleted file mode 100644 index 9239605..0000000 Binary files a/assets/FondoSeleccion2.png and /dev/null differ diff --git a/assets/TERMINO.png b/assets/TERMINO.png new file mode 100644 index 0000000..54a6e87 Binary files /dev/null and b/assets/TERMINO.png differ diff --git a/assets/banana.png b/assets/banana.png index 5cba5d2..3aa180b 100644 Binary files a/assets/banana.png and b/assets/banana.png differ diff --git a/assets/bloque_slime.png b/assets/bloque_slime.png deleted file mode 100644 index ef31904..0000000 Binary files a/assets/bloque_slime.png and /dev/null differ diff --git a/assets/bloque_slime2.png b/assets/bloque_slime2.png new file mode 100644 index 0000000..0ea99eb Binary files /dev/null and b/assets/bloque_slime2.png differ diff --git a/assets/fondo slime.png b/assets/fondo slime.png new file mode 100644 index 0000000..df212f6 Binary files /dev/null and b/assets/fondo slime.png differ diff --git a/assets/helado.png b/assets/helado.png deleted file mode 100644 index 48128ac..0000000 Binary files a/assets/helado.png and /dev/null differ diff --git a/assets/heladon.png b/assets/heladon.png new file mode 100644 index 0000000..865a232 Binary files /dev/null and b/assets/heladon.png differ diff --git a/assets/no.png b/assets/no.png deleted file mode 100644 index f63eb73..0000000 Binary files a/assets/no.png and /dev/null differ diff --git a/assets/pausa.png b/assets/pausa.png deleted file mode 100644 index 72acb33..0000000 Binary files a/assets/pausa.png and /dev/null differ diff --git a/assets/piopio.png b/assets/piopio.png new file mode 100644 index 0000000..d82d987 Binary files /dev/null and b/assets/piopio.png differ diff --git a/assets/sandia.png b/assets/sandia.png index 7c4d24f..251acaf 100644 Binary files a/assets/sandia.png and b/assets/sandia.png differ diff --git a/assets/si.png b/assets/si.png index c69d304..8b029a1 100644 Binary files a/assets/si.png and b/assets/si.png differ diff --git a/assets/uva2.png b/assets/uva2.png index 25fca58..830e626 100644 Binary files a/assets/uva2.png and b/assets/uva2.png differ diff --git a/jugador.wlk b/jugador.wlk index 03e5d4c..e9adab9 100644 --- a/jugador.wlk +++ b/jugador.wlk @@ -15,16 +15,15 @@ object jugador { } } - var valor = 0 - method valor(numero){ - valor = numero - } + var property valor = 0 method image(){ if(valor == 0){ - return "goku2.png" + return "heladon.png" + } else if (valor == 1){ + return "piopio.png" } else { - return "helado.png" + return "goku2.png" } } diff --git a/mainExample.wpgm b/mainExample.wpgm index 19273fa..5c43bb2 100644 --- a/mainExample.wpgm +++ b/mainExample.wpgm @@ -10,15 +10,12 @@ import miscelaneos.* program BadIceCreamGame { game.cellSize(40) //ancho del helado + var fondo = "fondo slime.png" + game.boardGround(fondo) game.title("Bad Ice Cream") game.height(18) game.width(18) - //dibujar menu de personajes - game.addVisual(menuPersonajes) - game.addVisual(noSeleccionado) - game.addVisual(siSeleccionado) - //Personalización - //Mundo + //Inicio menu juego.menuPersonajes() //inicio game.start() @@ -43,7 +40,10 @@ program BadIceCreamGame { object juego{ var inicio = false - method menuNiveles(){ + var seleccionado = 0 + method menuNiveles(){ //SELECCION DE NIVELES + game.addVisual(menuNiveles) + game.addVisual(seleccion) keyboard.a().onPressDo({ if(seleccion.position().x() > 1){ seleccion.position(game.at(seleccion.position().x()-2,seleccion.position().y())) @@ -80,31 +80,33 @@ object juego{ }) } - method menuPersonajes(){ + method menuPersonajes(){ //SELECCION DE PERSONAJES + game.addVisual(menuPersonajes) + game.addVisual(siSeleccionado) keyboard.a().onPressDo({ - noSeleccionado.position(game.at(10,5)) - siSeleccionado.position(game.at(2,5)) + if(siSeleccionado.position().x() > 2) siSeleccionado.position(game.at(siSeleccionado.position().x()-5,5)) }) keyboard.d().onPressDo({ - noSeleccionado.position(game.at(2,5)) - siSeleccionado.position(game.at(10,5)) + if(siSeleccionado.position().x() < 12) siSeleccionado.position(game.at(siSeleccionado.position().x()+5,5)) }) keyboard.enter().onPressDo({ - if(noSeleccionado.position() == game.at(2,5)){ - jugador.valor(0) - } else { - jugador.valor(1) + if(seleccionado == 0){ + if(siSeleccionado.position() == game.at(2,5)){ + jugador.valor(0) + } else if (siSeleccionado.position() == game.at(7,5)){ + jugador.valor(1) + } else if (siSeleccionado.position() == game.at(12,5)){ + jugador.valor(2) + } + game.removeVisual(menuPersonajes) + game.removeVisual(siSeleccionado) + seleccionado = 1 + self.menuNiveles() } - game.removeVisual(menuPersonajes) - game.removeVisual(noSeleccionado) - game.removeVisual(siSeleccionado) - game.addVisual(menuNiveles) - game.addVisual(seleccion) - self.menuNiveles() }) } - method jugar(){ + method jugar(){ //DIBUJO DE LOS ELEMENTOS DEL MUNDO if(!inicio){ //dibujar muros muros.crearLaterales() @@ -121,7 +123,7 @@ object juego{ } } - method bloquear(){ + method bloquear(){ //DIBUJAR MENSAJE DE "NIVEL NO DESBLOQUEADO" if(!inicio){ if(bloqueados.any({bloqueado => bloqueado == seleccion.position()})){ game.addVisual(bloqueado) @@ -130,7 +132,7 @@ object juego{ } } } - const bloqueados = [game.at(1,3),game.at(1,5),game.at(1,7),game.at(1,9), + const bloqueados = [game.at(1,3),game.at(1,5),game.at(1,7),game.at(1,9), //lista de niveles a los que no se puede acceder game.at(3,3),game.at(3,5),game.at(3,7),game.at(3,9), game.at(5,3),game.at(5,5),game.at(5,7),game.at(5,9),game.at(5,11), game.at(7,3),game.at(7,5),game.at(7,7),game.at(7,9),game.at(7,11), diff --git a/miscelaneos.wlk b/miscelaneos.wlk index 7a7dd35..a530270 100644 --- a/miscelaneos.wlk +++ b/miscelaneos.wlk @@ -10,16 +10,11 @@ object ganaste{ object menuPersonajes{ var property position = game.origin() - method image() = "FondoSeleccion2.png" -} - -object noSeleccionado{ - var property position = game.at(2,5) - method image() = "no.png" + method image() = "FondoSeleccion.png" } object siSeleccionado{ - var property position = game.at(10,5) + var property position = game.at(2,5) method image() = "si.png" } diff --git a/muros.wlk b/muros.wlk index e9fe478..80af956 100644 --- a/muros.wlk +++ b/muros.wlk @@ -1,6 +1,6 @@ class Bloque{ var property position = game.center() //habrá que posicionar los limites - method image() = "bloque_slime.png" + method image() = "bloque_slime2.png" method soyBloque() = true method ubicarYDibujar(posicion){ self.position(posicion) @@ -48,7 +48,7 @@ object escenario{ [game.at(2,12), game.at(2,13), game.at(2,14), game.at(2,15), game.at(3,15), game.at(4,12), game.at(4,13), game.at(4,14), game.at(4,15), //ojo I game.at(13,12), game.at(13,13), game.at(13,14), game.at(13,15), game.at(14,15), game.at(15,12), game.at(15,13), game.at(15,14), game.at(15,15), //ojo D game.at(7,10), game.at(8,10), game.at(9,10), game.at(10,10), game.at(8,9), game.at(9,9), //nariz - game.at(3,5), game.at(4,4), game.at(5,4), game.at(6,3), game.at(7,3), game.at(8,4), game.at(9,4), game.at(10,3), game.at(11,3), game.at(12,4), game.at(13,4), game.at(14,5), game.at(8,5), game.at(8,6), game.at(8,7), game.at(9,5), game.at(9,6), game.at(9,7)], //boca] + game.at(3,5), game.at(4,4), game.at(5,4), game.at(6,3), game.at(7,3), game.at(8,4), game.at(9,4), game.at(10,3), game.at(11,3), game.at(12,4), game.at(13,4), game.at(14,5), game.at(8,5), game.at(8,6), game.at(8,7), game.at(9,5), game.at(9,6), game.at(9,7)], //boca //Nivel 2 [game.at(2,13), game.at(3,13), game.at(4,14), game.at(5,14), game.at(6,15), game.at(7,15), game.at(8,15), game.at(9,15), game.at(10,15), game.at(11,15), game.at(12,15), game.at(13,15), game.at(14,14), game.at(15,12), game.at(2,12), game.at(3,4), game.at(4,11), game.at(5,11), game.at(6,12), game.at(7,13), game.at(8,13), game.at(9,13), game.at(10,13), game.at(11,13), game.at(12,13), game.at(13,11), game.at(14,13), game.at(15,11),