Jump to content

Predictive trajectory in P2 Physics


AreteZero
 Share

Recommended Posts

Hi, first time posting. I'm currently trying to predict the angle the ball will take after collision in a pool game. I attached a screenshot of what I want to implement.

The white line coming in front of the pool cue shows  where the ball will collide and the angle it will take after collision.

Im currently using P2 Physics but cannot figure out what I should use to draw the line and calculate the angle. I started trying to use a geometry line, but that only shows in Debug mode, and I tried a Sprite that's a long line that I can then mask, but that's not working either.

Any help would be appreciated, this is my first time making an html5 game and first time using phaser. I've previously made games for Mobile using Corona SDK and I know how I would draw the line there, but can't find anything in Phaser.

Thanks!

 

image.png

Edited by AreteZero
Attached image
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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