Merge pull request #145 from pansythoughts/main

kind of fixed how game_speed behaves
This commit is contained in:
MeirGavish
2025-10-14 13:57:40 +03:00
committed by GitHub
3 changed files with 19 additions and 5 deletions
+13 -3
View File
@@ -63,7 +63,7 @@ typedef enum
static uint rng_seed = 0;
static uint timer = 0; // This might already exist in libtonc but idk so i'm just making my own
static int game_speed = 1;
static int game_speed = 1; // BY DEFAULT IS SET TO 1, but if changed to 2 or more, should speed up all (or most) of the game aspects that should be sped up by speed, as in the original game.
static int background = 0;
static enum GameState game_state = GAME_SPLASH_SCREEN; // The current game state, this is used to determine what the game is doing at any given time
@@ -235,6 +235,16 @@ int get_num_hands_remaining(void)
{
return hands;
}
int get_game_speed(void)
{
return game_speed;
}
// for the future when a menu actually lets this variable be changed.
void set_game_speed(int new_game_speed)
{
game_speed = new_game_speed;
}
int get_money(void)
{
@@ -1441,8 +1451,8 @@ static void game_playing_process_input_and_state()
}
else if (play_state == PLAY_ENDED)
{
lerped_temp_score -= int2fx(temp_score) / 40;
lerped_score += int2fx(temp_score) / 40;
lerped_temp_score -= int2fx(temp_score * get_game_speed())/ 40;
lerped_score += int2fx(temp_score * get_game_speed()) / 40;
if (lerped_temp_score > 0)
{