From f839e07d4d2e94070129129c669072145235cf4f Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 13 Mar 2021 09:29:47 -0500 Subject: Added cursor to pause menu #7 --- src/menu_system.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/menu_system.cpp') diff --git a/src/menu_system.cpp b/src/menu_system.cpp index 00c4849..acbfd76 100644 --- a/src/menu_system.cpp +++ b/src/menu_system.cpp @@ -12,6 +12,23 @@ void MenuSystem::tick(double dt) { } else if (pauseAnimation_.getProgress() == 1.0) { openState_ = OpenState::Open; } + } else if (openState_ == OpenState::Open) { + cursorBobTimer_.accumulate(dt); + while (cursorBobTimer_.step()) { + if (cursorBobDown_) { + cursorBob_++; + + if (cursorBob_ >= 4) { + cursorBobDown_ = false; + } + } else { + cursorBob_--; + + if (cursorBob_ <= 0) { + cursorBobDown_ = true; + } + } + } } } -- cgit 1.4.1