This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
class SeaCreature: | |
def __init__(self, image_name, direction, size, speed_x, y, bounds): | |
self.image_name = image_name | |
self.direction = direction | |
self.size = size | |
self.speed_x = speed_x | |
self.bounds = bounds | |
if self.direction == 'move_right': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
from random import uniform | |
bounds = None | |
class SeaCreature: | |
def __init__(self, image_name, direction, size, speed_x, y): | |
self.image_name = image_name | |
self.direction = direction | |
self.size = size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Demo code showing how to use iPad gravity sensor to control cannon orientation | |
# cannon clipart downloaded from | |
# http://www.clker.com/cliparts/7/9/9/b/1206570465701485742johnny_automatic_cannon_3.svg.med.png | |
from scene import * | |
from random import random | |
import math | |
class MyScene (Scene): | |
def setup(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cannon clipart downloaded from | |
# http://www.clker.com/cliparts/7/9/9/b/1206570465701485742johnny_automatic_cannon_3.svg.med.png | |
from scene import * | |
from random import random | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. | |
# Set up the root layer and one other layer: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from scene import * | |
import math | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. | |
# Set up the root layer | |
self.root_layer = Layer(self.bounds) | |
center = self.bounds.center() | |
self.cannon_size = 200 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cannon clipart downloaded from | |
# http://www.clker.com/cliparts/7/9/9/b/1206570465701485742johnny_automatic_cannon_3.svg.med.png | |
from scene import * | |
from random import random | |
import math | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cannon clipart downloaded from | |
# http://www.clker.com/cliparts/7/9/9/b/1206570465701485742johnny_automatic_cannon_3.svg.med.png | |
from scene import * | |
from random import random | |
import math | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cannon clipart downloaded from | |
# http://www.clker.com/cliparts/7/9/9/b/1206570465701485742johnny_automatic_cannon_3.svg.med.png | |
from scene import * | |
from random import random | |
import math | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cannon clipart downloaded from | |
# http://www.clker.com/cliparts/7/9/9/b/1206570465701485742johnny_automatic_cannon_3.svg.med.png | |
from scene import * | |
from random import random | |
import math | |
class MyScene (Scene): | |
def setup(self): | |
# This will be called before the first frame is drawn. |