Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
FacundoDiezF committed Oct 31, 2024
1 parent 1e29bcb commit b524551
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 122 deletions.
2 changes: 1 addition & 1 deletion levels.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,10 @@ import menuYTeclado.*
],
siguienteNivel = endCredits
)

object endCredits {
method iniciar(){
juegoStickyBlock.clear()
configTeclado.gameOn()
new OnlyVisual(image="End.png",position = game.at(8,1)).iniciar()
}
}
Expand Down
241 changes: 120 additions & 121 deletions menuYTeclado.wlk
Original file line number Diff line number Diff line change
Expand Up @@ -59,147 +59,146 @@ import levels.*
}

//*==========================| Config Teclado |==========================
object configTeclado{

object configTeclado{
var teclado = tecladoJuego

var teclado = tecladoJuego
method iniciar(){

method iniciar(){
//* GAME ON:

//* GAME ON:
//Movimientos:
keyboard.up().onPressDo({teclado.up()})
keyboard.down().onPressDo({teclado.down()})
keyboard.left().onPressDo({teclado.left()})
keyboard.right().onPressDo({teclado.right()})

//Movimientos:
keyboard.up().onPressDo({teclado.up()})
keyboard.down().onPressDo({teclado.down()})
keyboard.left().onPressDo({teclado.left()})
keyboard.right().onPressDo({teclado.right()})
//unDo:
keyboard.control().onPressDo({teclado.control()})

//unDo:
keyboard.control().onPressDo({teclado.control()})
//Menu en nivel:
keyboard.m().onPressDo({teclado.m()})
keyboard.r().onPressDo({teclado.r()})

//Menu en nivel:
keyboard.m().onPressDo({teclado.m()})
keyboard.r().onPressDo({teclado.r()})
//* MENU ON:
keyboard.p().onPressDo({teclado.p()})
keyboard.l().onPressDo({teclado.l()})

//* MENU ON:
keyboard.p().onPressDo({teclado.p()})
keyboard.l().onPressDo({teclado.l()})
//* LEVEL MENU ON:
keyboard.num1().onPressDo({teclado.num1()})
keyboard.num2().onPressDo({teclado.num2()})
keyboard.num3().onPressDo({teclado.num3()})
keyboard.num4().onPressDo({teclado.num4()})
keyboard.num5().onPressDo({teclado.num5()})
keyboard.num6().onPressDo({teclado.num6()})
keyboard.num7().onPressDo({teclado.num7()})
keyboard.num8().onPressDo({teclado.num8()})
keyboard.num9().onPressDo({teclado.num9()})

//* LEVEL MENU ON:
keyboard.num1().onPressDo({teclado.num1()})
keyboard.num2().onPressDo({teclado.num2()})
keyboard.num3().onPressDo({teclado.num3()})
keyboard.num4().onPressDo({teclado.num4()})
keyboard.num5().onPressDo({teclado.num5()})
keyboard.num6().onPressDo({teclado.num6()})
keyboard.num7().onPressDo({teclado.num7()})
keyboard.num8().onPressDo({teclado.num8()})
keyboard.num9().onPressDo({teclado.num9()})
}

}
method gameOn(){
teclado = tecladoJuego
}

method gameOn(){
teclado = tecladoJuego
}
method menuOn(){
teclado = tecladoMenu
}

method menuOn(){
teclado = tecladoMenu
method levelMenuOn(){
teclado = tecladoSelectorNivel
}
}

method levelMenuOn(){
teclado = tecladoSelectorNivel
class TecladoBase{
method up(){}
method down(){}
method left(){}
method right(){}

method control(){}

method m(){}
method r(){}
method p(){}
method l(){}

method num1(){}
method num2(){}
method num3(){}
method num4(){}
method num5(){}
method num6(){}
method num7(){}
method num8(){}
method num9(){}
}

object tecladoJuego inherits TecladoBase{
override method up(){
cuerpo.moverCuerpo(arriba)
}
override method down(){
cuerpo.moverCuerpo(abajo)
}
override method left(){
cuerpo.moverCuerpo(izquierda)
}
override method right(){
cuerpo.moverCuerpo(derecha)
}

override method control(){
juegoStickyBlock.unDo()
}
}

class TecladoBase{
method up(){}
method down(){}
method left(){}
method right(){}

method control(){}

method m(){}
method r(){}
method p(){}
method l(){}

method num1(){}
method num2(){}
method num3(){}
method num4(){}
method num5(){}
method num6(){}
method num7(){}
method num8(){}
method num9(){}
}

object tecladoJuego inherits TecladoBase{
override method up(){
cuerpo.moverCuerpo(arriba)
}
override method down(){
cuerpo.moverCuerpo(abajo)
}
override method left(){
cuerpo.moverCuerpo(izquierda)
}
override method right(){
cuerpo.moverCuerpo(derecha)
}

override method control(){
juegoStickyBlock.unDo()
}

override method m(){
menu.iniciar()
}
override method m(){
menu.iniciar()
}

override method r(){
juegoStickyBlock.reset()
override method r(){
juegoStickyBlock.reset()
}
}
}

class TecladoMenu inherits TecladoBase{
override method p(){
juegoStickyBlock.nivelActual().iniciar()
}
class TecladoMenu inherits TecladoBase{
override method p(){
juegoStickyBlock.nivelActual().iniciar()
}

override method l(){
levelMenu.toggle()
override method l(){
levelMenu.toggle()
}
}
}

const tecladoMenu = new TecladoMenu()
const tecladoMenu = new TecladoMenu()

object tecladoSelectorNivel inherits TecladoMenu{
override method num1(){
nivel1.iniciar()
}
override method num2(){
nivel2.iniciar()
}
override method num3(){
nivel3.iniciar()
}
override method num4(){
nivel4.iniciar()
}
override method num5(){
nivel5.iniciar()
}
override method num6(){
nivel6.iniciar()
}
override method num7(){
nivel7.iniciar()
}
override method num8(){
nivel8.iniciar()
}
override method num9(){
nivel9.iniciar()
}
}
object tecladoSelectorNivel inherits TecladoMenu{
override method num1(){
nivel1.iniciar()
}
override method num2(){
nivel2.iniciar()
}
override method num3(){
nivel3.iniciar()
}
override method num4(){
nivel4.iniciar()
}
override method num5(){
nivel5.iniciar()
}
override method num6(){
nivel6.iniciar()
}
override method num7(){
nivel7.iniciar()
}
override method num8(){
nivel8.iniciar()
}
override method num9(){
nivel9.iniciar()
}
}

0 comments on commit b524551

Please sign in to comment.