コード例 #1
0
ファイル: CogdoGameExit.py プロジェクト: project-storm/src
 def close(self, animate=True):
     if not self._open:
         return
     if animate:
         self._finishIval()
         self._ival = Sequence(
             Parallel(
                 SoundInterval(self._closeSfx),
                 self._leftDoor.posInterval(
                     self.getOpenCloseDuration(),
                     ElevatorUtils.getLeftClosePoint(
                         ElevatorConstants.ELEVATOR_NORMAL),
                     startPos=ElevatorUtils.getLeftOpenPoint(
                         ElevatorConstants.ELEVATOR_NORMAL),
                     blendType='easeIn'),
                 self._rightDoor.posInterval(
                     self.getOpenCloseDuration(),
                     ElevatorUtils.getRightClosePoint(
                         ElevatorConstants.ELEVATOR_NORMAL),
                     startPos=ElevatorUtils.getRightOpenPoint(
                         ElevatorConstants.ELEVATOR_NORMAL),
                     blendType='easeIn')))
         self._ival.start()
     else:
         ElevatorUtils.closeDoors(self._leftDoor,
                                  self._rightDoor,
                                  type=ElevatorConstants.ELEVATOR_NORMAL)
     self._open = False
コード例 #2
0
    def __playReservesJoining(self, ts, name, callback):
        index = 0
        for suit in self.joiningReserves:
            suit.reparentTo(render)
            suit.setPos(
                self.elevatorModelOut,
                Point3(ElevatorPoints[index][0], ElevatorPoints[index][1],
                       ElevatorPoints[index][2]))
            index += 1
            suit.setH(180)
            suit.loop('neutral')

        track = Sequence(
            Func(camera.wrtReparentTo, self.elevatorModelOut),
            camera.posHprInterval(0.5,
                                  Point3(0, -8, 2),
                                  Vec3(0, 10, 0),
                                  blendType='easeInOut'),
            Parallel(
                SoundInterval(self.openSfx),
                LerpPosInterval(
                    self.leftDoorOut,
                    ElevatorData[ELEVATOR_NORMAL]['closeTime'],
                    Point3(0, 0, 0),
                    startPos=ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
                    blendType='easeOut'),
                LerpPosInterval(
                    self.rightDoorOut,
                    ElevatorData[ELEVATOR_NORMAL]['closeTime'],
                    Point3(0, 0, 0),
                    startPos=ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
                    blendType='easeOut')), Wait(SUIT_HOLD_ELEVATOR_TIME),
            Func(camera.wrtReparentTo, render), Func(callback))
        track.start(ts)
        self.activeIntervals[name] = track
コード例 #3
0
 def close(self, animate=True):
     if not self._open:
         return
     if animate:
         self._finishIval()
         self._ival = Sequence(
             Parallel(
                 SoundInterval(self._closeSfx),
                 self._leftDoor.posInterval(
                     self.getOpenCloseDuration(),
                     ElevatorUtils.getLeftClosePoint(ElevatorConstants.ELEVATOR_NORMAL),
                     startPos=ElevatorUtils.getLeftOpenPoint(ElevatorConstants.ELEVATOR_NORMAL),
                     blendType="easeIn",
                 ),
                 self._rightDoor.posInterval(
                     self.getOpenCloseDuration(),
                     ElevatorUtils.getRightClosePoint(ElevatorConstants.ELEVATOR_NORMAL),
                     startPos=ElevatorUtils.getRightOpenPoint(ElevatorConstants.ELEVATOR_NORMAL),
                     blendType="easeIn",
                 ),
             )
         )
         self._ival.start()
     else:
         ElevatorUtils.closeDoors(self._leftDoor, self._rightDoor, type=ElevatorConstants.ELEVATOR_NORMAL)
     self._open = False
