Jump to content

Circular bodies stuck against the walls bug


Recommended Posts

So I thought it was a bug in my code, been working on it for weeks, but I've finally traced it to Phaser.Physics.Arcade.Body.checkWorldBounds(). I'm using Arcade physics, circular body, collideWorldBounds true, bounce zero. My guys hit the wall and then try to turn around, but checkWorldBounds() prevents them. Two problems: the code that checks whether I'm out of bounds finds that I am indeed, by 1e-308. Fair enough, out of bounds is out of bounds, even if it's by less than the Planck length. The problem happens when the function corrects my intended velocity, even though it's a velocity that would move me away from the wall, by my bounce factor, which of course is zero. So no matter what velocity I set, it gets zeroed out. I would fix it and submit a pull request, but as I've discovered before, Phaser is complex, and I'm sure there are other considerations that I would fail to take into account. I'll change my own copy, of course.

Awesome library, by the way. Can't believe it's free.

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...