# sequence2.py
from Processing import *

# Load all images
images = []
for i in range(1, 16):
    fileName = "images/horse" + str(i) + ".gif"
    img = loadImage( fileName )
    images.append( img )

# Open a window
window( 800, 135 )

x = 0

# Draw all images to window in sequence
while not isMousePressed():

    # Repeatedly display all images in list
    for i in range(15):
        background(230);        # Clear background
        img = images[i]         # Draw image
        image( img, x, 0)
        x = (x + 20) % width()  # Update position
        delay(60)

# Exit the window and stop the program
exit()
