Bumping balls


Hi, everyone. And I really need your help because my script doing physics of ball colisions is pour and I guess I need a new one. So please if you have a script or ideas of making it to Find angle of balls(circles) moving and their speed after hitting each other , please, help and share it with me. I am only beginner and I cant solve this problem. This is how the game looks now to understand problem better, please no jokes that the problem is this game itself, its only prototype.


If your using normal speed variables you can use move_bounce_all() or move_bounce_solid() and it will do what you want. If you have a real physics room they should bounce automatically if you have correct physical properties set.


🐧 *penguin noises*
GMC Elder
You could use motion_add to add half of each ball's current speed to the other ball (save both balls' speeds to a variable first so you don't lose it):
var ps1, ps2, pd1, pd2;
ps1 = speed;
pd1 = direction;
ps2 = other.speed;
pd2 = other.direction;
Ah, good point Yal, move_bounce_* would only bounce the colliding ball, which wouldn't look very realistic if the other ball didn't move too.