I'm currently trying to code a game which includes a wee robot landing on a pad. In trying to work out the physics of the way it would fall, I have come across an issue with the rotation. It rotates on a left or right key press, in the respective direction.
I've tried using blit with the rect.center but it still doesn't seem to work. Any help would be much appreciated!!
def rotate_right(self):
self.new_angle = self.angle + 30
self.rotate_lander()
def rotate_lander(self):
self.image = pygame.transform.rotozoom(self.image, self.new_angle, 1)
self.rect = self.image.get_rect(center=self.image.get_rect().center)
screen.blit(self.image, self.rect.center)
I've managed to get it to rotate, but it moves with every rotation, and I need it to stay in the same position. I think the centre is off, but I'm not sure where it could have gone wrong.