DOUBLE EDIT: what should i do for collision detection? is there a better method than progressional pixel testing?
I use a hackish radial-distance method for collisions in Embers - I pretend every enemy and item exists within a diamond given by distance=distancex+distancey, which is basically a optimal corruption of pythagorean distance=root(dx^2+dy^2). It's not as graphically perfect as using pixel masks but it sure is a hell of a lot faster.
Ok, in basic if i want to do that, i just do:
:root(abs(A-X)^2 + abs(B-Y)^2 -> C
:if C=1 or C=root(2
:then
:commands
:end
Where A and B are the coordinates of the (point or object) thats it collided with
And X and Y are the 'players' coordinates
Checking for root(2 is for diagonal collision and checkig the 1 is for checking for horizontal or vertical collision
This methode is just for 1 pixel colliding with 1 pixel, so much more checks would be nescessary for larger objects, i know this is an axe-topic but maybe you now have a simple idea of pythagoras?
Edit: this was meant for shmibs, not for squidget, the quote was just to tell that squidget is right about this being a good way
Edit2: ps: correct me if i'm wrong