Skip to content

rotation problem  #49

@Sc2Marines

Description

@Sc2Marines

hello I'm a new user of you'r pygame fonction and I have two small problems: first I want to run a sprite on itself, so I use the transphorm sprite method. But there comes the problem the sprite turns around its angle so I went to see in pygame function to see how it works: I have identified that what makes the image rotate is this part: "'tempImage = pygame .transform.rotozoom (tempImage, -angle, scale) "'. and I also know that to rotate the image on itself we can then use "'sprite.rect = sprite.image.get_rect (center = sprite.rect.center)"' so i tried to modify the class but it didn't change anything, then i saw that oldmiddle might be useful but i didn't understand how to use it. That was the first problem. Now the second which is linked with the first: my character can move with the keys up, down, left, right and when I do a rotate sprite of 90 ° it does the rotation (not centered) but when I then want it rotate 90 ° again so that it is in front of its initial position the program does not take into account the first rotation performed and returns to the initial position for then the program execute a 180 ° rotation
here is if you need part of my code or something else tell me Thank you for your answers (and sorry for my bad english I'm french)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions