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.
Open
CycleClass_05.py
. Most of the changes we need to make will happen here.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 saysself.energy = self.maxEnergy
:self.stability = 25 self.shieldRchrg = 10 self.energyRchrg = 5 self.shutDown = False
Scroll down to
cycleControl
next. The player shouldn't be able to control the cycle during emergency shut down, so change theif(self.active == True):
line to look like this:if(self.active == True and self.shutDown == False):
We also need to add a new method call to
cycleControl
. Place this line right after the call to thecheckMarkers()
method:self.recharge(dt)
Let's go ahead and add the new...