Open caseybetts opened 2 years ago
When the player collides with a space rock momentum should be conserved.
Within the collision block, calculate the momentum of the player and the rock and adjust the player velocity to keep the total momentum constant.
p_t = p_p + p_r = mv + mv => v_p = (p_t - m*v)/m
This has been implemented, but needs testing. I'm not convinced that it's working correctly.
When the player collides with a space rock momentum should be conserved.
Within the collision block, calculate the momentum of the player and the rock and adjust the player velocity to keep the total momentum constant.
p_t = p_p + p_r = mv + mv => v_p = (p_t - m*v)/m