From 5e37c9a7034edfc4eec4d4ed15224b0f63c736af Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 21 Mar 2022 10:40:31 -0400 Subject: fancier textboxes --- src/sign.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/sign.cpp') diff --git a/src/sign.cpp b/src/sign.cpp index b9299d6..e488108 100644 --- a/src/sign.cpp +++ b/src/sign.cpp @@ -92,6 +92,8 @@ void Sign::update(size_t dt, Game& game) { } if (fullyRevealed) { + showNextArrow = false; + if (linesToShow.back().pause) { linesToShow.back().pause = false; // Play a sound @@ -126,6 +128,27 @@ void Sign::update(size_t dt, Game& game) { } linesToShow.push_back(lines.front()); lines.pop_front(); + } else { + showNextArrow = true; + } + } + } + + if (showNextArrow) { + nextArrowBobTimer_.accumulate(dt); + while (nextArrowBobTimer_.step()) { + if (nextArrowBobDown_) { + nextArrowBobPos++; + + if (nextArrowBobPos >= 4) { + nextArrowBobDown_ = false; + } + } else { + nextArrowBobPos--; + + if (nextArrowBobPos <= 0) { + nextArrowBobDown_ = true; + } } } } -- cgit 1.4.1