Skip to content

Commit

Permalink
Fixed #9 - Sound effects are not overlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
lvcabral committed Sep 24, 2016
1 parent 8885bc3 commit 3933880
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions source/gameSounds.brs
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ Sub PlaySoundWav(clip as string, overlap = false as boolean, volume = 75 as inte
meta = g.sounds.metadata.clips.Lookup(clip)
if meta <> invalid and (meta.priority >= ctrl.priority or ctrl.cycles = 0)
sound = g.sounds.Lookup(clip)
if overlap or not sound.IsPlaying()
print "play sound wav: "; clip
StopSound()
sound.Trigger(volume)
ctrl.clip = clip
ctrl.priority = meta.priority
ctrl.cycles = cint(meta.duration / g.speed)
g.sounds.wav = ctrl
end if
'print "play sound wav: "; clip
StopSound()
sound.Trigger(volume)
ctrl.clip = clip
ctrl.priority = meta.priority
ctrl.cycles = cint(meta.duration / g.speed)
g.sounds.wav = ctrl
end if
End Sub

Expand Down

0 comments on commit 3933880

Please sign in to comment.