I have a top-down game and with no gravity. I'm not using Physics Behavior. I'd like to calculate correctly the redirection angles after 2 objects collide. Ideally I'd like to take their speed and mass into account to change their speed accordingly. And by mass I mean a handful of mass sizes: small, medium, large, giant. But if that's too intensive, then I would settle for just the correct angles.
currently I'm taking the two objects and comparing their moving angles. If the other is within 180 degrees of its own moving angle I apply "force" in the form of acceleration to the player and then have the Other use "Bounce off".
It looks wonky sometimes but works most of the time, however I would love to see how the calculations would look using physics formulas to redirect angles and speeds.
These are the variables I have:
- Other.Bullet.Speed
- Other.Bullet.AngleOfMotion
- Other.mass
- Player.CustomMovement.Speed
- Player.CustomMovement.MovingAngle
- Player.mass
(gravity off)
On Collision
Thanks for the help in advance!
EDIT: even if all object had the same mass that would be totally fine for me. I'm just really curious how difficult the math would be to do this.