[#009] Seems that these changes fixed the bug and the game process takes no more than 5% of processor time. No idea why this helped to run animation smoothly though.