0 Members and 2 Guests are viewing this topic.
I'm not sure I exactly understand what exactly you are trying to do, but why couldn't you just divide your Y's by your X's. That's what you do in math and division is relatively quick. If you need decimal places, you can just tack on an extra byte to your Y values and your final result will have 1 extra byte of decimals.
What exactly do you need the slope for? Because line drawing algorithms, for instance, don't actually need a numerical slope value. They just use dy and dx as-is without having to divide one by the other.
So you are looking to see if the player can see the enemy or vica verse?
So just use a line-drawing algorithm with pixel-test instead of pixel-on?