Hi, this is a Math problem for a 2d game.
Given 2 object ( 2 car, 2 tank, 2...), for each object i know:
1. X, Y
2. Actual Speed
3. Degree of movement (or radiant)
How to calculate the "effect" of a collision for the 2 object
Ps:
I "move" the object with this simple formula each tick of my "game loop":
ychange = Math.Sin(radiant) * ((carspeed / xVar));
xchange = Math.Cos(radiant) * ((carspeed / xVar));
(where xVar is a "multiplicator" to make more slow my car on the screen)
And for the "first" object which collide, if i add a "minus" (-) in front of that formula, i can simulate a good "bounce" of the first object.. but not for the second.
So my question regard a way to calculate a good (not perfect ! ) and more realistic "impact effect" for the second object.
Thanks for your help