Re: Time System & Day & Night

new topic     » goto parent     » topic index » view thread      » older message » newer message

Andy wrote:
> 
> Well I haven't started on the game yet. I just want a game clock, that counts
> the seconds, minutes, and hours. I need to be something like this.
> 
> 00:00 like that and it would count and so on.

You still need to establish a lot more information. DOS? Linux? Windows-based?
Cross platform?

I guess somebody could make a generic timing lib that simply output a time for
you. It would need something like this:

type time_sequence(sequence s)
  return length(s) = 6
end type

time_sequence time_now
   time_now = date()

procedure run_clock(time_sequence s)
   -- start the clock advances at the set interval
   -- s will be a sequence indicating how quickly to advance each interval
   -- in one second. for instance, {0,0,1,0,0,0} means time advances one
   -- day (24 hours) in each second of real time
   -- use {0,0,0,0,0,0} to stop the clock
end procedure

procedure set_clock(time_sequence time_to_use)
  time_now = time_to_use
end procedure

function get_time()
  return time_now
end function

I don't know how to set up the threaded stuff so that the timer advances
but allows other funcs/procs to do their thing.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu