Skip to content

Commit

Permalink
menu niveles if sacado
Browse files Browse the repository at this point in the history
  • Loading branch information
brisabrussa28 committed Nov 9, 2024
1 parent 65e60d6 commit 300d6bb
Show file tree
Hide file tree
Showing 28 changed files with 50 additions and 40 deletions.
Binary file removed assets/PP_niveles.png
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
9 changes: 1 addition & 8 deletions mainExample.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ program BadIceCreamGame {
//Inicio menu
menuPersonaje.cargar()
//inicio



game.start()






//Juego puntos
keyboard.r().onPressDo({
const nuevoPunto = interactuador.obtenerPrimerElemento("r"," sobre una fruta para recolectarla")
Expand Down
32 changes: 10 additions & 22 deletions menus.wlk
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import musica.*
import mainExample.*

import wollok.game.*

import jugador.*

import muros.*

import enemigos.*

import puntos.*

import miscelaneos.*

class Menus{
Expand Down Expand Up @@ -43,22 +37,16 @@ object menuPersonaje inherits Menus(add_1 = menuPersonajes, add_2 = marcoDeSelec
keyboard.enter().onPressDo({
if(sincronizadorDePantallas.pantallaActual() == tipoDeMenu){
sincronizadorDePantallas.cambiarPantalla("niveles")
if(marcoDeSeleccion.position().x() == 7){ //elementos del pajarito
jugador.valor("p_piopio.png")
lineaEnemiga.imagen("e_elusive.png")
fondoJuego.valor("f_pio.png")
visual.valor("b_pio_i.png")
visualSuperior.valor("b_pio_sup.png")
spawn.puntos(["archaic coin.png", "circus coin.png", "lunaver coin.png"])
} else if(marcoDeSeleccion.position().x() == 12){ //elementos de Goku
jugador.valor("p_goku.png")
lineaEnemiga.imagen("e_cell.png")
fondoJuego.valor("f_pasto.png")
visual.valor("b_pasto_i.png")
visualSuperior.valor("b_pasto_sup.png")
spawn.puntos(["semilla.png", "capsula.png", "comida.png"])
musicaDeFondo.sonido(game.sound("musicaDragonBallZ.mp3"))
}
//valores visuales
const posicion = (marcoDeSeleccion.position().x()-2)/5
jugador.valor(coleccion.personaje(posicion))
lineaEnemiga.imagen(coleccion.enemigo(posicion))
fondoJuego.valor(coleccion.fondo(posicion))
visual.valor(coleccion.bloque_i(posicion))
visualSuperior.valor(coleccion.bloque_s(posicion))
spawn.puntos(coleccion.puntos(posicion))
musicaDeFondo.sonido(game.sound(coleccion.musica(posicion)))
//remove
game.removeVisual(menuPersonajes)
game.removeVisual(marcoDeSeleccion)
menuNivel.cargar()
Expand Down
33 changes: 31 additions & 2 deletions miscelaneos.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ object finDelJuego{

mixin ObjetoVisible {
method soyBloque() = false
method esFruta() = false
method esPunto() = false
method jugador() = false
method esEnemigo() = false
method esFondo() = false
Expand Down Expand Up @@ -69,4 +69,33 @@ object fondoJuego inherits ObjetoVisible{
var property valor = "f_slime.png"
method image() = valor
override method esFondo() = true
}
}

//IMAGENES RELACIONADA A LOS PERSONAJES
object coleccion{
const c_personajes = ["p_helado.png", "p_piopio.png", "p_goku.png"]
const c_animaciones_d = ["ataque_d_helado.png", "ataque_d_piopio.png", "ataque_d_goku.png"]
const c_animaciones_i = ["ataque_i_helado.png", "ataque_i_piopio.png","ataque_i_goku.png"]
const c_ataques_d = ["a_d_helados.png","a_d_granada.png","a_d_kame.png"]
const c_ataques_i = ["a_i_helados.png","a_i_granada.png","a_i_kame.png"]
const c_enemigos = ["e_brocoli.png", "e_elusive.png", "e_cell.png"]
const c_bloques = ["b_fiesta_i.png","b_pio_i.png","b_pasto_i.png"]
const c_bloques_sup = ["b_fiesta_sup.png","b_pio_sup.png","b_pasto_sup.png"]
const c_fondos = ["f_slime.png","f_pio.png","f_pasto.png"]
const c_puntos = [["pu_bananas.png","pu_uva.png","pu_sandias.png"],
["pu_archaic coin.png","pu_circus coin.png","pu_lunaver coin.png"],
["pu_semilla.png","pu_capsula.png","pu_comida.png"]]
const c_musica = ["BadIceCreamMusicaDeFondo.mp3", "BadIceCreamMusicaDeFondo.mp3", "musicaDragonBallZ.mp3"]

method personaje(indice) = c_personajes.get(indice)
method animacion_d(indice) = c_animaciones_d.get(indice)
method animacion_i(indice) = c_animaciones_i.get(indice)
method ataque_d(indice) = c_ataques_d.get(indice)
method ataque_i(indice) = c_ataques_i.get(indice)
method enemigo(indice) = c_enemigos.get(indice)
method bloque_i(indice) = c_bloques.get(indice)
method bloque_s(indice) = c_bloques_sup.get(indice)
method fondo(indice) = c_fondos.get(indice)
method puntos(indice) = c_puntos.get(indice)
method musica(indice) = c_musica.get(indice)
}
10 changes: 5 additions & 5 deletions muros.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object visualSuperior{

object escenario{
const property listaPosiciones = []
const property listafrutas = []
const property listaPuntos = []
const property listaBloques = []
var property nivel = 0

Expand All @@ -55,18 +55,18 @@ object escenario{
}

method limpiarBloques() = listaBloques.forEach({block => block.quitarBloque() listaBloques.remove(block)})
method limpiarFrutas() = listafrutas.forEach({fruta => listafrutas.remove(fruta)})
method limpiarFrutas() = listaPuntos.forEach({fruta => listaPuntos.remove(fruta)})
method limpiarEscenario() {
self.limpiarBloques()
self.limpiarFrutas()
}

method mismaPosicion(posiblePosicion) = listaPosiciones.any({posicion => posicion == posiblePosicion})
method mismaPosicionFruta(posiblePosicion) = listafrutas.any({posicion => posicion == posiblePosicion})
method mismaPosicionFruta(posiblePosicion) = listaPuntos.any({posicion => posicion == posiblePosicion})

method enlistarObjeto(cosa) = listafrutas.add(cosa)
method enlistarObjeto(cosa) = listaPuntos.add(cosa)
method enlistarBloque(block) = listaBloques.add(block)

method quitarObjeto(cosa) = listafrutas.remove(cosa)
method quitarObjeto(cosa) = listaPuntos.remove(cosa)
method sacarBloqueDeLista(block) = listaBloques.remove(block)
}
6 changes: 3 additions & 3 deletions puntos.wlk
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import muros.*
import miscelaneos.*

class Fruta inherits ObjetoVisible{
class Punto inherits ObjetoVisible{
var property position = posicionAleatoria.generarPosicionAleatoria()
var valor = spawn.puntos().get(0)

override method esFruta() = true
override method esPunto() = true

method image(){
return valor
Expand All @@ -28,7 +28,7 @@ class Fruta inherits ObjetoVisible{

object spawn{
method dibujarPuntos(indice){
(0..9).forEach({x => new Fruta().ubicarYDibujar(posicionAleatoria.generarPosicionAleatoria(), indice)})
(0..9).forEach({x => new Punto().ubicarYDibujar(posicionAleatoria.generarPosicionAleatoria(), indice)})
}

var property puntos = ["bananas.png", "uva.png", "sandia.png"]
Expand Down

0 comments on commit 300d6bb

Please sign in to comment.