def __init__(self): base.disableMouse() base.setBackgroundColor(0, 0, 0) self.inputManager = InputManager() self.track = Track() self.cycle = Cycle(self.inputManager, self.track, ai = True) taskMgr.doMethodLater(10, self.debugTask, "Debug Task")
def __init__(self): base.disableMouse() base.setBackgroundColor(0, 0, 0) self.inputManager = InputManager() self.track = Track() self.cycle1 = Cycle(self.inputManager, self.track, 1, "Bert", ai = False) self.cycle2 = Cycle(self.inputManager, self.track, 2, "Ernie") taskMgr.doMethodLater(10, self.debugTask, "Debug Task")
def __init__(self): base.disableMouse() # Turns off the default mouse-camera controls in Panda3D. base.setBackgroundColor(0, 0, 0) # Sets the background to black. self.inputManager = InputManager() # Creates an InputManager to handle all of the user input in the game. taskMgr.doMethodLater(10, self.debugTask, "Debug Task") # Tells the debugTask to run once every ten seconds. The debug task is a good # place to put various data print outs about the game to help with debugging. self.filters = CommonFilters(base.win, base.cam) filterok = self.filters.setBloom(blend=(0, 0, 0, 1), desat=-0.5, intensity=3.0, size=2) render.setShaderAuto() # Turns on Panda3D's automatic shader generation. self.menuGraphics = loader.loadModel("../Models/MenuGraphics.egg") # Loads the egg that contains all the menu graphics. self.fonts = { "silver": loader.loadFont("../Fonts/LuconSilver.egg"), "blue": loader.loadFont("../Fonts/LuconBlue.egg"), "orange": loader.loadFont("../Fonts/LuconOrange.egg") } # Loads the three custom fonts our game will use. hud = HUD(self.fonts) # Creates the HUD. self.race = Race(self.inputManager, hud) self.race.createDemoRace() # creates an instance of the race class and tells it to # start a demo race. self.createStartMenu()