Question about animating with FOR loops

Hi all

Once I got the gist of how to iterate the nebulae with the FOR loop, I went ahead and put all the drawing / animation code for the nebulae in a single loop.

It ran just fine - is there a reason why we put in a separate loop for…

  • Animate
  • Draw
  • Update position

…rather than do all three in one loop?

Thanks in advance!

In larger projects, it can be useful to separate the drawing and update steps so you can update all objects at once then draw them all later.

But your approach is also correct.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms