Sign in to follow this  
abseeley

Python - Pygame - Sprite Rotation -RESOLVED

Recommended Posts

hello everyone, im using the latest python version, as well as the most recent pygame build, and eclipse (latest) with a python plugin, which compiles fine. Im just getting into python because of its easy ability to pump out games in record time! Definitely reccomended to try for newcommers and gurus alike! Now my problem comes to working with sprites. I realise that the .rect of a sprite object is its location and orientation on a surface and the .image of that object is its graphic surface. Now im working on a top down drifting car game, ive got all the physics down, but I cant seem to figure out how to get a sprite to rotate! Now according to the pygame reference: pygame.transform.rotate rotate an image pygame.transform.rotate(Surface, angle): return Surface This causes a loss of quality, and general not good, however people have expanded on this with a comment here: http://www.pygame.org/docs/ref/transform.html#pygame.transform.rotate Now im fairly new to python but i understand the idea of surfaces, bliting and the like, but i cant seem to get this to work for the life of me! HELP!!!! [Edited by - abseeley on May 3, 2007 8:02:17 AM]

Share this post


Link to post
Share on other sites
Always rotate the original image, not a rotated version. Rotating an already rotated surface will make the image degrade like making a copy of a copy in a copy machine.

Share this post


Link to post
Share on other sites
Thank you SOOO MUCH daviangel your tutorial was very very helpful when it comes to rotating sprites, the only one i have ever seen that actually explained how to do it and showed it, not just saying make a copy of the image rotate the copy then set to original, because that makes no sense if you just hear it. Thanks a million!

RESOLVED

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this