mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
Music Tempo now changes in the races like in TTO
This commit is contained in:
parent
26bee34ec1
commit
2463b5cff8
1 changed files with 3 additions and 6 deletions
|
@ -550,14 +550,14 @@ class DistributedRace(DistributedObject.DistributedObject):
|
|||
newLapT = (newT - self.startT) / self.curve.getMaxT() % 1.0
|
||||
if newLapT - self.currLapT < -0.5:
|
||||
self.laps += 1
|
||||
self.changeMusicTempo(1 + self.laps * 0.5)
|
||||
self.changeMusicTempo(1 + self.laps * 0.33)
|
||||
self.notify.debug('crossed the start line: %s, %s, %s, %s' % (self.laps,
|
||||
self.startT,
|
||||
self.currT,
|
||||
newT))
|
||||
elif newLapT - self.currLapT > 0.5:
|
||||
self.laps -= 1
|
||||
self.changeMusicTempo(1 + self.laps * 0.5)
|
||||
self.changeMusicTempo(1 + self.laps * 0.33)
|
||||
self.notify.debug('crossed the start line - wrong way: %s, %s, %s, %s' % (self.laps,
|
||||
self.startT,
|
||||
self.currT,
|
||||
|
@ -1211,12 +1211,9 @@ class DistributedRace(DistributedObject.DistributedObject):
|
|||
self.musicTrack.start()
|
||||
|
||||
def changeMusicTempo(self, newPR):
|
||||
return # TODO: Reenable when we have music change support.
|
||||
if self.musicTrack:
|
||||
self.musicTrack.finish()
|
||||
curPR = self.raceMusic.getPlayRate()
|
||||
interval = LerpFunctionInterval(self.raceMusic.setPlayRate, fromData=curPR, toData=newPR, duration=3)
|
||||
self.musicTrack = Sequence(interval)
|
||||
self.musicTrack = Sequence(LerpFunctionInterval(self.raceMusic.setPlayRate, fromData=self.raceMusic.getPlayRate(), toData=newPR, duration=3))
|
||||
self.musicTrack.start()
|
||||
|
||||
def setRaceZone(self, zoneId, trackId):
|
||||
|
|
Loading…
Reference in a new issue