Added fitting menu sfx

This commit is contained in:
Hailey 2020-10-10 07:50:05 +10:00
parent 4cb20101b0
commit 629beb7240
7 changed files with 13 additions and 2 deletions

View File

@ -10,6 +10,10 @@ sounds = {
}, },
move = love.audio.newSource("res/se/move.wav", "static"), move = love.audio.newSource("res/se/move.wav", "static"),
bottom = love.audio.newSource("res/se/bottom.wav", "static"), bottom = love.audio.newSource("res/se/bottom.wav", "static"),
cursor = love.audio.newSource("res/se/cursor.wav", "static"),
cursor_lr = love.audio.newSource("res/se/cursor_lr.wav", "static"),
main_decide = love.audio.newSource("res/se/main_decide.wav", "static"),
mode_decide = love.audio.newSource("res/se/mode_decide.wav", "static"),
} }
function playSE(sound, subsound) function playSE(sound, subsound)

BIN
res/se/cursor.wav Normal file

Binary file not shown.

BIN
res/se/cursor_lr.wav Normal file

Binary file not shown.

BIN
res/se/main_decide.wav Normal file

Binary file not shown.

BIN
res/se/mode_decide.wav Normal file

Binary file not shown.

View File

@ -92,15 +92,19 @@ function ModeSelectScene:onKeyPress(e)
current_ruleset = self.menu_state.ruleset current_ruleset = self.menu_state.ruleset
config.current_mode = current_mode config.current_mode = current_mode
config.current_ruleset = current_ruleset config.current_ruleset = current_ruleset
playSE("mode_decide")
saveConfig() saveConfig()
scene = GameScene(game_modes[self.menu_state.mode], rulesets[self.menu_state.ruleset]) scene = GameScene(game_modes[self.menu_state.mode], rulesets[self.menu_state.ruleset])
elseif (e.scancode == config.input["up"] or e.scancode == "up") and e.isRepeat == false then elseif (e.scancode == config.input["up"] or e.scancode == "up") and e.isRepeat == false then
self:changeOption(-1) self:changeOption(-1)
playSE("cursor")
elseif (e.scancode == config.input["down"] or e.scancode == "down") and e.isRepeat == false then elseif (e.scancode == config.input["down"] or e.scancode == "down") and e.isRepeat == false then
self:changeOption(1) self:changeOption(1)
playSE("cursor")
elseif (e.scancode == config.input["left"] or e.scancode == "left") or elseif (e.scancode == config.input["left"] or e.scancode == "left") or
(e.scancode == config.input["right"] or e.scancode == "right") then (e.scancode == config.input["right"] or e.scancode == "right") then
self:switchSelect() self:switchSelect()
playSE("cursor_lr")
elseif e.scancode == "escape" then elseif e.scancode == "escape" then
scene = TitleScene() scene = TitleScene()
end end

View File

@ -39,11 +39,14 @@ end
function TitleScene:onKeyPress(e) function TitleScene:onKeyPress(e)
if e.scancode == "return" and e.isRepeat == false then if e.scancode == "return" and e.isRepeat == false then
playSE("main_decide")
scene = main_menu_screens[self.main_menu_state]() scene = main_menu_screens[self.main_menu_state]()
elseif (e.scancode == config.input["up"] or e.scancode == "up") and e.isRepeat == false then elseif (e.scancode == config.input["up"] or e.scancode == "up") and e.isRepeat == false then
self:changeOption(-1) self:changeOption(-1)
playSE("cursor")
elseif (e.scancode == config.input["down"] or e.scancode == "down") and e.isRepeat == false then elseif (e.scancode == config.input["down"] or e.scancode == "down") and e.isRepeat == false then
self:changeOption(1) self:changeOption(1)
playSE("cursor")
elseif e.scancode == "escape" and e.isRepeat == false then elseif e.scancode == "escape" and e.isRepeat == false then
love.event.quit() love.event.quit()
end end