Skip to content

Instantly share code, notes, and snippets.

@SpaceVoyager
Created July 30, 2015 00:04
Show Gist options
  • Save SpaceVoyager/7b9e14d605f80747e028 to your computer and use it in GitHub Desktop.
Save SpaceVoyager/7b9e14d605f80747e028 to your computer and use it in GitHub Desktop.
aquarium1.py
from scene import *
class MyScene (Scene):
def setup(self):
# This will be called before the first frame is drawn.
self.fishx = self.bounds.w
self.fishspeed = 3
self.fishsize = 200
def draw(self):
# This will be called for every frame (typically 60 times per second).
background(0.00, 1.00, 1.00)
self.fishx -= self.fishspeed
if self.fishx <= -self.fishsize:
self.fishx = self.bounds.w
image('Fish', self.fishx, 100, self.fishsize, self.fishsize)
def touch_began(self, touch):
pass
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