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