Closed Nadav-01 closed 5 years ago
Update: Implemented better collision mechanics (using the 2d elastic collision formula in wikipedia. Some problems in the new implemention:
When 2 balls come at eachother in an angle (not directly next or above one another), sometimes the collision will not go as it needs to.
Example:
another example: a smaller ball can "stick" to a larger ball and "climb" on its slope, such as:
Fixed the first issue. Havent seen the second one yet. Will reopen if it is still a problem, even though im really sure it was a by product of the faulty collision function.
The collision mechanics are broken, and not well implemented. Fix them, by making a new method to calculate the speeds and directions post collision, or by using the link provided: https://www.toptal.com/game/video-game-physics-part-ii-collision-detection-for-solid-objects