Jump to content

Arcade Physics Bounce not correct for circular objects


emmes
 Share

Recommended Posts

I'm trying to create some billiard-like game, and want to be using arcade physics due to the number of objects.

When using the (newer) circular objects, bounce does not seem to work like it's intended - at least if one object is very massy or immovable.

Please try https://samme.github.io/phaser-examples-mirror/arcade%20physics/bounce%20knock.html and add a 

   knocker.body.setCircle (16);
   ball.body.setCircle(16);

after both bodys are created - a debugger in render() helps also:

    game.debug.body(knocker);
    game.debug.body(ball);

You will notice a significant difference in behaviour, when the ball hits the knocker straight on. It should be reflected (bounce is 1), but instead momentum is almost completely killed, it just drifts a bit sideways if movement was not straight on.

I can imagine the bounce routines are still rectangular based only, so they work so-so for circular/rectangular hits, but not for circular/circular... but then for rectangular hitboxes it works as intended...

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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