Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 50d6271413 | |||
| 93e5302c60 | |||
| b03c6c3e56 | |||
| 074ba436cb | |||
| 2d685fcdb9 | |||
| ebc969603d | |||
| d0b3ce1bd0 | |||
| 97a83b20f6 |
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
+1
-1
Submodule External/tely updated: 07b3737cf4...f6c96fb653
+17
-10
@@ -449,6 +449,12 @@ void TELY_OS_DLLInit(TELY_OS *os)
|
||||
game->audio[FP_GameAudio_PortalDestroy] = os->funcs.load_audio(assets, DQN_STR8("Portal Destroy"), DQN_STR8("Data/Audio/portal_destroy.ogg"));
|
||||
game->audio[FP_GameAudio_Smooch] = os->funcs.load_audio(assets, DQN_STR8("Smooch"), DQN_STR8("Data/Audio/smooch.ogg"));
|
||||
game->audio[FP_GameAudio_Woosh] = os->funcs.load_audio(assets, DQN_STR8("Woosh"), DQN_STR8("Data/Audio/woosh.ogg"));
|
||||
game->audio[FP_GameAudio_GameStart] = os->funcs.load_audio(assets, DQN_STR8("Game Start"), DQN_STR8("Data/Audio/game_start.ogg"));
|
||||
game->audio[FP_GameAudio_PerryStart] = os->funcs.load_audio(assets, DQN_STR8("Perry Start"), DQN_STR8("Data/Audio/perry_start.ogg"));
|
||||
game->audio[FP_GameAudio_Ambience1] = os->funcs.load_audio(assets, DQN_STR8("Ambience one"), DQN_STR8("Data/Audio/ambience_1.ogg"));
|
||||
game->audio[FP_GameAudio_Ambience2] = os->funcs.load_audio(assets, DQN_STR8("Ambience two"), DQN_STR8("Data/Audio/ambience_2.ogg"));
|
||||
game->audio[FP_GameAudio_Music1] = os->funcs.load_audio(assets, DQN_STR8("Music one"), DQN_STR8("Data/Audio/music_1.ogg"));
|
||||
game->audio[FP_GameAudio_Music2] = os->funcs.load_audio(assets, DQN_STR8("Music two"), DQN_STR8("Data/Audio/music_2.ogg"));
|
||||
|
||||
// NOTE: Load sprite sheets ====================================================================
|
||||
os->user_data = game;
|
||||
@@ -2009,12 +2015,18 @@ static void FP_Update(TELY_OS *os, FP_Game *game, TELY_OSInput *input, TELY_Audi
|
||||
// haven't given the player cooldown yet, so we assign a timestamp for that
|
||||
if (game->play.wave_cooldown_timestamp_ms == 0) {
|
||||
game->play.wave_cooldown_timestamp_ms = game->play.clock_ms + FP_COOLDOWN_WAVE_TIME_MS;
|
||||
TELY_Audio_Fade(audio, game->bg_music1, TELY_AudioEffectFade_Out, 2000 /*fade_duration_ms*/);
|
||||
game->bg_music2 = TELY_Audio_Play(audio, game->audio[FP_GameAudio_Music2], 1.f);
|
||||
TELY_Audio_Fade(audio, game->bg_music2, TELY_AudioEffectFade_In, 2000 /*fade_duration_ms*/);
|
||||
} else {
|
||||
// NOTE: Check if cooldown has elapsed, the next wave can start if so
|
||||
if (game->play.clock_ms > game->play.wave_cooldown_timestamp_ms) {
|
||||
game->play.enemies_per_wave = DQN_MAX(5 * DQN_CAST(uint32_t)game->play.mob_spawners.size, DQN_CAST(uint32_t)(game->play.enemies_per_wave * 1.5));
|
||||
game->play.enemies_spawned_this_wave = 0; // Important! Reset the spawn count
|
||||
game->play.wave_cooldown_timestamp_ms = 0; // Important! We reset the timestamp for the next wave
|
||||
TELY_Audio_Fade(audio, game->bg_music2, TELY_AudioEffectFade_Out, 2000 /*fade_duration_ms*/);
|
||||
game->bg_music1 = TELY_Audio_Play(audio, game->audio[FP_GameAudio_Music1], 1.f);
|
||||
TELY_Audio_Fade(audio, game->bg_music1, TELY_AudioEffectFade_In, 2000 /*fade_duration_ms*/);
|
||||
|
||||
if (monkey_spawn && game->play.current_wave != 0) {
|
||||
// NOTE: We spawn a monkey at these wave intervals;
|
||||
@@ -2031,6 +2043,7 @@ static void FP_Update(TELY_OS *os, FP_Game *game, TELY_OSInput *input, TELY_Audi
|
||||
}
|
||||
|
||||
game->play.current_wave++;
|
||||
//TELY_Audio_Stop(audio, game->audio[FP_GameAudio_Music2]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -3020,6 +3033,7 @@ static void FP_Render(FP_Game *game, TELY_OS *os, TELY_Renderer *renderer, TELY_
|
||||
game->play.perry_join_splash_screen_shake_triggered = true;
|
||||
game->play.perry_join_flash_alpha = 1.f;
|
||||
game->play.perry_join_splash_screen_end_ms = game->play.clock_ms + 2000;
|
||||
TELY_Audio_Play(audio, game->audio[FP_GameAudio_PerryStart], 1.f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4123,8 +4137,10 @@ static void FP_Render(FP_Game *game, TELY_OS *os, TELY_Renderer *renderer, TELY_
|
||||
if (new_player.yes) {
|
||||
if (new_player.tutorial_requested) {
|
||||
game->play.state = FP_GameState_Tutorial;
|
||||
TELY_Audio_Play(audio, game->audio[FP_GameAudio_GameStart], 1.f);
|
||||
} else {
|
||||
game->play.state = FP_GameState_Play;
|
||||
TELY_Audio_Play(audio, game->audio[FP_GameAudio_GameStart], 1.f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -4445,16 +4461,6 @@ void TELY_OS_DLLFrameUpdate(TELY_OS *os)
|
||||
|
||||
// =============================================================================================
|
||||
|
||||
TELY_Audio *audio = &os->audio;
|
||||
|
||||
#if 0
|
||||
if (audio->playback_size == 0) {
|
||||
TELY_Audio_Play(audio, game->audio[FP_GameAudio_TestAudio], 1.f /*volume*/);
|
||||
}
|
||||
#endif
|
||||
|
||||
// =============================================================================================
|
||||
|
||||
if (game->play.state == FP_GameState_Play || game->play.state == FP_GameState_Tutorial) {
|
||||
if (TELY_OSInput_KeyWasDown(input->mouse_left) && TELY_OSInput_KeyIsDown(input->mouse_left)) {
|
||||
if (game->play.prev_active_entity.id)
|
||||
@@ -4484,6 +4490,7 @@ void TELY_OS_DLLFrameUpdate(TELY_OS *os)
|
||||
}
|
||||
}
|
||||
|
||||
TELY_Audio *audio = &os->audio;
|
||||
for (game->play.delta_s_accumulator += DQN_CAST(Dqn_f32)input->delta_s;
|
||||
game->play.delta_s_accumulator > FP_GAME_PHYSICS_STEP;
|
||||
game->play.delta_s_accumulator -= FP_GAME_PHYSICS_STEP) {
|
||||
|
||||
@@ -334,6 +334,12 @@ enum FP_GameAudio
|
||||
FP_GameAudio_Message,
|
||||
FP_GameAudio_Monkey,
|
||||
FP_GameAudio_PortalDestroy,
|
||||
FP_GameAudio_GameStart,
|
||||
FP_GameAudio_PerryStart,
|
||||
FP_GameAudio_Ambience1,
|
||||
FP_GameAudio_Ambience2,
|
||||
FP_GameAudio_Music1,
|
||||
FP_GameAudio_Music2,
|
||||
FP_GameAudio_Count,
|
||||
};
|
||||
|
||||
@@ -476,6 +482,8 @@ struct FP_Game
|
||||
TELY_AssetFontHandle talkco_font;
|
||||
|
||||
TELY_AssetAudioHandle audio[FP_GameAudio_Count];
|
||||
TELY_AudioPlaybackHandle bg_music1;
|
||||
TELY_AudioPlaybackHandle bg_music2;
|
||||
TELY_AssetSpriteSheet atlas_sprite_sheet;
|
||||
TELY_RFui rfui;
|
||||
FP_GamePlay play;
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user