Rotate Sprite around Pivot Point in Pygame

Viewed 153

I try to rotate my canon in pygame

enter image description here

The problem ist that with

pygame.transform.rotate()

The rotation is about the center which obviously is not the correct rotation point for the gun. So how can i move the rotation point ~20px from the center down?

This is my initialization of the gun:

self.image = pygame.image.load("./assets/Tower/MiniGun.png").convert_alpha()
self.rect = self.image.get_rect()
self.rect.center = (80, 250)
0 Answers
Related