Completed functionality of the small blind

This commit is contained in:
cellos51
2025-06-13 15:10:19 -04:00
parent 5055c9abc7
commit ac24754380
4 changed files with 31 additions and 12 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

+27 -8
View File
@@ -16,6 +16,9 @@ static int discard = 4;
static int score = 0;
static int temp_score = 0; // This is the score that shows in the same spot as the hand type.
static FIXED lerped_score = 0;
static FIXED lerped_temp_score = 0;
static int chips = 0;
static int mult = 0;
@@ -156,7 +159,10 @@ void game_init()
tte_printf("#{P:128,128; cx:0}%d/%d", hand_get_size(), hand_get_max_size()); // Hand size/max size
tte_printf("#{P:200,152}%d/%d", deck_get_size(), deck_get_max_size()); // Deck size/max size
tte_printf("#{P:32,48;}*%d", 0); // Score
tte_printf("#{P:40,24; cx:0x3000}%d", 300); // Blind requirement
tte_printf("#{P:40,32; cx:0x1000}$3"); // Blind reward
tte_printf("#{P:32,48; cx:0}%d", 0); // Score
tte_printf("#{P:24,80;}%d", 0); // Chips
tte_printf("#{P:40,80;}%d", 0); // Mult
@@ -230,6 +236,8 @@ void game_update()
if (mult > 0)
{
temp_score = chips * mult;
lerped_temp_score = int2fx(temp_score);
lerped_score = int2fx(score);
tte_erase_rect(8, 64, 64, 72);
tte_printf("#{P:8,64;}%d", temp_score); // Score
@@ -242,22 +250,33 @@ void game_update()
}
else if (play_get_state() == PLAY_ENDED)
{
if (temp_score > 0)
{
score += temp_score;
temp_score = 0;
lerped_temp_score -= int2fx(temp_score) / 40;
lerped_score += int2fx(temp_score) / 40;
if (lerped_temp_score > 0)
{
tte_erase_rect(8, 64, 64, 72);
tte_printf("#{P:8,64;}%d", temp_score); // Score
tte_printf("#{P:8,64;}%d", fx2int(lerped_temp_score)); // Temp Score
tte_erase_rect(32, 48, 64, 56);
tte_printf("#{P:32,48;}%d", score); // Score
// We actually don't need to erase this because the score only increases
tte_printf("#{P:32,48;}%d", fx2int(lerped_score)); // Score
if (temp_score <= 0)
{
tte_erase_rect(8, 64, 64, 72);
}
}
else
{
score += temp_score;
temp_score = 0;
lerped_temp_score = 0;
lerped_score = 0;
tte_erase_rect(8, 64, 64, 72); // Just erase the temp score
tte_printf("#{P:32,48;}%d", score); // Score
}
}
static int last_hand_size = 0;
+4 -4
View File
@@ -37,13 +37,13 @@ void init()
memcpy(pal_obj_mem, deck_gfxPal, deck_gfxPalLen);
// Initialize text engine
tte_init_se(1, BG_CBB(1) | BG_SBB(31), 0, CLR_WHITE, 11, NULL, NULL);
tte_init_se(1, BG_CBB(1) | BG_SBB(31), 0, CLR_WHITE, 14, NULL, NULL);
tte_erase_screen();
tte_init_con();
pal_bg_bank[1][12] = 0x029F; // honestly fuck libtonc because i cannot figure out how you're supposed to select a color from the palette index so i'm doing it like this
pal_bg_bank[2][12] = pal_bg_bank[0][11];
pal_bg_bank[3][12] = pal_bg_bank[0][2];
pal_bg_bank[1][15] = 0x029F; // Yellow. honestly fuck libtonc because i cannot figure out how you're supposed to select a color from the palette index so i'm doing it like this
pal_bg_bank[2][15] = 0x7E40; // Blue
pal_bg_bank[3][15] = 0x213F; // Red
// Initialize subsystems
sprite_init();