Line 45 is the line that is causing the issue you are seeing. The dog’s y value starts at 300 and with each click of the up key, it gets even smaller. As a result, line 45 is always in play and unless you are clicking on the up key, the velocityY of the dog is set to 0.
Hope this helps!
Mike