| delorie.com/archives/browse.cgi | search |
| From: | "finding" <finding AT bigfoot DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: Allegro-accelerating |
| Date: | Sun, 14 Nov 1999 17:03:51 +0800 |
| Organization: | IMS Netvigator |
| Lines: | 46 |
| Message-ID: | <80ltto$43i9@imsp212.netvigator.com> |
| References: | <80k5uc$40u3 AT imsp212 DOT netvigator DOT com> <80k6pn$eni$1 AT news03 DOT btx DOT dtag DOT de> <80k92i$88q$1 AT baker DOT cc DOT tut DOT fi> <382e81ce DOT 546447 AT news> |
| NNTP-Posting-Host: | tswc5c106.netvigator.com |
| 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 |
thx....it's what i need...
exph <quake AT megsinet DOT net> wrote in message news:382e81ce DOT 546447 AT news...
> On 13 Nov 1999 18:01:54 GMT, Forsberg Sakari <zacu AT cc DOT tut DOT fi> wrote:
>
> >Raul Carolus <carolura AT luther DOT edu> wrote:
> >> be sure to call install_keyboard() before using:
> >
> >> while(keypressed())
> >> {
> >> variable++;
> >> }
> >
> >I think if you're programming a real-time game, then you
> >should use
> >
> >if ( keypressed() )
> > variable++;
> >
> >because otherwise your game stops when you are pressing a key
> >
> >** Sakari Forsberg zacu AT cc DOT tut DOT fi **
> >** Information: finger zacu AT assari DOT cc DOT tut DOT fi **
>
> Simple enough to decrease the variable when a key is not being
> pressed. Taking Sakari's example...
>
> if ( keypressed() )
> variable++;
> else
> variable--;
>
> or if you need to accelrate faster..
>
> int acc=5;
>
> if ( keypressed() )
> variable+=acc;
> else
> variable-=acc;
>
> Are you picking up what I'm putting down?
> Hope this helps.
> -exph-
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |