def defineConstants(self, forceNumPlayers=None):
        DistributedPartyCatchActivity.notify.debug("defineConstants")
        self.ShowObjSpheres = 0
        self.ShowToonSpheres = 0
        self.useGravity = True
        self.trickShadows = True
        if forceNumPlayers is None:
            numPlayers = self.getNumPlayers()
        else:
            numPlayers = forceNumPlayers
        self.calcDifficultyConstants(numPlayers)
        DistributedPartyCatchActivity.notify.debug("ToonSpeed: %s" % self.ToonSpeed)
        DistributedPartyCatchActivity.notify.debug("total drops: %s" % self.totalDrops)
        DistributedPartyCatchActivity.notify.debug("numFruits: %s" % self.numFruits)
        DistributedPartyCatchActivity.notify.debug("numAnvils: %s" % self.numAnvils)
        self.ObjRadius = 1.0
        dropRegionTable = PartyRegionDropPlacer.getDropRegionTable(numPlayers)
        self.DropRows, self.DropColumns = len(dropRegionTable), len(dropRegionTable[0])
        for objType in PartyGlobals.DropObjectTypes:
            DistributedPartyCatchActivity.notify.debug("*** Object Type: %s" % objType.name)
            objType.onscreenDuration = objType.onscreenDurMult * self.BaselineOnscreenDropDuration
            DistributedPartyCatchActivity.notify.debug("onscreenDuration=%s" % objType.onscreenDuration)
            v_0 = 0.0
            t = objType.onscreenDuration
            x_0 = self.MinOffscreenHeight
            x = 0.0
            g = 2.0 * (x - x_0 - v_0 * t) / (t * t)
            DistributedPartyCatchActivity.notify.debug("gravity=%s" % g)
            objType.trajectory = Trajectory(0, Vec3(0, 0, x_0), Vec3(0, 0, v_0), gravMult=abs(g / Trajectory.gravity))
            objType.fallDuration = objType.onscreenDuration + self.OffscreenTime

        return
Ejemplo n.º 2
0
    def defineConstants(self, forceNumPlayers=None):
        DistributedPartyCatchActivity.notify.debug('defineConstants')
        self.ShowObjSpheres = 0
        self.ShowToonSpheres = 0
        self.useGravity = True
        self.trickShadows = True
        if forceNumPlayers is None:
            numPlayers = self.getNumPlayers()
        else:
            numPlayers = forceNumPlayers
        self.calcDifficultyConstants(numPlayers)
        DistributedPartyCatchActivity.notify.debug('ToonSpeed: %s' %
                                                   self.ToonSpeed)
        DistributedPartyCatchActivity.notify.debug('total drops: %s' %
                                                   self.totalDrops)
        DistributedPartyCatchActivity.notify.debug('numFruits: %s' %
                                                   self.numFruits)
        DistributedPartyCatchActivity.notify.debug('numAnvils: %s' %
                                                   self.numAnvils)
        self.ObjRadius = 1.0
        dropRegionTable = PartyRegionDropPlacer.getDropRegionTable(numPlayers)
        self.DropRows, self.DropColumns = len(dropRegionTable), len(
            dropRegionTable[0])
        for objType in PartyGlobals.DropObjectTypes:
            DistributedPartyCatchActivity.notify.debug('*** Object Type: %s' %
                                                       objType.name)
            objType.onscreenDuration = objType.onscreenDurMult * self.BaselineOnscreenDropDuration
            DistributedPartyCatchActivity.notify.debug(
                'onscreenDuration=%s' % objType.onscreenDuration)
            v_0 = 0.0
            t = objType.onscreenDuration
            x_0 = self.MinOffscreenHeight
            x = 0.0
            g = 2.0 * (x - x_0 - v_0 * t) / (t * t)
            DistributedPartyCatchActivity.notify.debug('gravity=%s' % g)
            objType.trajectory = Trajectory(0,
                                            Vec3(0, 0, x_0),
                                            Vec3(0, 0, v_0),
                                            gravMult=abs(g /
                                                         Trajectory.gravity))
            objType.fallDuration = objType.onscreenDuration + self.OffscreenTime

        return