Here is a model of a bouncing ball Here is the python code https://trinket.io/glowscript/8177d7aeef
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.