From: visage AT yourmom DOT com (Visage) Newsgroups: comp.os.msdos.djgpp Subject: Re: More help with Allegro Date: Tue, 24 Nov 1998 00:35:21 GMT Organization: Your Mom.Com Lines: 28 Message-ID: <3659fe6d.240558@news.flash.net> References: <199811232307 DOT XAA25337 AT remus DOT clara DOT net> NNTP-Posting-Host: ip54.toledo5.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 Mon, 23 Nov 1998 23:06:11 -0000, "Arthur" wrote: >> I'm using DJGPP & Allegro and am currently trying to code a puzzle >> game. The main screen is comprised of a 9x9 sprite grid. I have a >> way to access all of the coordinates, but I'm still wondering how to >> get the program to check when the cursor is at a border of the screen. [code snipped] >This is one easy way of doing it. If the function returns 0, then no border >is touched by the mouse. If 1, then left border, 2 then right border etc. > >This is a very simple method and there are far more elegant ways of doing >it. Well, this looks like a good solution for the mouse, but what if I'm just using the keyboard? I.e., check for sprite positions? Well, I know how to do this already, but like I said, I don't want to write 81 functions (even though I could, and anyone who didn't have the source would never know..tee hee) Yeah..doing it with the mouse is easy, since Allegro has a function (I think) to only let the mouse move within a certain area of the screen anyway, but how would I do it with the keyboard? (If you want me to send you a sample screenshot of what I'm talking about, just ask.) - Steve