Implement the animation ticker using the main loop