Jump to content

A problem with collision when a sprite changes size


Recommended Posts

Hi all,


I have a sprite in my game that changes size at certain points in the game. It changes size via the `sprite.body.setSize` method. Unfortunately, it seems that the sprite is unaffected by objects that it should collide with whilst it is in the process of changing size. This makes sense because the sprite's boundaries are in a state of flux during the process of a size change, but this is bad because my user can take advantage of this and move through walls. I'm not sure how to get the sprite to be susceptible to collision while in the process of changing size. Does anyone know a way around this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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