forked from PAK9/PicoWorldRace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsound.lua
44 lines (40 loc) · 771 Bytes
/
sound.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
-- Sound.lua ---------------------------------------
Chan0=-1
function UpdateRaceSound()
-- channel 0
-- player
tgtsnd=-1
if RecoverStage == 0 and RaceState < 3 and TitleState==2 then
if (PlayerDrift != 0 or IsBurnout()) and PlayerAir == 0 then -- z / btn1)
tgtsnd=3
elseif PlayerVl < 0.8 then
tgtsnd=0
elseif btn(4)==false then -- z / btn1
tgtsnd=4
elseif PlayerAir > 0 then
tgtsnd=12
else
if PlayerVl > 7 then
tgtsnd=2
else
tgtsnd=1
end
end
end
if Chan0 != tgtsnd then
if Chan0 != -1 then
sfx(-1,0)
end
if tgtsnd != -1 then
sfx(tgtsnd,0)
end
end
Chan0=tgtsnd
-- channel 1
-- offroad
if RecoverStage == 0 and RaceState < 3 and IsOffRoad() and PlayerVl > 0.5 then
sfx(5,1)
else
sfx(-1,1)
end
end