The click variable is meant to go up by one everytime I click the button. What do I do?. :(
Thanks in advance!
Here's the code:
from scene import *
from PIL import Image
clicks = 0
class JitterClick(Scene):
def setup(self):
self.button = Button(Rect(self.size.w/2-100, self.size.h/2-140, 200, 200))
self.button.background = Color(0,0,0)
self.button.stroke = Color(0,0,0)
self.button.image = 'Red_Circle'
self.button.action = self.add_clicks
def add_clicks(sender):
global clicks
clicks += 1
def draw(self):
self.button.draw()
text('Clicks: %i' % clicks, x=self.size.w/2, y=self.size.h/4*3, font_size=64)
run(JitterClick())