A Guard is an if statement, so if a ball bounces youd have a guard for when you hit the floor it should reverse the velocity and lose some.

REMEMBER every variable here is a number.

where here is the thing calculated that makes velocity smaller each bounce? ==the fucker bump! is responsible for it. our variable -a is just a number between 0 and 1, because if its higher then you have a ball that gains velocity every time instead==

Velocity is the black line, height is blue. As you can see the velocity increases (by earths gravity per second)