www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/21/09:17:14

From: Michal Mertl <xmerm05 AT manes DOT vse DOT cz>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help!!! Allegro and color-things?
Date: Fri, 21 Nov 1997 14:39:03 +0100
Organization: Prague University of Economics
Lines: 28
Message-ID: <Pine.ULT.3.95.971121143330.13890A-100000@manes.vse.cz>
References: <653cea$aei$1 AT news DOT clinet DOT fi>
NNTP-Posting-Host: manes.vse.cz
Mime-Version: 1.0
In-Reply-To: <653cea$aei$1@news.clinet.fi>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Fri, 21 Nov 1997, Laine wrote:
> Here's the code, why doesn't it work?
> // The getcolor-part:
> set_palette(paletti);
> 
> get_color(224,blue);
>  get_color(225,gray);
> 
> // And the routine to change the colors:
> 
>  y=1; // This is just to know which option is selected
> 
> 
> e(!key[KEY_ESC]){  
I expect 'while' here instead of 'e'
>       if(key[KEY_UP]){
>           ++y;
<snip>
>   }
If doesn't reads the keys as they are pressed. It just looks very fast in loop
if the key is down so whenever you press it, you very fast start incrementing
y variable so soon you start to write too big/small values.
You could solve it by adding readkey() somewhere in the loop.

Michal "MiMe" Mertl
  xmerm05 AT vse DOT cz


- Raw text -


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