Robonado

Desenho de Partículas

Apr 30th, 2015
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. coord, nome= {}, 'Robonado';
  2. main= system.bindMouse(nome) or table.foreach({string.byte('C'), 8}, function(o,p) system.bindKeyboard(nome, p, false) end);
  3.  
  4. function eventMouse(p, w, h)
  5.     coord[#coord+1]= { x= w; y= h; };
  6. end
  7.  
  8. function eventLoop()
  9.     a= #coord > 0 and table.foreachi(coord, function(g) tfm.exec.displayParticle(9, coord[g].x, coord[g].y, 0, 0, 0, 0, NIL) end);
  10. end
  11.  
  12. function eventKeyboard(p, id)
  13.     coord= id == 8 and table.remove(coord) and coord or {}; -- 'C' remove todas as partículas e 'Backspace' remove a última...
  14. end
Advertisement
Add Comment
Please, Sign In to add comment