This is the vehicle I programmed together with my 5 year old: https://jsfiddle.net/k1g6533y/13/
I changed it a little bit to optimise rendering just in case you don't know about 'requestAnimationFrame()' (https://developer.mozilla.org/en-US/docs/Web/API/window/requ...):