Skip to content

Commit 0dc0790

Browse files
committed
Update
1 parent f10bf03 commit 0dc0790

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

targetSprite.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ def setRot(self, rot):
106106
image_rect = self.sprite.get_rect(topleft=(self.rect.x - self.target.costumes[self.target.currentCostume].rotationCenterX, self.rect.y - self.target.costumes[self.target.currentCostume].rotationCenterX))
107107
#offset_center_to_pivot = pygame.math.Vector2((self.rect.x, self.rect.y)) - image_rect.center
108108
offset_center_to_pivot = pygame.math.Vector2((134, 36))
109-
print(offset_center_to_pivot)
110109
rotated_offset = offset_center_to_pivot.rotate(90 - self.direction)
111110
rotated_image_center = (self.rect.x - rotated_offset.x, self.rect.y - rotated_offset.y)
111+
print(rotated_image_center)
112+
112113

113114
self.image = pygame.transform.rotate(self.sprite, 90 - self.direction)
115+
# FIXME
114116
self.rect = self.image.get_rect(center=rotated_image_center)
115117
self.setXy(self.x, self.y)
116118

0 commit comments

Comments
 (0)