Hey Nico.. i dont know what u mean by threads ive only being only fumbling
through tutorials on the net the last couple of months. basically what i did
was use a bool to decide if the displayscore should be called at all and put
it in the explosion function. like this
if ((ship->lives < 1)&&(bScore == true))
{
bScore = DisplayScore(&theShip);
}
so even though the other functions are continually called by timer the
displayscore function only is called once then the input waits for input
while the asteroids and explosion continue in the background. it seems to be
working fine at the moment and a very simple/crude way of solving it. if
anyone knows of a more correct way to achieve this im all ears.
thanks
gav
>From: "Nico Heinze" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: [c-prog] Re: Asteroids Timer question
>Date: Mon, 09 Apr 2007 14:56:05 -0000
>
>--- In [email protected], "glogic_1" <[EMAIL PROTECTED]> wrote:
> >
> > Nevermind figured it out. i do b stuck on something for days
> > and as soon as i post here for help it comes to me! sorry
> > for wasting ur time
> > thanks
> > gav
> >
> > --- In [email protected], "glogic_1" <glogic@> wrote:
> > >
> > > hey all
> > > This time im having problems with the timer in my 2d game
> > > (Borland).
> > > (Deep breath) i use the timer to call all the functions
> > > such as update ship, update bullets, update asteroids etc
> > > etc. Then when the player loses all their lives the timer
> > > is disabled and a function that deals with the high scores
> > > is called which shows the user a input box for the players
> > > name . This works fine but what i would like is for
> > > the asteroids to be still moving in the background behind
> > > the inputbox. but if the timer is left enabled the call
> > > for the scores function is in one of the functions called
> > > in the timer and obviously enough is continously called
> > > to the screen not allowing input..
> > > how should i approach this to avoid this problem?? hope
> > > that made sense
>
>...and how have you done it?
>I'm no Windows programming expert, nor do I understand much about
>games programming, but I would have tried to perform these tasks in
>different threads, so that the scheduling of the movement of asteroids
>will not affect the thread asking for the player's name. Is that what
>you've done in the end?
>
>Just curious.
>
>Regards,
>Nico
>
_________________________________________________________________
Get a FREE Web site, company branded e-mail and more from Microsoft Office
Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/