#
# Butterfly
#   Fun use case for Sprite animation class
# Bryan Clair 2011
#
from cs1graphics import *
from Sprite import *

c = Canvas(500,500)
butterflyImages = [Image('images/butterfly' + str(x) + '.gif') for x in range(6)]
butterfly = Sprite(butterflyImages)
c.add(butterfly)

while True:
	e = c.wait()
	if e.getDescription() == 'mouse click':
		click = e.getMouseLocation()
		butterfly.animatedMoveTo(click.getX(),click.getY())
