Skip to content

Commit

Permalink
no se cambia el fondo tras space
Browse files Browse the repository at this point in the history
  • Loading branch information
regueiranehuen committed Nov 6, 2024
1 parent 8712d70 commit bad23d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 65 deletions.
79 changes: 17 additions & 62 deletions src/main.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,29 @@ import flappy.*
//import flappyGame.*
import obstacles.*
import powerUps.*
//import menu.*
import menu.*

program flappyLeiGame {
// Configuración del juego
game.width(17)
game.height(10)
game.cellSize(70)
game.title('FlappyLei')
menu.render()


game.start()

keyboard.space().onPressDo({menu.desRender(gameManager)})



//menu.desRender()
//gameManager.manager()
}

object gameManager{
method manager(){
game.boardGround("fondo.png")

// controles
Expand Down Expand Up @@ -66,68 +81,8 @@ program flappyLeiGame {
const rain = game.sound("light-rain.mp3")
rain.shouldLoop(true)
game.schedule(500, { rain.play()} )
game.start()
//menu.desRender()
//gameManager.manager()
}
}

// object gameManager{
// method manager(){
// game.boardGround("fondo.png")

// // controles
// keyboard.q().onPressDo({game.stop()})
// keyboard.up().onPressDo({ flappyLei.position(flappyLei.position().up(1)) })

// // movimiento de flappy
// game.onTick(
// 2000,
// "movimiento",
// { flappyLei.position(flappyLei.position().down(1))
// })

// // Aparicion de los obstaculos
// obstacles.render()

// game.onTick(4500,"aparicion obstaculos",{
// obstacles.render()
// })


// // Movimiento de los obstaculos
// game.onTick(500, 'obstacles movement', ({
// obstacles.getCollectionArriba().forEach({
// obstacle => obstacle.moverIzquierda()
// })
// }))

// game.onTick(500, 'obstacles movement', {
// obstacles.getCollectionAbajo().forEach({
// obstacle => obstacle.moverIzquierda()
// })
// })

// game.onTick(15000,'powerUp',{ powerUp.reaccionarPowerUp(flappyLei)})

// // manejo de colisiones
// game.onCollideDo(flappyLei, {cosa => cosa.reaccionar(flappyLei)})


// // Visuales adicionales
// game.addVisual(pisoInvisible)
// game.addVisual(techoInvisible)
// game.addVisual(score)
// game.addVisual(powerUp)
// game.addVisual(flappyLei)


// // Musica
// // HACER MUSICA NORMAL DE FONDO HASTA QUE PASEN 15 SEGUNDOS
// const rain = game.sound("light-rain.mp3")
// rain.shouldLoop(true)
// game.schedule(500, { rain.play()} )
// }
// }



10 changes: 7 additions & 3 deletions src/menu.wlk
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import main.*
import wollok.game.*
/*object menu{
object menu{

method render(){
game.width(17)
Expand All @@ -8,10 +9,13 @@ import wollok.game.*
game.title('FlappyLei')
game.boardGround("MENUgrande.png")
game.addVisual(flappyLeiTexto)


}
method desRender(){
method desRender(gameManager){
game.removeVisual(flappyLeiTexto)
game.boardGround("fondo.png")
gameManager.manager()
}
}

Expand All @@ -20,4 +24,4 @@ object flappyLeiTexto{
method position()=game.at(3,7.5)

method image()="flappyLeiTexto.png"
}*/
}

0 comments on commit bad23d1

Please sign in to comment.