Advertisement
Guest User

Untitled

a guest
Oct 25th, 2011
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. spiralx = 0
  2. spiraly = 0
  3. spiralv = 0
  4. sl = "DUST"
  5.  
  6. function tpt.drawspiral(maxspiral,spart)
  7. for i = 0, maxspiral - 1, 1 do
  8. if spiralv ~= 360 then
  9. spiralv = spiralv + 0.1
  10. elseif spiralv == 360 then
  11. spiralv = 1
  12. end
  13.  
  14. spiralx = tpt.mousex + spiralv * math.cos(math.rad(spiralv))
  15. spiraly = tpt.mousey + spiralv * math.sin(math.rad(spiralv))
  16. if spiralx > -1 and spiraly > -1 and spiralx < 612 and spiraly < 384 then tpt.create(spiralx,spiraly,spart) end
  17. end
  18. end
  19.  
  20. function spiralkeys(key,blank,blank,event)
  21. if string.upper(key) == "E" and event == 1 then
  22. tpt.drawspiral(360,sl)
  23. elseif string.upper(key) == "R" and event == 1 then
  24. spiralv = 0
  25. elseif string.upper(key) == "T" and event == 1 then
  26. sl = tpt.input("Spiral Drawing", "Input an element name to proceed")
  27. end
  28. end
  29.  
  30. tpt.register_keypress(spiralkeys)
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement