inside_box (solved)
Gah.
Say I created a box with inside_box. &box = inside_box(&dx, &dy, blabla); It returns 1 when &dx and &dy is inside the box and 0 if it is not. Simple.
Can I make use of inside_box to check whenever &dx, &dy (Dink) leaves the box? I'm thinking too wildly with a loop that checks the position of Dink constantly and having some plans with if(&box == 1) and if(&box == 0) within touch(void) but I can't get it to work.
Or even better, being able to check when Dink enters or leaves a sprite. Can it be done? Think pressure plate that is active (1) when Dink is standing on it and when Dink leaves it, it deactivates (0).
Say I created a box with inside_box. &box = inside_box(&dx, &dy, blabla); It returns 1 when &dx and &dy is inside the box and 0 if it is not. Simple.
Can I make use of inside_box to check whenever &dx, &dy (Dink) leaves the box? I'm thinking too wildly with a loop that checks the position of Dink constantly and having some plans with if(&box == 1) and if(&box == 0) within touch(void) but I can't get it to work.
Or even better, being able to check when Dink enters or leaves a sprite. Can it be done? Think pressure plate that is active (1) when Dink is standing on it and when Dink leaves it, it deactivates (0).
That's what the button-brain is all about. "void buttonon( void )" is triggered when sprite 1 (= Dink in-game, but the mouse on the title screen) steps on it, "void buttonoff( void )" is triggered when Dink (or the mouse) leaves it. Yes, it only works for Dink, other sprites need other tricks, if you ever need that kind of functionality.