Jump to content

collision with a rotate body


Aperosuz
 Share

Recommended Posts

Hi,

I am trying to make a game, it's a boat on the middle of the map (he don't move) and a shield (a segment) turning around (he make a circle) your boat thanks to the arrow key left and right ( i have used "this.shield.body.angularVelocity"). And we have cannon appearing around my player and shooting on it, to don't take any damage i need to skim them on my shield (And my problems is here).

But the collisions (i have use overlap) don't work because the shield's hitbox don't move and stay on his first position, so the overlap work only if the bullet come in this way.
How can i make to detect the collision all the time with my shield even if he turn ? (I could have the left and right position of my segment and the velocity, can i use them to calculate the position of my shield to create my own collision detect, and if yes how can I ?)

I hope you have the solution,
Thank you so much

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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