TheProdigy22 Posted May 4, 2016 Share Posted May 4, 2016 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 More sharing options...
TheProdigy22 Posted May 4, 2016 Author Share Posted May 4, 2016 By the way, should I be using p2 for this? The only reason I need it is for the ball to bounce correctly, so if there's a better way to deal with this, please let me know. Link to comment Share on other sites More sharing options...
QLNEO Posted November 3, 2017 Share Posted November 3, 2017 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 More sharing options...
Recommended Posts