def __init__(self, x, y, state=0, tabin=False): super(ShipLanded, self).__init__() self.ship = ika.Image('%s/ship/ship_hull.png' % config.image_path) self.landinggear = rip_tiles('%s/ship/ship_lgear2.png' % config.image_path, 27, 41, 8, 8)[0] #[0] just need the first image self.interior = ika.Image('%s/ship/ship_interior.png' % config.image_path) self.chair = ika.Image('%s/ship/ship_chair.png' % config.image_path) self.lgear = ika.Image('%s/ship/ship_lgear1.png' % config.image_path) self.tabby = rip_tiles('%s/ship/tab_shiplanding.png' % config.image_path, 48, 64, 4, 4) self.elevator = ika.Image('%s/ship/ship_elevator.png' % config.image_path) self.x = x self.y = y self.tabframe = 0 self.chairx = 112 self.chairy = 42 #difference to bottom, 44 pixels self.time = 0 self.tabin = tabin #is she in the ship or not? #0=not moving, no tabby, 1=going up, 2=going down, 3=tabby animation self.state = state self.chairstart = 0 self.timeleft = 0 if state == 1: self.ChairUp() elif state == 2: self.ChairDown()
def load_automap(self): self.amap=[] for y in range(self.maph): for x in range(self.mapw): tile = ika.Map.GetTile(x, y, 0) self.amap.append((0, tile)) #0 = unvisited video.clear(ika.RGB(0, 0, 64)) self.tiles = rip_tiles('%s/automap.png' % config.image_path, 8, 6, 9, ika.Map.numtiles)
def _Save(x, y, reposition=True): engine.player.state = engine.player.IdleState if reposition: engine.player.x = x + 9 engine.player.y = y engine.camera.update() saved = engine.SavePrompt() if saved: saveflash = rip_tiles("%s/save_flash.png" % config.image_path, 32, 48, 15, 15) savelight = rip_tiles("%s/savelight.png" % config.image_path, 30, 22, 15, 15) time = ika.GetTime() ticks = 0 while ticks < 165: t = ika.GetTime() while t > time: ticks += 1 time += 1 time = ika.GetTime() engine.draw() engine.hud.draw() saveflash[int(ticks / 12)].TintBlit( x - ika.Map.xwin, y - ika.Map.ywin, ika.RGB(128, 128, 128, 64), ika.AddBlend ) savelight[int(ticks / 12)].TintBlit( x - ika.Map.xwin + 1, y - ika.Map.ywin + 26, ika.RGB(128, 128, 128, 64), ika.AddBlend ) ika.Video.ShowPage() ika.Input.Update() engine.player.state = engine.player.StandState
def __init__(self, x, y): super(ShipLanding, self).__init__() self.ship = ika.Image('%s/ship/ship_hull.png' % config.image_path) self.landinggear = rip_tiles('%s/ship/ship_lgear2.png' % config.image_path, 27, 41, 8, 8) self.interior = ika.Image('%s/ship/ship_interior.png' % config.image_path) self.chair = ika.Image('%s/ship/ship_chair.png' % config.image_path) self.lgear = ika.Image('%s/ship/ship_lgear1.png' % config.image_path) self.ljet = rip_tiles('%s/ship/jet_left.png' % config.image_path, 16, 16, 3, 3) self.rjet = rip_tiles('%s/ship/jet_right.png' % config.image_path, 16, 16, 3, 3) self.tabby = ika.Image('%s/ship/ship_tabby.png' % config.image_path) self.x = x self.y = y self.geary = 0 self.gearframe = 7 self.time=0 self.jetframe=0 self.jets=True