To calculate the angle/slope between 2 points you use Atan2(y,x); angle = Atan2(y2 - y1, x2 - x1);
Be advised that you might need to swap 1 and 2 around or negate values depending if the positive Y axis goes upwards or downwards. Well if things are off you'll see immediately on your sprite rotation. You need to see visually if the calculated angle is correct, right?
Also you need to check if your math functions work in Radians or Degrees ("one radian is just under 57.3 degrees").
Its quite possible the math functions output radians but the rendering functions for sprite angles take degrees so you'd need to convert between them.
Btw in the classics, the angles for the tiles are preset in the data, they are not computed on the fly.
Hope this helps.
This post has been edited by winterhell: 14 November 2015 - 03:31 AM