I have tried pygame.transform.rotate and pygame.transform.rotozoom. Rotozoom works a little bit better, but my image flies off of the screen very quickly, and it stretches and morphs and won't just sweep left and right like I would like. My intention is when the rotation gets below -50 to rotate the other way, but that just stretches it more.
try:
screen.blit(Turrets[0], (TurretCoords[0]))
if Rotation0 == -1:
TurretRotation[0] = TurretRotation[0] - 1
Turrets[0] = pygame.transform.rotozoom(Turrets[0], -1, 1)
if TurretRotation[0] < -50:
Rotation = 1
else:
Rotation = -1
elif Rotation == 1:
TurretRotation[0] = TurretRotation[0] + 1
Turrets[0] = pygame.transform.rotozoom(Turrets[0], 1, 1)
if TurretRotation[0] > 50:
Rotation0 = -1
else:
Rotation0 = 1
except:
pass
try:
screen.blit(Turrets[1], (TurretCoords[1]))
if Rotation == -1:
TurretRotation[1] = TurretRotation[1] - 1
Turrets[1] = pygame.transform.rotozoom(Turrets[1], -1, 1)
if TurretRotation[1] < -50:
Rotation = 1
elif Rotation == 1:
TurretRotation[1] = TurretRotation[1] + 1
Turrets[1] = pygame.transform.rotozoom(Turrets[1], 1, 1)
if TurretRotation[1] > 50:
Rotation = -1
except:
pass
pygame.display.flip()