Added 3 frame animation on player depending on current direction. Also added animation optimization to accommodate for browser specific optimizations, with a fallback to the regular setTimeout()