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 - using Intervals in Sequences and Parallels

We'll be using a LerpScaleInterval, a Parallel, and a Sequence to create a script for when our machine gun lasers fire. Before we start making the MachineGun class, though, our Cycle class will need some small modifications.

  1. Open CycleClass_01.py and add this line to our imports section:
    from GunClasses_01 import *
    
  2. Scroll down to the setupVarsNPs() method and look for the lines where we call self.fd.reparentTo(fdMount) and self.rd.reparentTo(rdMount). Right under those lines, add the following code:
    self.LMGMount = self.turretActor.exposeJoint(None, "modelRoot", "LMGMount") self.RMGMount = self.turretActor.exposeJoint(None, "modelRoot", "RMGMount") self.LMG = MachineGun(self, self.LMGMount) ...

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