I am creating a real-time (more or less 24 hours=24 min) simulation game, much like an old school Tomagachi. This simulation is hugely dependent on elapsed time, as you will have to "feed" your pet every few hours or he will starve.
I understand many of the basic "timer" or "countdown" techniques available, however the difficulty is they all either pause the game, forbidding the user to interact in other ways (sleep) or they get the start/end times and if elapsed time is such and such, execute x. The second seems the best for this situation, however I can only trigger the "endtime" at the beginning of a loop. Which means that technically, the time is only ended and checked whenever a user enters that loop, which could be shorter or longer than "real-time" would allow.
Imagine the user is able to remain on a single menu. The background timer would still be counting, and if say, 10 minutes goes by, a message would be echoed and variables would change automatically (without the user doing anything).
Is this possible? Suggestions?
Help with timers in Game!
Moderator: DosItHelp
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Help with timers in Game!
Since it's a menu, you can use the choice command, which includes a timer that goes to a default value after a certain number of seconds.
-
- Expert
- Posts: 961
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: Help with timers in Game!
I think that you must use "asyncrounus input" and batch multithreading.
You can search Dbenham or Aacini threads for example on this.
Einstein1969
You can search Dbenham or Aacini threads for example on this.
Einstein1969