Situation: I'm going to makeI have code which rotates a 2d top-down multiplayer tank game, but no Python sprite libraries I've found have been what I wanted.:
@window.event
def on_key_press(symbol, modifiers):
print('Rotating')
global player_sprite
player_sprite.rotation += 1
if player_sprite.rotation == 360:
player_sprite.rotation = 0
RequirementsHowever, this rotates the sprite in a manner I don't want: it changes its x and y position. I need to be ablewant it to display spritesremain in the same place -- it's a tank, and either rotate those sprites about an axis or display different frames depicting rotation (I already have the images)is not supposed to move when it turns. SupportIf, for transparency is a mustinstance, as my .png files are transparent.I do
player_sprite.rotation = 180
What I've tried: I've tried Pygletit not only faces the opposite direction, but its rotation of sprites doesn't keep the sprite inis now far away from its original X and Y coords. Pygame is too large,x and yields errors with pip
is usedy coordinate.
Question: Please reccomend How would I allow the sprite to merotate without changing its x and y?
Here's a library for either Python or Javalink to my (preferrably Python) that is cross-platform, supports sprites, and can rotate themfull code.