aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-05-08 13:18:51 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-05-08 13:18:51 +0530
commit40b0feb0a97293866911eb9aab4cb1f495315dc8 (patch)
treea541e44291ea95874595402bd7c08abddc5e850f /src/main.cpp
parente92871066a6aa0efeb616372bdd7aa096eb654ea (diff)
downloadsnek-40b0feb0a97293866911eb9aab4cb1f495315dc8.tar.gz
snek-40b0feb0a97293866911eb9aab4cb1f495315dc8.tar.bz2
snek-40b0feb0a97293866911eb9aab4cb1f495315dc8.zip
Added some more details to the side screen
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index a8fe5f0..a43c68e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -374,16 +374,21 @@ int main(void)
BeginDrawing();
ClearBackground(BLACK);
state.draw_grid();
- DrawText("TIME", 0, 0, 25, YELLOW);
DrawText(
- Time(chrono::duration_cast<chrono::seconds>(Clock::now() - beg).count())
+ Time(chrono::duration_cast<chrono::seconds>(Clock::now() - time_start)
+ .count())
.to_str()
.c_str(),
- 0, 25, 25, YELLOW);
+ 0, 0, 25, YELLOW);
std::stringstream ss;
ss << "Score: ";
ss << state.player.points.size() - 1;
+ DrawText(ss.str().c_str(), 0, 25, 20, YELLOW);
+
+ ss.str("");
+ ss << "Next: ";
+ ss << fruit_delta(state.player.points.size());
DrawText(ss.str().c_str(), 0, 50, 20, YELLOW);
EndDrawing();