Mail Archives: djgpp/1999/04/21/17:01:22
Lark wrote:
>
> Eli Zaretskii wrote in message ...
> >
> >On Sun, 18 Apr 1999, Lark wrote:
> >
> >> How would I go about accomplishing multitasking?
> >
> >Please explain more what exactly do you mean by that. One
> >interpretation is that several programs run at the same time sharing
> >the machine resources; another interpretation is that you have several
> >threads of execution in the same program.
>
> This is more of what I had in mind, the multiple threads in the same
> program. Surely it can't be impossible. How would people make games where
> spaceships explode at the same time that other ones are still shooting, etc?
> Thanks for the feedback.
You don't need any sort of multitasking or multithreading for that.
Just:
* Figure out what ship A should do
* Figure out what ship B should do, etc.
* Put it all together
* Draw a frame to the screen.
Just because entities are doing different things at the same time
doesn't mean their controlling code is also running simultaneously or
pseudo-simultaneously.
--
Nate Eldredge
nate AT cartsys DOT com
- Raw text -