Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- blanco = color.new(255,255,255)
- rojo = color.new(255,0,0)
- azul = color.new(0,0,255)
- negro = color.new(0,0,0)
- menu = 1
- menu2 = 2
- fondo = image.load("imagenes/menu.png")
- sound.loop("sonido/sonido.mp3")
- opciones_del_menu = {
- "JUGAR",
- "COMO JUGAR",
- "ESTADISTICAS",
- "OPCIONES",
- "ACERCA DE",
- "SALIR"
- }
- function menu_juego()
- while true do
- fondo:blit(0,0)
- controls.read()
- --Pintar las opciones
- if menu2 == 1 then
- screen.print(159,108,"COMO JUGAR",1,azul,blanco)
- screen.print(174,150,"OPCIONES",1,azul,blanco)
- else
- screen.print(159,108,"COMO JUGAR",1,azul,blanco)
- screen.print(174,150,"OPCIONES",1,azul,blanco)
- end
- --Mover entre el menu
- if controls.press("up") or controls.press("left") then
- menu2 = menu2-1
- if menu2 < 1 then menu2 = 2 end
- end
- if controls.press("down") or controls.press("right") then
- menu2 = menu2+1
- if menu2 > 2 then menu2 = 1 end
- end
- --Al pulsar X:
- if controls.press("cross") then
- if menu2 == 1 then
- dofile("Nivel1.lua")
- elseif menu2 == 2 then
- dofile("NivelP.lua")
- end
- end
- screen.flip();
- end
- end
- while true do
- controls.read()
- fondo:blit(0,0)
- --Pintar las opciones
- for i = 1, #opciones_del_menu do
- if menu == i then
- screen.print(190,85+(i-1)*21,opciones_del_menu[i],1,rojo,blanco)
- else
- screen.print(190,85+(i-1)*21,opciones_del_menu[i],1,azul,blanco)
- end
- end
- --Mover entre el menu
- if controls.press("up") or controls.press("left") then
- menu = menu-1
- if menu < 1 then menu = 6 end
- end
- if controls.press("down") or controls.press("right") then
- menu = menu+1
- if menu > 6 then menu = 1 end
- end
- --Al pulsar X:
- if controls.press("cross") then
- if menu == 1 then
- dofile("Nivel1.lua")
- elseif menu == 2 then
- dofile("NivelP.lua")
- elseif menu == 3 then
- elseif menu == 4 then
- elseif menu == 5 then
- elseif menu == 6 then
- menu_juego()
- end
- end
- screen.flip()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement