Pencil Code Reference > mixing queue- and frame-based animation

 

mixing queue- and frame-based animation the ultimate form of animation

Queue-based animation and frame-based animation may seem like completely different types of programming, but they are both based off the same concept. The only difference is that in queue-based animation you're seeing the results long after the code is completed, whereas in frame-based animation the program is run as a series of frames which are displayed immediately and instantaniously upon completion.

While it is sometimes difficult to do, mixing the two types of animation can make more complex code, along with a more seamless visual, possible.

The following example uses animation queues to make the turtles move, but each movement is queued each frame by the while loop.

For a more detailed explanation of this script, see its info page.