Are we ready to see how this works? Let's go, then!
Open
RaceClass_00.py
from theChapter11
folder.We'll start with two new imports.
AudioManager
object is in thepandac.PandaModules
package, butAudio3DManager
object is in thedirect.showbase
package.from pandac.PandaModules import * from direct.showbase import Audio3DManager
Next, we're going to add a nice block of code to the
__init__
method to set up ourAudioManager
objects and their wrappers:self.amList = [] self.a3DList = [] for N in range(4): self.amList.append(AudioManager.createAudioManager()) base.addSfxManager(self.amList[N]) self.audio3D.append(Audio3DManager.Audio3DManager( base.sfxManagerList[N + 1], camera)) self.a3DList[N].setDropOffFactor(.1)
Next, scroll down to the
createDemoRace()
method and change the lines that create our cycles to look like the following code:self.cycles.append(Cycle(self.inputManager, self...