Skip to content

Commit

Permalink
Finalizado Del Agregado de Musica
Browse files Browse the repository at this point in the history
  • Loading branch information
MatePirchi committed Nov 15, 2024
1 parent d91c419 commit d5b4e3f
Showing 1 changed file with 14 additions and 30 deletions.
44 changes: 14 additions & 30 deletions game.wpgm
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,19 @@ import tetris.*
bloqueActual.entrarEnTablero()
bloqueSombra = controlador.crearSombraYUbicarla(bloqueActual)
bloqueNext.mostrar()
/*object musica {
method play(){
game.sound("tetrisgameboy.mp3").play()
}
}
keyboard.enter().onPressDo({musica.play()})
*/
/*
method clearGame() {
game.allVisuals().forEach({ visual => game.removeVisual(visual) })
}

self.clearGame()
*/

const sonidoFondo = game.sound("tetrisgameboy.mp3")


game.start()

sonidoFondo.shouldLoop(true)
game.schedule(50, {
sonidoFondo.play()
sonidoFondo.pause()
sonidoFondo.resume()
} )

keyboard.r().onPressDo({
nivel.resetear()
puntaje.resetear()
Expand All @@ -60,31 +57,18 @@ import tetris.*
bloqueActual.entrarEnTablero()
bloqueSombra = controlador.crearSombraYUbicarla(bloqueActual)
bloqueNext.mostrar()

/*
//reinniciamos numeros (ya existen los metodos)
//reiniciamos el tablero
//reiniciamos next y hold
//generamos nuevo bloque actual y nuevo bloque next
*/

})
//MUSICA
//
/*const tetris = game.sound("tetrisgameboy.mp3")
tetris.shouldLoop(true)
keyboard.p().onPressDo({tetris.pause()})
keyboard.r().onPressDo({tetris.resume()})
keyboard.s().onPressDo({tetris.stop()})
game.schedule(500, { tetris.play()} )*/
//-----FIN MUSICA

keyboard.p().onPressDo({
if (!juegoPausado){
juegoPausado = true
visuales.mostrarVentanaPausa()
sonidoFondo.pause()
}else{
juegoPausado = false
visuales.ocultarVentanaPausa()
sonidoFondo.resume()
}
})

Expand Down

0 comments on commit d5b4e3f

Please sign in to comment.