Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
805 views

Pygame 2D : rotation around center not working properly

here is the code I use to rotate an image around its center: ...
Salem's user avatar
  • 226
1 vote
1 answer
1k views

How can I rotate my character so that he is facing the mouse?

I just want to preface this by saying I am very new to pygame. At the moment I have calculated the angle that I need to apply to my character so he can rotate but I am unsure how to actually make ...
domefist's user avatar
0 votes
1 answer
2k views

How to rotate a surface in pygame, without changing its shape

I'm writing a class in pygame to create a sprite object, and I'd like to be able to rotate it. It works fine with an image, and rotates without issue. But when rotating a surface with a plain colour, ...
George Willcox's user avatar
3 votes
4 answers
4k views

Rotating hitboxes in PyGame?

I'm using pygame.rect.colliderect() to check hitbox collision between sprites in my game, but now that I'm rotating the sprites, I'm realizing I can't do this ...
user3150635's user avatar
1 vote
1 answer
746 views

Rotating image around a given point

Im trying to simulate shadows in a 2d RPG, So far I can make the shadows but i cant blit them properly, Im trying to rotate them according to where the "sun" is (just a position) I have looked at ...
Serial's user avatar
  • 238
0 votes
1 answer
211 views

How to spin an object on its own axis?

I'm trying to spin up my own 3D vector graphics engine, so I'd like to do this without an existing library. And I don't seem to be able to find the math for the correct approach in rotating an object ...
Stick's user avatar
  • 339
1 vote
1 answer
846 views

pygame - avoiding sprite 'jitters' on rotating the image

Is there a common trick for getting around sprites that are changing directions 'too quickly' and causing their sprite to display erratically? In this project, the player moves in 8 directions by ...
Stick's user avatar
  • 339
1 vote
1 answer
1k views

Pygame's rotation methods have crippling issues, but is it me or Python's pygame?

http://www.youtube.com/watch?v=lNJFxvR6ex8&feature=youtu.be On rotate and rotozoom, can't find fixes on these on the internet, anywhere. Basically, the video is showing 4 things in this order: 1. ...
Eliot Leo Carney-Seim's user avatar
5 votes
3 answers
26k views

Pygame surface rotation, rect rotation or sprite rotation?

i seem to have a conceptual misunderstanding of the surface and rect object in pygame. I currently observe these objects this way: Surface Just the loaded image rect the 'hard' representation of the ...
TheMeaningfulEngineer's user avatar
2 votes
2 answers
2k views

Grouping surfaces in pygame to get an object with two movement points

I would like to create a simple tank using pygame. One would drive the tank by controlling he velocities of two caterpillar tracks. They should be the two single movement points of the vehicle. I'm ...
TheMeaningfulEngineer's user avatar
2 votes
1 answer
2k views

OpenGL: Rotating cannon about non-centre position?

So I have a "cannon" object (basically a long cylinder) and I want to be able to control its angle. The code I have now is: ...
joradn's user avatar
  • 21