cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/14/21:20:20

From: visage AT yourmom DOT com (Visage)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Coding problems from an extreme C newbie...
Date: Sun, 15 Nov 1998 02:10:29 GMT
Organization: Your Mom.Com
Lines: 33
Message-ID: <364e3737.14360160@news.flash.net>
References: <199811150003 DOT AAA16294 AT remus DOT clara DOT net>
NNTP-Posting-Host: ip128.toledo2.oh.pub-ip.psi.net
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Sun, 15 Nov 1998 00:02:30 -0000, "Arthur" <arfa AT clara DOT net> wrote:

>You can't use readkey, but if the keyboard handler's installed, an external
>array is used to keep track of key presses. Try this:
>
>if(key[KEY_UP]) move_up();
>if(key[KEY_DOWN]) move_down();
>..
>and so on.

Okay, so how would I define the array? (I told you I'm a newbie. :)

>> 2. (a general coding question) How can I return back to a specific
>> point in a function? (without using GOTO of course. :))
>
>The only stylistically acceptable way of doing this is within a
>for(...;...;...){} loop, a do{}while(); loop, or a while(){}; loop. Anything
>else is generally put down to bad structure.

Sorry, misworded question on my part.  It should have read: How can I
return back to a specific point in a function AFTER calling another
function?  I.e. main() processes some stuff, calls temp(), then temp()
processes some more stuff, then returns to a point where it left off
in main().

>That's a perfectly valid method of doing it. The "dirty rectangles" method
>is sometimes quicker, although it really does depend on what your game does.

Allright.  Now can you point me in the direction of some sample dirty
rectangles code?

- Steve

- Raw text -


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