psxtrader13 Posted December 15, 2015 Share Posted December 15, 2015 HI There. Thank you for reading this. I am working on a game with a ball colliding with theworld. Think Pong where there is a ball bouncing off of the walls. However, I also want to put short straight lines randomly around the stage that the ball can bounce off to increase the difficulty. The lines can be at any angle. I originally created my collision tiles in Tiled and everything was working great until I realized that the Arcade physics engine was treating everything like a horizontal or vertical polygon, so when the ball collided with an angle it wasn't changing the angle of velocity according to "real" physics. I am currently rewriting my code in P2 physics to see if that works better, but I was hoping that someone could tell me if there is a more ideal option. I learn something new about Phaser every day, but I don't know what I don't know. Tiled collision tiles seem ideal because I don't have to individually position each line on the board, but is there a better way that I have not yet come across? I was looking at PhsyicsEditor but it doesn't seem like it will work because I will be inside of the sprite, not outside. Thank you very much in advance. Link to comment Share on other sites More sharing options...
Skeptron Posted December 15, 2015 Share Posted December 15, 2015 I don't know P2 (I mean, I've never used it) but yes, Arcade only has vertical/horizontal rectangle-shaped hitboxes. So for your ball this isn't ideal, and neither is it for the lines. I would strongly advise you to switch to P2. I didn't quite understand why you can't work this out with PhysicsEditor though... Could you re-explain your issue with it please? Link to comment Share on other sites More sharing options...
Recommended Posts