I tried to calculate the bounce height for the bouncing ball however it ends up shaking against the moving platform after it finishes bouncing.
grav_val in this case is 0.1872 to prevent it to shake from normal surfaces after it finishes bouncing as a temporary fix.
yspeed = -max(0,(rounding(abs((yspeed + platform) / 2) - (grav_val) , 0.1)) + platform);
What the rounding function does is just rounds by a factor of whatever the second argument's number is.
return (input / factor) * factor
platform is the vertical speed of the platform that moves up, so let's hypothetically say it's in the speed of two for example:
platform = 2;
So, basically I want it to fully diminish until it hits to zero regardless of
yspeed adding itself because it does right now due to gravity and the platforms. Rewrites or new methods would be appreciated.