Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.90 KB | None | 0 0
  1. fog = image.load("fog_a.png")
  2. fondo = image.load("Fondos/FONDO3.png")
  3. Boton = image.load ("botones/boton.png")
  4. salida = image.load ("Fondos/salida.png")
  5. fondo2 = image.load ("Fondos/FONDO2.png")
  6. upPressed = image.load("Botones/up.png")
  7. downPressed = image.load("Botones/donw.png")
  8. leftPressed = image.load("Botones/left.png")
  9. rightPressed = image.load("Botones/rigth.png")
  10. LPressed = image.load("Botones/l.png")
  11. crossPressed = image.load("Botones/cross.png")
  12. trianglePressed = image.load("Botones/triangle.png")
  13. squarePressed = image.load("Botones/square.png")
  14. circlePressed = image.load("Botones/circle.png")
  15. RPressed = image.load("Botones/R.png")
  16. velocidad_fog = 0.4;
  17. posicion_fog = 480;
  18. ctrl=true
  19. function pintarfog()
  20. posicion_fog = posicion_fog - velocidad_fog;
  21. if ( posicion_fog <= 0 ) then posicion_fog = 480
  22. end
  23. image.blit(fog,math.ceil(posicion_fog),0)
  24. image.blit(fog,math.ceil(posicion_fog)-480,0)
  25. end
  26. while (ctrl==true) do
  27. controls.read()
  28. pintarfog()
  29. image.blit(fondo,0,0)
  30. screen.flip()
  31. if controls.start() then
  32. ctrl=false            
  33. end
  34. end
  35. while true do
  36. screen.clear()
  37. image.blit(fondo2,0,0)
  38. controls.read()
  39. if controls.up() then
  40. image.blit(120,50,upPressed)
  41. end
  42. if controls.down() then
  43. image.blit(120,50,downPressed)
  44. end
  45. if controls.left() then
  46. image.blit(120,50,leftPressed)
  47. end
  48. if controls.right() then
  49. image.blit(120,50,rightPressed)
  50. end
  51. if controls.l() then
  52. image.blit(120,50,LPressed)
  53. end
  54. if controls.cross() then
  55. image.blit(120,50,crossPressed)
  56. end
  57. if controls.triangle() then
  58. image.blit(120,50,trianglePressed)
  59. end
  60. if controls.square() then
  61. image.blit(120,50,squarePressed)
  62. end
  63. if controls.circle() then
  64. image.blit(120,50,circlePressed)
  65. end
  66. if controls.r() then
  67. image.blit(120,50,RPressed)
  68. end
  69. if controls.select() then
  70. screen.clear ()
  71. image.blit(salida,0,0)  
  72. screen.flip()
  73. screen.waitvblankstart(100)
  74. os.exit()
  75. end
  76. screen.flip()
  77. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement