After much frustration I have finally found a way to mathematically calculate accurate acceleration and deceleration of a shape in a birds eye view game. I will put comments in the code later to make it clear how it works. The way the code is written makes it easy to add contact and impact later as well. Use the arrow keys to move around. You can hold two keys at a time to move diagonally. Change the value of "Maximum run speed" on the background page if you wish.
The basic idea is that when you hit a keyboard combination that creates a "target