Ejemplo n.º 1
0
    def mapscreen(self):
        time = ika.GetTime()
        ika.Input.Unpress()
        ika.Input.Update()
        scrolltime = 0
        while not (controls.cancel.Pressed() or controls.confirm.Pressed()):
            t = ika.GetTime()
            while t > time:
                time += 1
                engine.ticks += 1
                if scrolltime > 0:
                    scrolltime -= 1
            engine.update_time()
            self.draw_menu()
            print >> fonts.two(160, 30, align='center'), self.mapname
            engine.automap.draw_automap(self.mapx, self.mapy)
            c1 = ika.RGB(0, 200, 255, 200)
            c2 = ika.RGB(200, 200, 255, 200)

            #scroll triangles
            if self.mapx > 0:
                ika.Video.DrawTriangle((10, 100, c1), (20, 90, c2),
                                       (20, 110, c2))
            if self.mapx + 37 < 50:
                ika.Video.DrawTriangle((310, 100, c1), (300, 90, c2),
                                       (300, 110, c2))
            if self.mapy > 0:
                ika.Video.DrawTriangle((160, 40, c1), (150, 50, c2),
                                       (170, 50, c2))
            if self.mapy + 23 < 50:
                ika.Video.DrawTriangle((160, 185, c1), (150, 175, c2),
                                       (170, 175, c2))
            ika.Video.ShowPage()
            ika.Input.Update()
            if scrolltime == 0:
                if controls.right.Position() > controls.deadzone and self.mapx + 37 < 50:
                    self.mapx += 1
                    scrolltime = 5
                elif controls.left.Position() > controls.deadzone and self.mapx > 0:
                    self.mapx -= 1
                    scrolltime = 5
                elif controls.down.Position() > controls.deadzone and self.mapy + 23 < 50:
                    self.mapy += 1
                    scrolltime = 5
                elif controls.up.Position() > controls.deadzone and self.mapy > 0:
                    self.mapy -= 1
                    scrolltime = 5
Ejemplo n.º 2
0
    def draw_menu(self): #main menu draw
        #ika.Video.Blit(self.face, 11, 25)
        ika.Map.Render()
        ika.Video.Blit(self.menu1, 0, 0)
        ika.Video.Blit(self.menu3, 0, 190)
        ika.Video.Blit(self.menu4, 100, 190)

        if self.menuselected == 0: #map
           ika.Video.Blit(self.mapw, 0, 22)
           print >> fonts.two(160, 30, align='center'), self.mapname
           engine.automap.draw_automap(self.mapx, self.mapy)
        else:
           ika.Video.Blit(self.menu2, 0, 22)
           if self.menuselected == 3: #control config
                self.draw_options()
           if self.menuselected == 4: #quit
               print >> fonts.one(50, 100), "Press "+controls.confirm.buttons['key'].value+" to quit the game."

        x = 10
        y = 10
        for i, option in enumerate(self.options):
            #if option in self.enabled:
            #    if i == self.menuselected:
            #        f = fonts.three
            #    else: f = fonts.two
            #else:
            #    f = fonts.five
            f = [fonts.five, fonts.two][option in self.enabled]
            f = [f, fonts.three][i == self.menuselected]
            print >> f(x, y), option
            x += (len(option) + 1) * 10

        print >> fonts.one(10, 200), 'HEALTH'
        print >> fonts.tiny(40, 208), '%i/%i' % (engine.player.hp,
                                                 engine.player.maxhp)
        print >> fonts.one(10, 216), 'ENERGY'
        print >> fonts.tiny(40, 224), '%i/%i' % (engine.player.mp,
                                                 engine.player.maxmp)
        print >> fonts.one(105, 200), 'TIME:', engine.time