def move(self): ''' alien ship is moving on screen and drop fuel to help us to land on the moon (or bomb to distory us ) ''' if not self.object_dropped: if self.path.approach: self.object_dropped = 1 elif not self.is_on_screen(100): self.reset() Image.move(self)
def create_earth(self): """ create earth from image. set random position for this element """ planet_img = None choice = random.randrange(1, 20) if choice <= 10: planet_img = conf.IMG_PLANETS[0] else: planet_img = conf.IMG_PLANETS[1] img = Image(filename=planet_img) img.set_random_position() ''' draw image on screen ''' earth = StaticObject(self.window, img) earth.draw()
def __init__(self, filename, pos): img = Image(filename=filename, colorkey=TRANSPARENT2) img.set_position(pos) StaticObject.__init__(self, sprite=img) self.draw()
def __init__(self): Image.__init__(self, filename=conf.IMG_GIFT) obj_path = AccelerationPath(startLocation=(-100,-100)) self.set_path(obj_path) self.path.set_gravity(0, 0.00013) self.bomb = False
def __init__(self): Image.__init__(self, filename=conf.IMG_ALIEN_SHIP) self.set_position(-90, -90) self.object_dropped = 0 self.set_path(AlienShipPath())