Python - Pygame - Sprite Rotation -RESOLVED

Started by
3 comments, last by abseeley 16 years, 11 months ago
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]
Advertisement
Post the code you are having trouble with and I can probably help you since I'm really into Python/pygame right now.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
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.
See my latest pygame lesson post here.
[size="2"]Don't talk about writing games, don't write design docs, don't spend your time on web boards. Sit in your house write 20 games when you complete them you will either want to do it the rest of your life or not * Andre Lamothe
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

This topic is closed to new replies.

Advertisement