GAME_LOSE state

This commit is contained in:
expected-ingot
2025-06-30 14:16:07 +02:00
parent c58b569516
commit c8f2e96572
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -16,7 +16,8 @@ enum GameState
GAME_PLAYING,
GAME_ROUND_END,
GAME_SHOP,
GAME_BLIND_SELECT
GAME_BLIND_SELECT,
GAME_LOSE,
};
enum HandState
+8 -1
View File
@@ -19,7 +19,7 @@ static int timer = 1; // This might already exist in libtonc but idk so i'm just
static int game_speed = 1;
static int background = 0;
static enum GameState game_state = GAME_ROUND_END;
static enum GameState game_state = GAME_PLAYING;
static enum HandState hand_state = HAND_DRAW;
static enum PlayState play_state = PLAY_PLAYING;
@@ -1233,6 +1233,10 @@ static void game_playing_ui_text_update()
void game_playing()
{
if (hand_state == HAND_SELECT && hands == 0) {
game_state = GAME_LOSE;
}
// Background logic (thissss might be moved to the card'ssss logic later. I'm a sssssnake)
if (hand_state == HAND_DRAW || hand_state == HAND_DISCARD || hand_state == HAND_SELECT)
{
@@ -1346,5 +1350,8 @@ void game_update()
case GAME_BLIND_SELECT:
// Handle blind select logic here
break;
case GAME_LOSE:
// Handle lose logic here
break;
}
}