Let's move right along to our
Gun classes. These are created and destroyed with the cycles, so we need to make sure they are getting garbage collected properly.
GunClasses_00.pyfile from the
Chapter12folder. Update the imports section to use
def __del__(self): print("Machine Gun Removed")
def __del__(self): print("Cannon Removed")
CycleClass_00.pyand update the import to use
Gunclasses_01.py, then resave the file with Ctrl+S and run the game. Click the New Game ...