# Bruce Maxwell
# fall 2012
# project 6
#

import time
import graphics as gr
import multi_shape as ms

# creates a scene with several animated steam plants
def main():

    # create a window
    win = gr.GraphWin( 'Steam Plants', 600, 600 )

    # create three steam plants
    sp1 = ms.steam_init( 100, 500, 2.0 )
    sp2 = ms.steam_init( 300, 200, 0.4 )
    sp3 = ms.steam_init( 400, 300, 1.0 )

    # put all the steam plant objects in a list
    steamplants = [sp1, sp2, sp3]

    # draw all the steam plants
    for plant in steamplants:
        ms.draw( plant, win )
    
    # loop until the user clicks
    t = 0
    while True:
        time.sleep(0.25)

        # loop over the steam plant objects and animate them
        for plant in steamplants:
            ms.steam_animate( plant, t, win )

        # increment the frame counter
        t += 1

        # check for a mouse event and break if it occurs
        if win.checkMouse():
            break

    # close the window
    win.close()

    # return
    return



if __name__ == "__main__":
    main()