Skip to content

Commit

Permalink
mark score
Browse files Browse the repository at this point in the history
  • Loading branch information
Alx-Lai authored and john0312 committed Aug 17, 2024
1 parent 30accc3 commit 02f5097
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fw/Core/Hitcon/App/DinoApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <App/ShowScoreApp.h>
#include <Logic/BadgeController.h>
#include <Logic/Display/display.h>
#include <Logic/GameScore.h>
#include <Logic/RandomPool.h>
#include <Service/Sched/Scheduler.h>
#include <Util/uint_to_str.h>
Expand Down Expand Up @@ -170,6 +171,7 @@ bool DinoApp::dinoDied() {

inline void DinoApp::gameOver() {
show_score_app.SetScore(_score);
g_game_score.MarkScore(GameScoreType::GAME_DINO, _score);
badge_controller.change_app(&show_score_app);
}

Expand Down
2 changes: 2 additions & 0 deletions fw/Core/Hitcon/App/SnakeApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <App/ShowScoreApp.h>
#include <App/SnakeApp.h>
#include <Logic/BadgeController.h>
#include <Logic/GameScore.h>
#include <Logic/RandomPool.h>
#include <Logic/XBoardLogic.h>
#include <Service/Sched/Scheduler.h>
Expand Down Expand Up @@ -190,6 +191,7 @@ void SnakeApp::Routine(void* unused) {

if (_game_over) {
show_score_app.SetScore(_score);
g_game_score.MarkScore(GameScoreType::GAME_SNAKE, _score);
if (mode == MODE_MULTIPLAYER) {
uint8_t code = PACKET_GAME_OVER;
g_xboard_logic.QueueDataForTx(&code, 1, SNAKE_RECV_ID);
Expand Down
3 changes: 3 additions & 0 deletions fw/Core/Hitcon/App/TetrisApp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <App/ShowScoreApp.h>
#include <Logic/BadgeController.h>
#include <Logic/Display/display.h>
#include <Logic/GameScore.h>
#include <Logic/RandomPool.h>
#include <Logic/XBoardLogic.h>
#include <Service/Sched/SysTimer.h>
Expand Down Expand Up @@ -87,6 +88,7 @@ void TetrisApp::OnXboardRecv(void *arg) {
game.game_force_over();

show_score_app.SetScore(game.game_get_score());
g_game_score.MarkScore(GameScoreType::GAME_TETRIS, _score);
badge_controller.change_app(&show_score_app);
break;

Expand Down Expand Up @@ -174,6 +176,7 @@ void TetrisApp::periodic_task_callback(void *) {
}

show_score_app.SetScore(game.game_get_score());
g_game_score.MarkScore(GameScoreType::GAME_TETRIS, _score);
badge_controller.change_app(&show_score_app);
break;
}
Expand Down

0 comments on commit 02f5097

Please sign in to comment.