Ejemplo n.º 1
0
def mapSwitch(mapName,
              x,
              y,
              layerNum=None,
              fadeOut=False,
              fadeIn=False,
              fade=True):
    global player

    if fade or fadeOut:
        effects.fadeOut(50)

    if player is not None:
        player.x = x
        player.y = y

    ika.Map.Switch(mapName)

    if player is not None:
        if layerNum is None:
            lay = ika.Map.GetMetaData().get('entitylayer')
            if lay is not None:
                lay = ika.Map.FindLayerByName(lay)
            player.layer = lay

        else:
            player.layer = layerNum

    if fade or fadeIn:
        effects.fadeIn(50)
Ejemplo n.º 2
0
def goodNight(): #stay at an inn!
    engine.beginCutScene()
    sound.fader.playandresume(sound.music['sleep'], 250000)    
    effects.fadeOut(100, draw=engine.raw_draw)    
    delay(300, drawfunc='blank')    
    effects.fadeIn(100, draw=engine.raw_draw)
    engine.endCutScene()
    engine.player.stats.hp = engine.player.stats.maxhp
Ejemplo n.º 3
0
def warp(x, y, layerNum = None, fadeOut = False, fadeIn = False, fade = False):
    if fade or fadeOut:
        effects.fadeOut(50)

    player.x = x
    player.y = y
    if layerNum is not None:
        player.layer = layerNum

    if fade or fadeIn:
        effects.fadeIn(50)
Ejemplo n.º 4
0
def warp(x, y, layerNum = None, fadeOut = False, fadeIn = False, fade = False):
    global player

    if fade or fadeOut:
        effects.fadeOut(50)

    player.x = x
    player.y = y
    if layerNum is not None:
        player.layer = layerNum

    if fade or fadeIn:
        effects.fadeIn(50)
Ejemplo n.º 5
0
def mapSwitch(mapName, x, y, layerNum = None, fadeOut = False, fadeIn = False, fade = False):
    if fade or fadeOut:
        effects.fadeOut(50)

    ika.Map.Switch(mapName)
    if player is not None:
        player.x = x
        player.y = y

        if layerNum is None:
            player.layer = ika.Map.GetMetaData().get('entitylayer', 0)
        else:
            player.layer = layerNum

    if fade or fadeIn:
        effects.fadeIn(50)
Ejemplo n.º 6
0
    def update(self):
        self.animate()

        t = self.touches(engine.player)
        if t and not self.isTouching:
            # bump the player backward, so he's not touching us anymore.
            effects.fadeOut(50, draw=engine.raw_draw)
            engine.player.stats.hp = 999
            engine.player.stats.mp = 999
            dx, dy = dir.delta[dir.invert[engine.player.direction]]
            engine.player.x += dx * 3
            engine.player.y += dy * 3
            # TODO: neato fadeout, etc.
            # "Do you wish to save?" "Yes/No"
            self.isTouching = True
            engine.raw_draw()
            saveloadmenu.saveMenu()
            effects.fadeIn(50, draw=engine.raw_draw)
            engine.synchTime()
        elif not t:
            self.isTouching = False
Ejemplo n.º 7
0
def scene(name):
    global grandpa, kid1, kid2, kid3
    savedPos = [(e.x, e.y) for e in engine.entities]
    # hide 'em all
    for e in engine.entities:
        e.x, e.y = -100, -100
    ika.Map.Switch('%s/cabinmap.ika-map' % config.MAP_PATH)
    grandpa = ika.Map.entities['grandpa']
    kid1 = ika.Map.entities['kid1']
    kid2 = ika.Map.entities['kid2']
    kid3 = ika.Map.entities['kid3']
    effects.fadeIn(100)
    _scenes[name]()
    engine.saveData['name'] = 'True'
    effects.fadeOut(100)
    grandpa = kid1 = kid2 = kid3 = None
    # FIXME? AutoExec will be called when you do this!
    if engine.mapName:
        ika.Map.Switch('maps/' + engine.mapName)
        for e, pos in zip(engine.entities, savedPos):
            e.x, e.y = pos
Ejemplo n.º 8
0
def saveMenu():
    title = TextFrame(text='Save Game')
    title.position = (16, 16)
    saves = readSaves()
    m = SaveLoadMenu(saves, saving=True)

    def draw():
        ika.Video.ClearScreen()  # fix this
        m.draw()
        title.draw()

    effects.fadeIn(50, draw=draw)
    i = None
    while i is None:
        i = m.update()
        draw()
        ika.Video.ShowPage()

    if i is not Cancel:
        s = SaveGame.currentGame()
        s.save('save%i' % i)

    effects.fadeOut(50, draw=draw)
Ejemplo n.º 9
0
def mapSwitch(mapName, x, y, layerNum = None, fadeOut = False, fadeIn = False, fade = True):
    global player

    if fade or fadeOut:
        effects.fadeOut(50)

    if player is not None:
        player.x = x
        player.y = y

    ika.Map.Switch(mapName)

    if player is not None:
        if layerNum is None:
            lay = ika.Map.GetMetaData().get('entitylayer')
            if lay is not None:
                lay = ika.Map.FindLayerByName(lay)
            player.layer = lay

        else:
            player.layer = layerNum

    if fade or fadeIn:
        effects.fadeIn(50)
Ejemplo n.º 10
0
def loadMenu(fadeOut=True):
    title = TextFrame(text='Load Game')
    title.position = (16, 16)
    saves = readSaves()
    m = SaveLoadMenu(saves, saving=False)

    def draw():
        ika.Video.ClearScreen()  # fix this
        m.draw()
        title.draw()

    effects.fadeIn(50, draw=draw)
    i = None
    while i is None:
        i = m.update()
        draw()
        ika.Video.ShowPage()

    if fadeOut:
        effects.fadeOut(50, draw=draw)

    draw()
    if i is not Cancel and i < len(saves):
        return saves[i]
Ejemplo n.º 11
0
def fadeIn():
    effects.fadeIn()
    return redirect("/", code=302)