Advertisement
xerpi

Untitled

Apr 17th, 2011
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.74 KB | None | 0 0
  1. imagen={}
  2. sonido={}
  3. menu={}
  4.  
  5. for i = 1,4 do
  6. imagen[i]=image.load("imagenes/imagen"..i..".png")
  7. menu[i]=image.load("imagenes/menu"..i..".png")
  8. sonido[i]=image.load("sonidos/sonido"..i..".mp3")
  9. end
  10.  
  11. current = 1
  12. while true do
  13.  
  14. controls.read()
  15.  
  16. if controls.press("circle") then
  17.     dofile("script.lua")
  18. end
  19.  
  20. menu[current]:blit(0,0)
  21.  
  22. if controls.press("down") then
  23. if current==#menu then current = 1 else current=current+1 end
  24. end
  25.  
  26. if controls.press("up") then
  27. if current==1 then current = #menu else current=current-1 end
  28. end
  29.  
  30. if controls.press("cross") then
  31.     while true do
  32.     sonido[current]:play()
  33.     imagen[current]:blit(0,0)
  34.     screen.flip()
  35.     if sonido[current]:percent()>=100 then
  36.         break
  37.     end
  38.     end
  39. end
  40.  
  41. screen.flip()
  42.  
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement