Game/animation loop helper