aboutsummaryrefslogtreecommitdiff
path: root/game/hud
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-10 14:50:50 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2025-01-10 14:50:50 +0100
commit7aa07561a52016007ff852acefa4db68260f0f1e (patch)
treeac438e906e581ee68f9d065dea90a2cbb8436d15 /game/hud
parentd7c8cc30e1d37526cf142f950038500b96760514 (diff)
parent0f8bf257d86b5532f3d6f559e5368668c255af7c (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/game-improvements
Diffstat (limited to 'game/hud')
-rw-r--r--game/hud/HudScript.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/game/hud/HudScript.cpp b/game/hud/HudScript.cpp
index 8f77706..e4aeae7 100644
--- a/game/hud/HudScript.cpp
+++ b/game/hud/HudScript.cpp
@@ -3,6 +3,8 @@
#include "../Config.h"
#include "../Events.h"
+#include "api/KeyCodes.h"
+#include "menus/endgame/EndGameSubScript.h"
#include <climits>
@@ -36,7 +38,7 @@ void HudScript::init() {
}
bool HudScript::toggle_fps(crepe::KeyPressEvent ev) {
- if (ev.key != Keycode::END) return false;
+ if (ev.key != Keycode::D1) return false;
Text & txt_fps = this->get_components_by_name<Text>(HUD_FPS).front();
this->show_fps = !this->show_fps;
if (this->show_fps) {
@@ -91,5 +93,6 @@ bool HudScript::save() {
SaveManager & savemgr = this->get_save_manager();
savemgr.set(TOTAL_COINS_RUN, this->coin_amount);
savemgr.set(DISTANCE_RUN, this->distance_st);
+ this->trigger_event<ShowScoreEvent>();
return false;
}