Use requestAnimationFrame

and add a polyfill for browser compatibility.
Move to the next fork or dead end
Prevent control while moving