use the resource table for audio samples

This commit is contained in:
Hersi 2022-03-29 04:27:12 +02:00
parent f227df0dee
commit 7704c45dd0
1 changed files with 7 additions and 7 deletions

View File

@ -351,7 +351,7 @@ end
local function render(deltaTime)
if not playedBgm then
game.PlaySample("titlescreen/bgm.wav", true)
game.PlaySample(resources.audiosamples.bgm, true)
playedBgm = true
end
@ -387,15 +387,15 @@ local function onKnobsChange(direction)
if ((cursorIndex > oldCursorIndex and not (cursorIndex == 6 and oldCursorIndex == 1)) or
(cursorIndex == 1 and oldCursorIndex == 6)) then scrollingUp = true end
game.PlaySample("titlescreen/cursor_change.wav")
game.PlaySample(resources.audiosamples.cursorChange)
oldCursorIndex = cursorIndex
end
local function onButtonPressed(button)
if button == game.BUTTON_STA then
game.PlaySample("titlescreen/cursor_select.wav")
game.StopSample("titlescreen/bgm.wav")
game.PlaySample(resources.audiosamples.cursorSelect)
game.StopSample(resources.audiosamples.bgm)
callButtonAction()
@ -418,8 +418,8 @@ local function onMousePressed(button)
if util.areaOverlap(mousePosX, mousePosY,
miscButtons.mainButton.x, miscButtons.mainButton.y, miscButtons.mainButton.w, miscButtons.mainButton.h) then
game.StopSample("titlescreen/bgm.wav")
game.PlaySample("titlescreen/cursor_select.wav")
game.StopSample(resources.audiosamples.bgm)
game.PlaySample(resources.audiosamples.cursorSelect)
callButtonAction()
return
@ -453,7 +453,7 @@ local function onMousePressed(button)
end
cursorIndex = (cursorIndex - 1 + changeIndex) % #buttons + 1
game.PlaySample("titlescreen/cursor_change.wav")
game.PlaySample(resources.audiosamples.cursorChange)
end