arrows, space see inside
here you have a vertical speed variable. Jumping make your speed positive. Gravity shrinks it frame by frame until its negative and you start falling. So your verticle speed sort of does this when you jump: 0, 0, 0, jump, 10, 8, 6, 4, 2, 0, -2, -4, -6, -8, -10, land, 0, 0, 0, 0, 0 You move up when it's positive and down when it's negative. So this looks more realistic because you slow down, stop, and fall back down instead of just bobbing up and down.