[SDL] Best way to rotate a sprite?

Tane Piper tane.piper at ukonline.co.uk
Mon Jan 27 14:35:01 PST 2003

On this note, I think your right, and I need to re-think it.  I was thinking
more 1 image which I rotate through 360-degrees, but I don't really need
more than 8, or 16 directions at the most. So basically each time I press
the left or right arrow key, it will turn the graphic 22.5 degrees, and then
make it travel along that vector for the up/down arrow keys.  If I need to I
can always make the resolution of the turn smaller to make 32 or 36
directions if needed.

Thanks guys, now I can go back to the drawing board.

Tane Piper

> Do you REALLY need 360 different angles for your images, though?
> I mean, why stop there?  Why not allow the car to move in fractions of
> Have 720 different images?  Or 1440? :^)
> For most 2D gaming purposes, 16 or even 32 or 36 different angles of your
> images is _plenty_.
> At some point, your sprite is so small that the 91 degree and 92 degree
> images of the car are indistinguishable.

More information about the SDL mailing list