Advertisement
Raplyk

Junção de particulas.

Jun 17th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.73 KB | None | 0 0
  1. ANTES
  2.  
  3.  
  4.  
  5.  
  6.  
  7. -- Preencher a tabela
  8.  
  9. local toFill = 2000 -- 2000 "abaixadas"
  10. local current = 0
  11.  
  12. local update = function()
  13. current = current + 1
  14.  
  15. local w = math.min(180, current * (200 / toFill))
  16.  
  17. ui.addTextArea(0, "", nil, 5, 28, 180 , 15, 0x767676, 1, 1, true)
  18. ui.addTextArea(1, "", nil, 5, 28, w, 15, 0x00FFB1, 1, 1, true)
  19.  
  20. if w == 200 then
  21. print("Venceu!")
  22. end
  23. end
  24.  
  25. eventNewGame = function()
  26. for k, v in next, tfm.get.room.playerList do
  27. system.bindKeyboard(k, 3, true, true)
  28. end
  29. end
  30.  
  31. eventKeyboard = function(n, k)
  32. if not tfm.get.room.playerList[n].isDead and k == 3 then
  33. update()
  34. end
  35. end
  36.  
  37. -- Chuva temporal
  38.  
  39. function eventLoop()
  40. for k = 250,50,-1 do
  41. tfm.exec.displayParticle(14,math.random(0,800),math.random(500),0,math.random(1.1),0,math.random(0.22))
  42. end
  43. end
  44.  
  45.  
  46.  
  47.  
  48. DEPOIS
  49.  
  50.  
  51.  
  52.  
  53. -- Preencher a tabela
  54.  
  55. local toFill = 2000 -- 2000 "abaixadas"
  56. local current = 0
  57.  
  58. local update = function()
  59. current = current + 1
  60.  
  61. local w = math.min(180, current * (200 / toFill))
  62.  
  63. ui.addTextArea(0, "", nil, 5, 28, 180 , 15, 0x767676, 1, 1, true)
  64. ui.addTextArea(1, "", nil, 5, 28, w, 15, 0x00FFB1, 1, 1, true)
  65.  
  66. if w == 200 then
  67. print("Venceu!")
  68. end
  69. end
  70.  
  71. eventNewGame = function()
  72. for k, v in next, tfm.get.room.playerList do
  73. system.bindKeyboard(k, 3, true, true)
  74. end
  75. end
  76.  
  77. eventKeyboard = function(n, k)
  78. print(k)
  79. if not tfm.get.room.playerList[n].isDead and k == 3 then
  80. update()
  81. end
  82. end
  83.  
  84. -- Chuva temporal
  85.  
  86. function eventLoop()
  87. for k = 250,50,-1 do
  88. tfm.exec.displayParticle(14,math.random(0,800),math.random(500),0,math.random(1.1),0,math.random(0.22))
  89. end
  90. end
  91.  
  92. tfm.exec.newGame(0)
  93. tfm.exec.disableAutoNewGame(true)
  94.  
  95.  
  96.  
  97.  
  98.  
  99. APENAS ADICIONE
  100.  
  101.  
  102.  
  103.  
  104. tfm.exec.newGame(0)
  105. tfm.exec.disableAutoNewGame(true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement