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


  • Recently Browsing   0 members

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