-
Notifications
You must be signed in to change notification settings - Fork 0
/
sound.lua
66 lines (50 loc) · 2.02 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
sound = {}
function sound.load()
sound.enabled = false
sound.menu = {
pick = love.audio.newSource("sounds/pick.wav", "static"),
select = love.audio.newSource("sounds/select.wav", "static"),
}
sound.player = {}
sound.player.step = {
ground = love.audio.newSource("sounds/playerstepground.wav", "static"),
forest = love.audio.newSource("sounds/playerstepforest.wav", "static"),
building = love.audio.newSource("sounds/playerstepbuilding.wav", "static"),
water = love.audio.newSource("sounds/playerstepwater.wav", "static")
}
sound.monster = {
step = love.audio.newSource("sounds/enemystep.wav", "static")
}
sound.door = {
open = love.audio.newSource("sounds/dooropen.wav", "static"),
closed = love.audio.newSource("sounds/doorclosed.wav", "static")
}
sound.pickup = love.audio.newSource("sounds/pickup.wav", "static")
sound.death = love.audio.newSource("sounds/death.wav", "static")
sound.shot = love.audio.newSource("sounds/shot.wav", "static")
sound.last = love.audio.newSource("sounds/end.wav", "static")
sound.intro = love.audio.newSource("sounds/intro.wav", "static")
sound.intro:setLooping(true)
sound.logo = love.audio.newSource("sounds/logo.wav", "static")
sound.start = love.audio.newSource("sounds/start.wav", "static")
sound.screen = love.audio.newSource("sounds/screen.wav", "static")
sound.cycle = love.audio.newSource("sounds/cycle.wav", "static")
sound.tip = {
show = love.audio.newSource("sounds/tipshow.wav", "static"),
hide = love.audio.newSource("sounds/tiphide.wav", "static")
}
sound.day = love.audio.newSource("sounds/day.wav", "static")
sound.day:setLooping(true)
sound.night = love.audio.newSource("sounds/night.wav", "static")
sound.night:setLooping(true)
end
function sound.play(sound)
if sound.enabled then
sound:stop()
sound:seek(0)
sound:play()
end
end
function sound.stop(sound)
sound:stop()
end