Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- from scene import *
- class MyScene (Scene):
- def setup(self):
- # This will be called before the first frame is drawn.
- pass
- def draw(self):
- # This will be called for every frame (typically 60 times per second).
- background(0, 0, 255)
- # Draw a red circle for every finger that touches the screen:
- for touch in self.touches.values():
- fill(random.random(), random.random(), random.random())
- rect(touch.location.x + 100, touch.location.y + 50, 50, 50)
- fill(random.random(), random.random(), random.random())
- rect(touch.location.x + 100, touch.location.y + 50, 50, 100)
- fill(random.random(), random.random(), random.random())
- rect(touch.location.x + 100, touch.location.y + 200, 50, 50)
- def touch_began(self, touch):
- pass
- def touch_moved(self, touch):
- pass
- def touch_ended(self, touch):
- pass
- run(MyScene())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement