# splitEllipse1.py
from Processing import *

window(500, 500)

def drawEllipse(o, e):
    fill(0, 255, 0)             # Set green fill
    x, y = mouseX(), mouseY()   # Mouse position
    w, h = width(), height()    # Window size
    if x < 0.5*w:               # Change fill on left half
        fill(255, 0, 0)
    ellipse(x, y, 30, 30)

onMousePressed += drawEllipse
