Mail Archives: djgpp/1998/11/23/19:40:15
On Mon, 23 Nov 1998 23:06:11 -0000, "Arthur" <arfa AT clara DOT net> 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
- Raw text -