# Examples of using graphics

from zellegraphics import *
import time
 
win = GraphWin('Our First Graphics Demo' , 700, 500)
line = Line(Point(20, 30), Point(300, 490))
line.draw(win)

thickLine = Line(Point(30, 490), Point(200, 30))
thickLine.setWidth(5)
thickLine.setOutline('red')
thickLine.draw(win)

(Line(Point(200, 230), Point(500, 230))).draw(win)

Circle(Point(500, 100), 70).draw(win)

rectangle = Rectangle(Point(350, 450), Point(400, 500))
rectangle.setFill('green')
rectangle.draw(win)

for offset in range(20):
    orangeLine = Line(Point(200 - 6* offset, 100 + 8* offset),
                      Point(50 - 6* offset, 50 + 8* offset))
    orangeLine.setOutline(color_rgb(255, 150, 0))
    orangeLine.setWidth(3)
    orangeLine.draw(win)

for i in range(300):
    rectangle.move(1, -1)
    time.sleep(0.01)


time.sleep(5)
win.close()