コード例 #4
0
    def __playReservesJoining(self, ts, name, callback):
        # Position the joining suits
        index = 0
        assert (len(self.joiningReserves) <= 4)
        for suit in self.joiningReserves:
            suit.reparentTo(render)
            suit.setPos(
                self.elevatorModelOut,
                Point3(ElevatorPoints[index][0], ElevatorPoints[index][1],
                       ElevatorPoints[index][2]))
            index += 1
            suit.setH(180)
            suit.loop('neutral')

        if len(self.suits) == len(self.joiningReserves):
            camSequence = Sequence(Func(camera.wrtReparentTo, localAvatar),
                                   Func(camera.setPos, Point3(0, 5, 5)),
                                   Func(camera.headsUp, self.elevatorModelOut))
        else:
            camSequence = Sequence(
                Func(camera.wrtReparentTo, self.elevatorModelOut),
                Func(camera.setPos, Point3(0, -8, 2)),
                Func(camera.setHpr, Vec3(0, 10, 0)))

        # Aim the camera at the far elevator
        track = Sequence(
            Func(camera.wrtReparentTo, self.elevatorModelOut),
            Func(camera.setPos, Point3(0, -8, 2)),
            Func(camera.setHpr, Vec3(0, 10, 0)),

            # Open the elevator doors
            Parallel(
                SoundInterval(self.openSfx),
                LerpPosInterval(
                    self.leftDoorOut,
                    ElevatorData[ELEVATOR_NORMAL]['closeTime'],
                    Point3(0, 0, 0),
                    startPos=ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
                    blendType='easeOut'),
                LerpPosInterval(
                    self.rightDoorOut,
                    ElevatorData[ELEVATOR_NORMAL]['closeTime'],
                    Point3(0, 0, 0),
                    startPos=ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
                    blendType='easeOut'),
            ),

            # Hold the camera angle for a couple of beats
            Wait(SUIT_HOLD_ELEVATOR_TIME),

            # Reparent the camera to render (enterWaitForInput will
            # position it properly again by the battle)
            Func(camera.wrtReparentTo, render),
            Func(callback),
        )
        track.start(ts)
        self.activeIntervals[name] = track
コード例 #5
0
    def __playReservesJoining(self, ts, name, callback):
        index = 0
        for suit in self.joiningReserves:
            suit.reparentTo(render)
            suit.setPos(
                self.elevatorModelOut,
                Point3(ElevatorPoints[index][0], ElevatorPoints[index][1], ElevatorPoints[index][2]),
            )
            index += 1
            suit.setH(180)
            suit.loop("neutral")

        if len(self.suits) == len(self.joiningReserves):
            camSequence = Sequence(
                Func(camera.wrtReparentTo, localAvatar),
                Func(camera.setPos, Point3(0, 5, 5)),
                Func(camera.headsUp, self.elevatorModelOut),
            )
        else:
            camSequence = Sequence(
                Func(camera.wrtReparentTo, self.elevatorModelOut),
                Func(camera.setPos, Point3(0, -8, 2)),
                Func(camera.setHpr, Vec3(0, 10, 0)),
            )
        track = Sequence(
            camSequence,
            Parallel(
                SoundInterval(self.openSfx),
                LerpPosInterval(
                    self.leftDoorOut,
                    ElevatorData[ELEVATOR_NORMAL]["closeTime"],
                    Point3(0, 0, 0),
                    startPos=ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
                    blendType="easeOut",
                ),
                LerpPosInterval(
                    self.rightDoorOut,
                    ElevatorData[ELEVATOR_NORMAL]["closeTime"],
                    Point3(0, 0, 0),
                    startPos=ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
                    blendType="easeOut",
                ),
            ),
            Wait(SUIT_HOLD_ELEVATOR_TIME),
            Func(camera.wrtReparentTo, render),
            Func(callback),
        )
        track.start(ts)
        self.activeIntervals[name] = track
コード例 #6
0
 def __playCloseElevatorOut(self, name, delay=0):
     track = Sequence(
         Wait(delay + SUIT_LEAVE_ELEVATOR_TIME),
         Parallel(
             SoundInterval(self.closeSfx),
             LerpPosInterval(
                 self.leftDoorOut,
                 ElevatorData[ELEVATOR_NORMAL]['closeTime'],
                 ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
                 startPos=Point3(0, 0, 0),
                 blendType='easeOut'),
             LerpPosInterval(
                 self.rightDoorOut,
                 ElevatorData[ELEVATOR_NORMAL]['closeTime'],
                 ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
                 startPos=Point3(0, 0, 0),
                 blendType='easeOut')))
     track.start()
     self.activeIntervals[name] = track
コード例 #7
0
 def __playCloseElevatorOut(self, name, delay=0):
     track = Sequence(
         Wait(delay + SUIT_LEAVE_ELEVATOR_TIME),
         Parallel(
             SoundInterval(self.closeSfx),
             LerpPosInterval(
                 self.leftDoorOut,
                 ElevatorData[ELEVATOR_NORMAL]["closeTime"],
                 ElevatorUtils.getLeftClosePoint(ELEVATOR_NORMAL),
                 startPos=Point3(0, 0, 0),
                 blendType="easeOut",
             ),
             LerpPosInterval(
                 self.rightDoorOut,
                 ElevatorData[ELEVATOR_NORMAL]["closeTime"],
                 ElevatorUtils.getRightClosePoint(ELEVATOR_NORMAL),
                 startPos=Point3(0, 0, 0),
                 blendType="easeOut",
             ),
         ),
     )
     track.start()
     self.activeIntervals[name] = track