Re: Task API

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

Robert Craig wrote:
> 
> Vincent wrote:
> > > By the way, something needed by Language War,
> > > and other games, is the ability to stop the scheduler's clock,
> > > and restart it later. In LW for instance, the user is allowed
> > > to freeze the game (to answer the phone etc.). When he resumes
> > > the game a few minutes later, it's not good for all 
> > > real-time tasks to suddenly be ready to run.
> > 
> > Would this be another routine or two? Perhaps something like task_reset()
> > and/or task_stop()?
> > 
> > > 
> > > Regards,
> > >    Rob Craig
> 
> I haven't decided.
> It could be two calls like: task_clock_stop() ... task_clock_resume()

> Or it could be one call: task_clock_shift(atom seconds)
> where the application would keep track of how many
> seconds went by while the user was on the phone,
> and tell me to shift the scheduler's clock accordingly.

I'd prefer the former. If that's chosen, then later it would
be pretty easy to add other things, like have the game clock speed
adjusted. This would give an easy way to the programmer to cater
to novice users, general slow-motion, testing, etc.

(Shifting the clock sounds dangerous! Without stop_clock still
implemented one would risk a time period "happening twice". So
that's even more reason to forget the latter alternative.)

-- Another Euphoric, since Nov. 18, 2004 --

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

Search



Quick Links

User menu

Not signed in.

Misc Menu