O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding Intervals, Sequences, and Parallels

Intervals are very similar to tasks in that they are used to perform an action over time.

Note

They are also similar to animations because they can be controlled with simple start, loop, and stop methods just like animations.

Unlike tasks, Intervals automatically take into account the passage of time instead of executing on each frame, or waiting an amount of time to then execute in a single frame. They also use a finite duration of time, and stop automatically when that amount of time has passed.

To use Intervals, we need to import them with this import line:

from direct.interval.IntervalGlobal import *

Then, we can create Intervals by calling the constructor and giving it the necessary arguments: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required