In this case, it will be easier to let the process explain itself, so let's dive right in.
Open
WorldClass_02.py
.Add this line of code to our imports. While we're here, let's update our imports to use
RaceClass_01.py
instead ofRaceClass_00.py
.from pandac.PandaModules import *
Scroll down to the
__init__
method and add this block of code right at the top of the method:cursor = loader.loadModel("../Models/Cursor.egg") cursor.reparentTo(render2d) cursor.setBin("gui-popup", 100) cursor.hide() props = WindowProperties() props.setCursorHidden(True) base.win.requestProperties(props) base.mouseWatcherNode.setGeometry(cursor.node()) self.totalItems = len(self.models)
Next, scroll down to the line where we instantiate an instance of our
Race
class. Change that line to include a new argument:self.race = Race(self.inputManager, hud, cursor)
Resave the file as
WorldClass_03.py
and openRaceClass_00.py
.Rewrite the definition...