Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
In-game timer
#1
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!
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply
#2
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:
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#3
yeah, especially if it's MY game Big Grin
ovaProgramming.

One night I had a dream where I was breaking balls. The next morning, BALLSBREAKER was born.

Quote: Excellent. Now you can have things without paying for them.

BALLSBREAKER 2
~-_-Status Report-_-~
Engine: 94%
Graphics: 95%
Sound: 100%
A Severe Error has crippled BB2 for the time being... I have to figure it out, but until then you won't see much of it Sad.
-----------------------------
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)