What is that made of? Can it be replicated at home?


Question: Goalkeeper Jumping Algorithm?
Answer: The ways to handle this are different based on how you are assigning speed, swerve etc.  I'm assuming you have a skill challenge to do that ("stop the moving needle in the right part of the gauge"-type thing or something similar).  If so, then you want higher-swerve and higher-speed to equal higher-percentage chance of scoring.  If they are just chosen values, then they shouldn't have such a direct effect, or the player will always choose them to be high.

You could set a percentage of the time you want the goalkeeper to save (based on the speed and swerve), and simply pick a random number, if it's below that percentage, play the correct animation (diving the right way) for the save, if it's higher, play the wrong one and allow the score.  This is simple, but also a little "cheating"-like.

You could set an amount of time for the goalie to read the direction the ball is going, and then start moving him in that direction, and constantly allow him to adjust for the swerve until the last X% of the time it takes the ball to arrive, at which point the goalie can dive for the ball if it's within a range of where he is (and outside "move-to" range).  "Better" goalies (higher levels?) will read sooner, move faster, and dive later(and further).  This is more complicated, but more flexible, and more simulation-like.