Beispiel #1
0
def RunGame():
    global drawList
    global updateList
    last_update = 0

    while 1:
        if ika.GetTime() > last_update:
            global last_fps

            last_update = ika.GetTime() + 1

            if last_fps != ika.GetFrameRate():
                ika.SetCaption("Bergbau (FPS: " + str(ika.GetFrameRate()) +
                               ")")
                last_fps = ika.GetFrameRate()

            ika.Input.Update()
            #update shit
            for updateable in updateList:
                updateable.Update()

            #ika.ProcessEntities()

        ika.Render()
        #draw shit
        for drawable in drawList:
            drawable.Draw()

        ika.Video.ShowPage()
Beispiel #2
0
def mainloop():
    last_update = 0
    last_update2 = 0
    while 1:

        if ika.GetTime() > last_update:
            global last_fps

            last_update = ika.GetTime() + 10
            """ from hawk's code"""
            if last_fps != ika.GetFrameRate():
                ika.SetCaption("Tropfsteinhoehle (FPS: " +
                               str(ika.GetFrameRate()) + ")")
                last_fps = ika.GetFrameRate()

            ika.Input.Update()
            manager.globalupdate()
            ika.ProcessEntities()

        if ika.GetTime() > last_update2:
            ika.Render()
            manager.globalrender()

            ika.Video.ShowPage()

            last_update2 = ika.GetTime() + 1
Beispiel #3
0
def mainloop():
    last_update = 0
    last_update2 = 0
    while 1:

        if ika.GetTime() > last_update:
            global last_fps

            last_update = ika.GetTime() + 1

            # from hawk's code
            if last_fps != ika.GetFrameRate():
                ika.SetCaption("'Duo' (FPS: " + str(ika.GetFrameRate()) + ")")
                last_fps = ika.GetFrameRate()

            ika.Input.Update()
            manager.globalupdate()
            ika.ProcessEntities()

        #note: get rid of last_update2 and functionality for better performace (combine with last_update1 or drop if FPS low)
        if ika.GetTime() >= last_update2:
            ika.Render()
            manager.globalrender()

            ika.Video.ShowPage()

            last_update2 = ika.GetTime() + 1
Beispiel #4
0
    def MainLoop(self):
        while 1:

            if ika.GetTime() >= self.lastUpdate:

                self.lastUpdate = ika.GetTime()

                if self.lastFPS != ika.GetFrameRate():

                    self.lastFPS = ika.GetFrameRate()
                    #ika.SetCaption(str(self.LastFPS))

                ika.Input.Update()

                self.Update()

                self.currentFrame += 1
                if self.currentFrame > 60:
                    self.currentFrame = 0

                self.lastUpdate = ika.GetTime() + 1

            #print "%s - %s" %(ika.GetTime(), self.CurrentFrame)

            self.fpsManager.render(self.Draw)
Beispiel #5
0
def MainLoop():
    last_update = 0

    while 1:
        if ika.GetTime() > last_update + 1:
            last_update = ika.GetTime()

            global last_fps

            if last_fps != ika.GetFrameRate():
                ika.SetCaption(str("Trauzl    FPS(" + str(last_fps) + ")"))
                last_fps = ika.GetFrameRate()

            ika.Input.Update()
            manager.Update()

            last_update = ika.GetTime() + 1

        ##will need to remove this when outputting map layer by layer in Manager
        ika.Render()  #map
        #fpsManager.Render(manager.Render)
        manager.Render()

        ika.Video.ShowPage()
Beispiel #6
0
def hook():
    gui.default_font.Print(0, 280, 'FPS: %i' % ika.GetFrameRate())