I’m working on an Asteroids type game using Arcade physics, and I want to create a rocket that can rotate. I’ve created a custom Phaser.Sprite
object and I can use setAngle()
to rotate it.
However, the problem is collision detection. If I use a single body then it detects collisions only at the center of the rocket. This doesn’t work well when the rocket is rotating, because the top and bottom are in visibly different locations.
So I want to add more Body
objects, similar to this article, but how to do this? If you create a custom object based on Sprite
you can only have one single collision body, is that correct?
Btw I know you can create polygons and rotate collision bodies if you use Matter.js Physics, but I want to use Arcade physics for simplicity and better performance.
Any idea what is the best way to do this?