summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/menu_system.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/menu_system.cpp b/src/menu_system.cpp index aaaa0e1..a6fd566 100644 --- a/src/menu_system.cpp +++ b/src/menu_system.cpp
@@ -53,21 +53,27 @@ void MenuSystem::closePauseMenu() {
53} 53}
54 54
55void MenuSystem::pressedUp() { 55void MenuSystem::pressedUp() {
56 if (cursor_ > 0) { 56 cursor_--;
57 cursor_--;
58 cursorBob_ = 0;
59 cursorBobDown_ = true;
60 57
61 game_.getMixer().playSound("../res/sfx/vertical_menu.wav"); 58 if (cursor_ < 0) {
59 cursor_ = menu_.size() - 1;
62 } 60 }
61
62 cursorBob_ = 0;
63 cursorBobDown_ = true;
64
65 game_.getMixer().playSound("../res/sfx/vertical_menu.wav");
63} 66}
64 67
65void MenuSystem::pressedDown() { 68void MenuSystem::pressedDown() {
66 if (cursor_ < menu_.size() - 1) { 69 cursor_++;
67 cursor_++;
68 cursorBob_ = 0;
69 cursorBobDown_ = true;
70 70
71 game_.getMixer().playSound("../res/sfx/vertical_menu.wav"); 71 if (cursor_ >= menu_.size()) {
72 cursor_ = 0;
72 } 73 }
74
75 cursorBob_ = 0;
76 cursorBobDown_ = true;
77
78 game_.getMixer().playSound("../res/sfx/vertical_menu.wav");
73} 79}