This is step 7 in a progression of projects starting from a simple sprite movement, and ending with a more fluid, realistic movement
See comment in the code