Qbasicnews.com

Full Version: In-game timer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am in the process of re-doing my Qbasic RPG (Mokli: Quest for the Gems) and I was wondering if it were possible to make an in-game timer... you know, like they have on Final Fantasy or something, that tells you how long you've played? I've messed around with the TIMER function, but haven't gotten it to work quite right... Any help would be appreciated, thanks!
Indeed, TIMER can be counter-intuitive. Here's a timer routine. It checks if a full second has past, and if so, updates the timer output.
Code:
t!=TIMER
DO
    IF TIMER - t! >= 1 THEN
        elapsed=elapsed + 1
        LOCATE 1,1: PRINT elapsed
        t!=TIMER
    END IF
LOOP
Of course, if the user is playing when the clock strikes midnight then the timer will be screwed up. But just trust that nobody is a nerd enough to be playing a game through midnight. :wink:
yeah, especially if it's MY game Big Grin