Beispiel #1
0
    def OnInit(self, cbInfo):
        # create score text
        self.textToShow.extend([
            'Welcome to The Jasper',
            'Help us get rid of these scary monsters...',
            'Find all {0} monsters'.format(self.paranormalTotal)
        ])
        # self.scoreText = VRScript.Core.FontText('Score', 'You have caught {0} out of {1} ghosts'.format(self.paranormalCaptured,self.paranormalTotal))
        print("Init textToShow: ", self.textToShow)
        self.scoreText = VRScript.Core.FontText('Score',
                                                self.textToShow.pop(0),
                                                "Edward.TTF")
        self.scoreText.setColor(VRScript.Core.Color(1, 1, 0, self.textAlpha))
        self.scoreText.setHeight(.12)
        self.scoreText.show()
        self.attach(self.scoreText)

        # attach score text to user such that it is visible at all times
        self.movable().setParent('User0Head')
        m = self.movable().getPose()
        m.preTranslation(VRScript.Math.Vector(0, .75, .45))
        self.movable().setPose(m)

        # sets up background music
        for i in range(len(self.bkgMusicFiles)):
            # aud = VRScript.Core.Audible("{0}_bkg{1}".format(self.name,i),self.bkgMusicFiles[i])
            aud = Animation.AudioObj("{0}_bkg{1}".format(self.name, i),
                                     self.bkgMusicFiles[i])
            self.bkgMusic.append(aud)
            print(str(aud))
            self.attach(aud.MakeAudible())
        self.bkgMusicIndex = len(
            self.bkgMusic) - 1  # always begin with track 1
Beispiel #2
0
 def __init__(self, sName, sMeshName, position, isOpen, openAngle):
     lel_common.GenericObject.__init__(self, sName,
                                       JasperConfig.ModelsDir + sMeshName,
                                       position, True, True, "Concave",
                                       True, "Static")
     self.isOpen = isOpen
     self.openAngle = openAngle
     self.soundFX = Animation.AudioObj(sName + "_fx", "door.wav")
Beispiel #3
0
 def __init__(self, sName, sMeshName, position, isOpen, openAngle):
     lel_common.GenericObject.__init__(self, sName,
                                       JasperConfig.ModelsDir + sMeshName,
                                       position, True, True, "Concave",
                                       True, "Dynamic")
     self.isOpen = isOpen
     self.openAngle = openAngle
     self.soundFX = Animation.AudioObj(sName + "_fx", "door.wav")
     self.soundFX.SetParent(self)
     self.slaveDoors = []
     self.masterDoorPtr = None
     self.preAngles = [0, 0, 0]
Beispiel #4
0
 def SetBumpedSound(self, file):
     self.bumpedSound = Animation.AudioObj(sName + "_BumpedSound", file)
Beispiel #5
0
 def SetDiscoveredSound(self, file, loop=True):
     self.discoveredAudio = Animation.AudioObj(self.name + "_discovered",
                                               file, loop)
     print("Set discovered audio for " + str(self) + " to " + file)
Beispiel #6
0
 def SetCapturedSound(self, file, loop=False):
     self.capturedAudio = Animation.AudioObj(self.name + "_captured", file,
                                             loop)
     print("Set discovered audio for " + str(self) + " to " + file)