Skip to content

Instantly share code, notes, and snippets.

@SpaceVoyager
Created June 29, 2015 01:05
Show Gist options
  • Save SpaceVoyager/3b274ec4d554525596f8 to your computer and use it in GitHub Desktop.
Save SpaceVoyager/3b274ec4d554525596f8 to your computer and use it in GitHub Desktop.
maddening circles.py
from scene import *
from random import random
class MyScene (Scene):
counter = 0
centers = []
radius = 30
def setup(self):
# This will be called before the first frame is drawn.
pass
def draw(self):
self.counter = self.counter + 1
print self.counter
# This will be called for every frame (typically 60 times per second).
background(1,1,1)
# Draw a red circle for every finger that touches the screen:
fill(random(), random(), random())
for center in self.centers:
ellipse(center.x - self.radius, center.y - self.radius, self.radius*2, self.radius*2)
def touch_began(self, touch):
self.centers.append(touch.location)
def touch_moved(self, touch):
pass
def touch_ended(self, touch):
pass
run(MyScene())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment