I'm trying to find a clever way to determine (sense) if the Sprite one pixel near 0,0 (negative direction included). I've been trying abs() and such, but cannot seem to figure it out.
When my Sprite hits 1 pixel near 0,0, I want it to perform a function (that's the easy part).
I would think that something like that would be an appropriate Sense function (with tunable variables).
Thanks.
Offline
Checking the absolute value of the sprite's X and Y will do the trick, so you're on the right track. The statement can be:
If (ABS (X) < (some number)) AND (ABS (Y) < (some number))
- Take some action
Where X and Y are the Sprite's coordinates and "some number" is whatever threshold amount you choose to call "close enough" to zero.
Offline