Sound effects for score accumulation and blind menu pop-up (#313)
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -5,7 +5,7 @@ DEF_STATE_INFO(GAME_STATE_MAIN_MENU, game_main_menu_on_init, game_main_menu_on_u
|
||||
DEF_STATE_INFO(GAME_STATE_PLAYING, game_round_on_init, game_playing_on_update, noop)
|
||||
DEF_STATE_INFO(GAME_STATE_ROUND_END, noop, game_round_end_on_update, game_round_end_on_exit)
|
||||
DEF_STATE_INFO(GAME_STATE_SHOP, noop, game_shop_on_update, game_shop_on_exit)
|
||||
DEF_STATE_INFO(GAME_STATE_BLIND_SELECT, noop, game_blind_select_on_update, game_blind_select_on_exit)
|
||||
DEF_STATE_INFO(GAME_STATE_BLIND_SELECT, game_blind_select_on_init, game_blind_select_on_update, game_blind_select_on_exit)
|
||||
DEF_STATE_INFO(GAME_STATE_LOSE, game_lose_on_init, game_lose_on_update, game_over_on_exit)
|
||||
DEF_STATE_INFO(GAME_STATE_WIN, game_win_on_init, game_win_on_update, game_over_on_exit)
|
||||
// clang-format on
|
||||
|
||||
+28
-1
@@ -195,6 +195,7 @@ static void game_round_end_on_update(void);
|
||||
static void game_round_end_on_exit(void);
|
||||
static void game_shop_on_update(void);
|
||||
static void game_shop_on_exit(void);
|
||||
static void game_blind_select_on_init(void);
|
||||
static void game_blind_select_on_update(void);
|
||||
static void game_blind_select_on_exit(void);
|
||||
static void game_lose_on_init(void);
|
||||
@@ -2675,8 +2676,18 @@ static inline void play_ending_played_cards_update(int played_idx)
|
||||
{
|
||||
scored_card_index--;
|
||||
|
||||
/* SFX_CHIPS_ACCUM has been pitch shifted to perserve high frequencies in downsampling.
|
||||
* Now it needs to be pitch shifted back to the original frequency.
|
||||
*/
|
||||
int static const CHIPS_ACCUM_SFX_PITCH_RATIO = 2;
|
||||
|
||||
if (scored_card_index == 0)
|
||||
{
|
||||
play_sfx(
|
||||
SFX_CHIPS_ACCUM,
|
||||
CHIPS_ACCUM_SFX_PITCH_RATIO * MM_BASE_PITCH_RATE,
|
||||
SFX_DEFAULT_VOLUME
|
||||
);
|
||||
timer = TM_ZERO;
|
||||
play_state = PLAY_ENDED;
|
||||
}
|
||||
@@ -2815,6 +2826,16 @@ static inline void game_playing_process_input_and_state(void)
|
||||
mult = 0;
|
||||
display_mult();
|
||||
display_chips();
|
||||
|
||||
static const int SCORE_CALC_SFX_PITCH_SHIFT = -102; // -10% OF MM_BASE_PITCH_RATE
|
||||
static const int SCORE_CALC_SFX_VOLUME = 204; // 80% MM_FULL_VOLUME
|
||||
|
||||
// The chips calculation SFX is the same as button
|
||||
play_sfx(
|
||||
SFX_BUTTON,
|
||||
MM_BASE_PITCH_RATE + SCORE_CALC_SFX_PITCH_SHIFT,
|
||||
SCORE_CALC_SFX_VOLUME
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (play_state == PLAY_ENDED)
|
||||
@@ -4171,6 +4192,13 @@ static void game_shop_on_exit()
|
||||
increment_blind(BLIND_STATE_DEFEATED); // TODO: Move to game_round_end()?
|
||||
}
|
||||
|
||||
static void game_blind_select_on_init()
|
||||
{
|
||||
change_background(BG_BLIND_SELECT);
|
||||
|
||||
play_sfx(SFX_POP, MM_BASE_PITCH_RATE, SFX_DEFAULT_VOLUME);
|
||||
}
|
||||
|
||||
static void game_blind_select_on_update()
|
||||
{
|
||||
if (state_info[game_state].substate == BLIND_SELECT_MAX)
|
||||
@@ -4185,7 +4213,6 @@ static void game_blind_select_on_update()
|
||||
|
||||
static void game_blind_select_start_anim_seq()
|
||||
{
|
||||
change_background(BG_BLIND_SELECT);
|
||||
main_bg_se_copy_rect_1_tile_vert(POP_MENU_ANIM_RECT, SCREEN_UP);
|
||||
|
||||
for (int i = 0; i < BLIND_TYPE_MAX; i++)
|
||||
|
||||
Reference in New Issue
Block a user