[SDL] Best way to rotate a sprite?
tane.piper at ukonline.co.uk
Sun Jan 26 10:30:01 PST 2003
At the moment, I am using a rather dodgy control method in my game where the direction button changes the sprite on screen to face that direction, but each direction has its own bitmap:
Up button loads bitmap 0,
Right button load bitmap 1, etc.
What I want to do is change this so there is only one bitmap needed for the sprite and the buttons rotate the sprite, or make it go backwards or forwards along the angle it's facing - the same control system used in the original Grand Theft Auto. I don't see anything in the SDL docs that directly allow you to control the rotation of a SDL_surface (and from this I can do the forward and backward motion along the vector of the sprite direction). Is there any libraries that allow you to do this directly to the surface, or can anybody help with code for this problem?
Tane Piper: http://tane.cream.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL