Jump to content

Rotate body position with sprite angle


tembac
 Share

Recommended Posts

Hi everyone,

I have an animated sprite of a meteorite with it's tail. I need that the collisions are only for the rock and to be able to rotate the sprite with the movement direction. If I setup the body size like this:

this.anchor.set(.55, .55);

this.body.setSize(110, 110, 400, 350);

The graphic and body collision is fine if the angle of rotation is 0.

fb9ee2dcd1.jpg

a2a4e430fc.jpg

But I need to rotate the sprite around the anchor point and then the body is not on the desired position of the sprite.
589560e965.jpg

8aade65006.jpg

How can I fix this?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...