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

Time for action - removing tasks by name

For this lesson, we're going to make a second task to move self.cycle2. Then we're going to remove both of the cycles' movement tasks at the same time. We'll use remove first, and then we'll do it again with removeTasksMatching.

  1. First off, we don't want the cycle tasks removing themselves prematurely, so we need to delete the return task.done from cycleMove. Take out the if statement that triggers it as well, we don't need that anymore either. While we're at it, we should remove the lines that reference self.distTrav as well.
  2. To keep our command prompt from getting too cluttered, we should delete the line in cycleMove that prints delta time, print(dt). After that, copy the entire cycleMove method and paste ...

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