Jump to content

Growing and shrinking a sprite with p2 physics


MoragX
 Share

Recommended Posts

Hey everyone,

 

I've making a game with various enemies that are made from balls with various abilities. I'd like one of them to grow and shrink over time, and I'm using the P2 physics module. Changing the size of the displayed sprite is easy with sprite.scale.x/y but I'm not sure what the equivalent command is to update the sprite.shape which is used by the physics engine. So when I scale it, I end up with a large sprite but the original hit box. What is the correct way to handle this? Is it necessary to remove and recreate the shape each time I resize my object?

 

-MoragX

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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