Check oldbuttons to see if jumping is actually possible
Prevent NaN after applying friction when speed is zero