From: Michal Mertl 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: References: <653cea$aei$1 AT news DOT clinet DOT fi> NNTP-Posting-Host: manes.vse.cz Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <653cea$aei$1@news.clinet.fi> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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; > } 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