<reponame>Ethan-Barr/Python-figet-spinner
#Module Imports 
from turtle import *

#Variables
rotate= {'turn': 0}



#DEF  
def spinner():
    clear()
    angle = rotate['turn'] / 10
    right(angle)
    forward(100)
    dot(120, 'red')
    back(100)
    right(120)
    forward(100)
    dot(120, 'green')
    back(100)
    right(120)
    forward(100)
    dot(120, 'blue')
    back(100)
    right(120)
    update()

def animate():
    if rotate['turn'] > 0:
        rotate['turn'] -= 1

    spinner()
    ontimer(animate, 20)

def click():
    rotate['turn'] += 10

    
    
#Main script
setup(420, 420, 370, 0)
hideturtle()
tracer(False)
width(20)
onkey(click, 'space')
listen()
animate()
done()
