O'Reilly logo

Panda3D 1.6 Game Engine by Dave Mathews

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - inter-cycle collisions

We're going to use the files from last chapter's Have a Go hero section to proceed. If we didn't complete that section, that's fine. Files have been provided that we can use instead.

  1. Open the cycle class file we made during the previous chapter's Have a Go hero section, or open the file CycleClassHero.py in the Chapter06 folder.
  2. Resave the file as CycleClass_01.py in the Chapter06 folder.
  3. For this collision system, we're going to have a unique name for each cycle on the track. We also need to be able to put the cycles in different spots on the track so they don't start on top of each other. Change the definition of the __init__ to look like this:
    def __init__(self, inputManager, track, startPos, name, ai = ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required