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 - finalizing weapons with damage response

We're almost done with this chapter, but that doesn't mean we still don't have a lot to do. Let's stay focused and finish our cycle combat system so we can move on.

  1. Open CycleClass_05.py. Most of the changes we need to make will happen here.
  2. Our first order of business is with setupVarsNPs. We need to add four more variables to our list of cycle attributes. Place the following lines right after the line that says self.energy = self.maxEnergy:
    self.stability = 25
    self.shieldRchrg = 10
    self.energyRchrg = 5
    self.shutDown = False
    
  3. Scroll down to cycleControl next. The player shouldn't be able to control the cycle during emergency shut down, so change the if(self.active == True): line to look like ...

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