示例#1
0
文件: lunar.py 项目: noQ/MoonLanding
    def __init__(self, consumable=None):
        """
            Create multi rotate object lander
        """
        ship = conf.IMGS_LANDER
        self.ship_first_image = conf.IMGS_LANDER[0]
        ''' load consumable if found '''
        if consumable is not None:
            _ship = self.load_ship(consumable)
            if _ship is not None:
                ship = _ship
                self.ship_first_image = ship[0] 
                
        MultiRotated.__init__(self, filenames=ship,
                                steps=60,
                                colorkey=TRANSPARENT)

        self.path.set_restriction(speed=400)
        self.reset()
        self.fuel = ShipFuel()
        self.uprightImage = self.image
        
        self._flip_ticks = 0
        min_size = min(self.crect.h, self.crect.w)
        self.crect.h = min_size
        self.crect.w = min_size
        self.crect.inflate_ip(-4, -4)
示例#2
0
文件: lunar.py 项目: noQ/MoonLanding
 def move(self):
     """
         Move lander and cosume fuel 
     """
     ticks = conf.ticks
     if not self.landed:
         self.turn()
         self.accelerate(ticks)
         MultiRotated.move(self)
     self.fuel.burn(ticks / 30.0)
示例#3
0
文件: lunar.py 项目: noQ/MoonLanding
 def moving_on_path(self):
     self.stop_engine()
     self.flap_right_stop()
     self.flap_left_stop()
     MultiRotated.unpause(self)