Jump to content

[Physics p2] Reduce drag to 0 (not mouse drag)


TheProdigy22
 Share

Recommended Posts

I'm making a Brick Breaker type game using Phaser. Since I only started using Phaser a week ago, I made it in Arcade physics. It's working, but the ball bounces like a block (as expected from arcade physics) so I tried switching to p2 physics. I've gotten nearly everything working except the ball. I used contact material to make sure it didn't lose velocity after it hit an object and turned the restitution up to 1 to achieve this. Now the only problem is that I cannot get the ball to stay at a constant velocity. It isn't losing that velocity because it's hitting other things, but the velocity is lost because of drag. Is there any way to fix this?

EDIT: This is the working arcade code from HTML: http://pastebin.com/4jmVh3ae Maybe it'll help with porting it over to p2?

Link to comment
Share on other sites

  • 1 year later...

I know this question is over a year old, but it's worth knowing that as of today (Phaser-CE 2.9.1) you can actually set the ball to have circular collision with Arcade Physics. You have to use sprite.body.setCircle(radius) for that.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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