From 2581f03c00f5a14f49081d82eb8e1a31c31aae88 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 13 Mar 2021 09:38:05 -0500 Subject: Player can move cursor on pause menu #7 --- src/menu_system.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/menu_system.cpp') diff --git a/src/menu_system.cpp b/src/menu_system.cpp index acbfd76..d3a310e 100644 --- a/src/menu_system.cpp +++ b/src/menu_system.cpp @@ -49,3 +49,23 @@ void MenuSystem::closePauseMenu() { pauseAnimation_.start(125, 0.0); openState_ = OpenState::Animating; } + +void MenuSystem::pressedUp() { + if (cursor_ > 0) { + cursor_--; + cursorBob_ = 0; + cursorBobDown_ = true; + + game_.getMixer().playSound("../res/sfx/vertical_menu.wav"); + } +} + +void MenuSystem::pressedDown() { + if (cursor_ < menu_.size() - 1) { + cursor_++; + cursorBob_ = 0; + cursorBobDown_ = true; + + game_.getMixer().playSound("../res/sfx/vertical_menu.wav"); + } +} -- cgit 1.4.1