Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spiralx = 0
- spiraly = 0
- spiralv = 0
- sl = "DUST"
- function tpt.drawspiral(maxspiral,spart)
- for i = 0, maxspiral - 1, 1 do
- if spiralv ~= 360 then
- spiralv = spiralv + 0.1
- elseif spiralv == 360 then
- spiralv = 1
- end
- spiralx = tpt.mousex + spiralv * math.cos(math.rad(spiralv))
- spiraly = tpt.mousey + spiralv * math.sin(math.rad(spiralv))
- if spiralx > -1 and spiraly > -1 and spiralx < 612 and spiraly < 384 then tpt.create(spiralx,spiraly,spart) end
- end
- end
- function spiralkeys(key,blank,blank,event)
- if string.upper(key) == "E" and event == 1 then
- tpt.drawspiral(360,sl)
- elseif string.upper(key) == "R" and event == 1 then
- spiralv = 0
- elseif string.upper(key) == "T" and event == 1 then
- sl = tpt.input("Spiral Drawing", "Input an element name to proceed")
- end
- end
- tpt.register_keypress(spiralkeys)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement