We're going to modify our two tasks to take advantage of some of these other task return options. To start with, we're going to change
cycleMove so that it stops after the cycle has moved a set distance. After that, we'll change
debugTask to only print once every second.
__init__method, we need to add a line to declare the variable. Put this line just before our call to
self.cycle2.setPos(-2,15,0) self.distTrav = 0
taskMgr.doMethodLater(5, self.cycleMove, "Cycle Move")Now we ...