The Dink Network

inside_box (solved)

January 5th 2014, 02:02 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
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).
January 5th 2014, 02:13 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
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.
January 5th 2014, 02:36 PM
dragon.gif
Quiztis
Peasant He/Him Sweden bloop
Life? What's that? Can I download it?! 
I will look into this, thank you good sir!

I have wasted a considerable amount of time.