www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/07/13:07:34

From: "Stefan Viljoen" <rylan AT intekom DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: spawning or system for DOS game?.. help me
Date: Thu, 5 Aug 1999 16:01:19 +0300
Organization: The South African Internet Exchange
Lines: 38
Message-ID: <7ogqna$o76$1@ctb-nnrp1.saix.net>
References: <7oak28$865$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: pc36-01-p21.nt.saix.net
X-Trace: ctb-nnrp1.saix.net 934014506 24806 155.239.194.21 (7 Aug 1999 08:28:26 GMT)
X-Complaints-To: abuse AT saix DOT net
NNTP-Posting-Date: 7 Aug 1999 08:28:26 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2014.211
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

<zidharta AT geocities DOT com> wrote in message
news:7oak28$865$1 AT nnrp1 DOT deja DOT com...
> how to make my game's background move while the character move
> according to arrorw keys and sound play at the same time?
> would it be a multithreading?... how to do this in DOS?
> I know how to do each of them ... but how do I do this at once?
> spawning?.. system("start ..")? which one ?
> thanks in advance ...

I once managed something like this with no fancy stuff like you mention.
What I did was set up just one loop that has conditionals in it that key to
differrent speed allegro timers that I set up. For example, to keep the
character moving, part of my loop checked the "character timer" - when this
"ticked" I moved the character. Another kept count of how long the current
song was playing, when it ended the song length timer "ticked" and I started
up the next song in queue - etc. You can do this to the limit of the amount
of timers you are able to allocate. You can run through this loop hunderd or
thousands of times each second, the timers "ticking" at the correct pace to
keep it all looking real. If you look at any source for almost any DOS games
that you might be able to find, I think you will see that this is how
apparent "simultaneous" actions like this was carried out - everything is
actually done in sequence (HAS to be done in sequence - in a DOS system
there is usually one processor, one path to memory, one display card, etc.)
but so fast that it appears simultaneous (i. e. appears to look like
"multitasking" or multithreading).

Hope this is accurate and helped some!


--
This message courtesy of
RylanNet rylan AT intekom DOT co DOT za
http://home.intekom.com/rylan/
--
StarWars for ever!.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019