Advertisement
ssccsscc

Tmp display

Mar 28th, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.58 KB | None | 0 0
  1. function key(a,b,c,d)
  2. if (c==1) and (a=='2') and (d==1) then
  3. if tmpdisplay==1 then
  4. tpt.log("Tmp gradient display off")
  5. tmpdisplay=0
  6. else
  7. tpt.log("Tmp gradient display on")
  8. tmpdisplay=1
  9. end
  10. end
  11. end
  12. tpt.register_keypress(key)
  13.  
  14.  
  15. function TmpDisplay()
  16. if tmpdisplay==1 then
  17. while tpt.next_getPartIndex() do
  18. local index = tpt.getPartIndex()
  19. local life = tpt.get_property("tmp", index)
  20. local col = math.ceil(math.sin(0.4*life)*100+128)
  21. tpt.drawpixel(tpt.get_property("x", index),tpt.get_property("y", index), col, col, col, 255)
  22. end
  23. end
  24. end
  25. tpt.register_step(TmpDisplay)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement