My code so far - i'm very new to coding ๐ . The goal is that the light (circle, very primative) turns on and off at a mouse click. Currently it goes goes from On to Off, but not back On... ideas?
LightON = True
LightOFF = False
diameter = 50
x = 75
y = 75
def setup():
background(100)
size(400,400)
def draw():
background(100)
global LightON, LightOFF
noStroke()
fill(255,255,0)
ellipse(100,50,diameter,diameter)
if LightON:
fill(255,255,0)
ellipse(100,50,diameter,diameter)
if LightOFF:
fill(0,0,0)
ellipse(100,50,diameter,diameter)
def mouseClicked():
global LightON, LightOFF, x, y
x = mouseX
y = mouseY
if dist(100,50,mouseX,mouseY) < diameter/2:
LightOFF = True
LightON = False