Compare commits

..

4 Commits

Author SHA1 Message Date
efec333b61 fp: Redo the attack boxes 2023-10-08 16:46:49 +11:00
98e3245682 fp: Reset game on game completion 2023-10-08 16:46:47 +11:00
1889b9f9c5 fp: Wire up game reset 2023-10-08 16:46:44 +11:00
2102ffa094 fp: Add more sfx 2023-10-08 16:21:39 +11:00
7 changed files with 23 additions and 10 deletions

BIN
Data/Audio/ching.ogg (Stored with Git LFS)

Binary file not shown.

BIN
Data/Audio/church.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Audio/woosh.ogg (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Data/Audio/woosh.wav (Stored with Git LFS)

Binary file not shown.

View File

@ -498,6 +498,9 @@ void TELY_DLL_Init(void *user_data)
game->audio[FP_GameAudio_TestAudio] = platform->func_load_audio(assets, DQN_STRING8("Test Audio"), DQN_STRING8("Data/Audio/Purrple Cat - Moonwinds.qoa")); game->audio[FP_GameAudio_TestAudio] = platform->func_load_audio(assets, DQN_STRING8("Test Audio"), DQN_STRING8("Data/Audio/Purrple Cat - Moonwinds.qoa"));
game->audio[FP_GameAudio_TerryHit] = platform->func_load_audio(assets, DQN_STRING8("Terry Hit"), DQN_STRING8("Data/Audio/terry_hit.ogg")); game->audio[FP_GameAudio_TerryHit] = platform->func_load_audio(assets, DQN_STRING8("Terry Hit"), DQN_STRING8("Data/Audio/terry_hit.ogg"));
game->audio[FP_GameAudio_Smooch] = platform->func_load_audio(assets, DQN_STRING8("Smooch"), DQN_STRING8("Data/Audio/smooch.mp3")); game->audio[FP_GameAudio_Smooch] = platform->func_load_audio(assets, DQN_STRING8("Smooch"), DQN_STRING8("Data/Audio/smooch.mp3"));
game->audio[FP_GameAudio_Woosh] = platform->func_load_audio(assets, DQN_STRING8("Woosh"), DQN_STRING8("Data/Audio/woosh.ogg"));
game->audio[FP_GameAudio_Ching] = platform->func_load_audio(assets, DQN_STRING8("Ching"), DQN_STRING8("Data/Audio/ching.ogg"));
game->audio[FP_GameAudio_Church] = platform->func_load_audio(assets, DQN_STRING8("Church"), DQN_STRING8("Data/Audio/church.ogg"));
platform->user_data = game; platform->user_data = game;
{ {
@ -718,6 +721,7 @@ void FP_EntityActionStateMachine(FP_Game *game, TELY_Audio *audio, TELY_Platform
*acceleration_meters_per_s *= 35.f; *acceleration_meters_per_s *= 35.f;
entity->stamina -= FP_TERRY_DASH_STAMINA_COST; entity->stamina -= FP_TERRY_DASH_STAMINA_COST;
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Woosh], 1.f);
#if 0 #if 0
FP_GameRenderSprite *cosmetic_sprite = Dqn_FArray_Make(&entity->extra_cosmetic_anims, Dqn_ZeroMem_Yes); FP_GameRenderSprite *cosmetic_sprite = Dqn_FArray_Make(&entity->extra_cosmetic_anims, Dqn_ZeroMem_Yes);
@ -1342,7 +1346,7 @@ void FP_EntityActionStateMachine(FP_Game *game, TELY_Audio *audio, TELY_Platform
} }
} }
void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input) void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input, TELY_Audio *audio)
{ {
Dqn_Profiler_ZoneScopeWithIndex("FP_Update", FP_ProfileZone_FPUpdate); Dqn_Profiler_ZoneScopeWithIndex("FP_Update", FP_ProfileZone_FPUpdate);
@ -1852,6 +1856,7 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
FP_Entity_CreateClubTerry(game, placement_pos, "Club Terry"); FP_Entity_CreateClubTerry(game, placement_pos, "Club Terry");
} else if (placeable_building.type == FP_EntityType_ChurchTerry) { } else if (placeable_building.type == FP_EntityType_ChurchTerry) {
FP_Entity_CreateChurchTerry(game, placement_pos, "Church Terry"); FP_Entity_CreateChurchTerry(game, placement_pos, "Church Terry");
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Church], 1.f);
} else if (placeable_building.type == FP_EntityType_AirportTerry) { } else if (placeable_building.type == FP_EntityType_AirportTerry) {
FP_Entity_CreateAirportTerry(game, placement_pos, "Airport Terry"); FP_Entity_CreateAirportTerry(game, placement_pos, "Airport Terry");
} else { } else {
@ -2091,7 +2096,7 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
Dqn_Profiler_EndZone(update_zone); Dqn_Profiler_EndZone(update_zone);
} }
void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer) void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer, TELY_Audio *audio)
{ {
Dqn_Profiler_ZoneScopeWithIndex("FP_Render", FP_ProfileZone_FPRender); Dqn_Profiler_ZoneScopeWithIndex("FP_Render", FP_ProfileZone_FPRender);
TELY_PlatformInput *input = &platform->input; TELY_PlatformInput *input = &platform->input;
@ -2511,6 +2516,7 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer)
if (game->play.clock_ms > game->play.player_trigger_purchase_building_timestamp) { if (game->play.clock_ms > game->play.player_trigger_purchase_building_timestamp) {
if (mapping.inventory_count) { if (mapping.inventory_count) {
player->coins -= *mapping.building_base_price; player->coins -= *mapping.building_base_price;
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Ching], 1.f);
*mapping.building_base_price *= 2; *mapping.building_base_price *= 2;
// NOTE: Raise the prices of everything else // NOTE: Raise the prices of everything else
@ -2597,6 +2603,7 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer)
if (game->play.clock_ms > game->play.player_trigger_purchase_upgrade_timestamp) { if (game->play.clock_ms > game->play.player_trigger_purchase_upgrade_timestamp) {
player->coins -= *mapping.upgrade_base_price; player->coins -= *mapping.upgrade_base_price;
*mapping.upgrade_base_price *= 2; *mapping.upgrade_base_price *= 2;
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Ching], 1.f);
if (mapping.merchant == game->play.merchant_terry) { if (mapping.merchant == game->play.merchant_terry) {
// TODO(doyle): Attack damage? Or increase attack range? // TODO(doyle): Attack damage? Or increase attack range?
@ -3194,10 +3201,10 @@ void TELY_DLL_FrameUpdate(void *user_data)
for (game->play.delta_s_accumulator += DQN_CAST(Dqn_f32)input->delta_s; for (game->play.delta_s_accumulator += DQN_CAST(Dqn_f32)input->delta_s;
game->play.delta_s_accumulator > PHYSICS_STEP; game->play.delta_s_accumulator > PHYSICS_STEP;
game->play.delta_s_accumulator -= PHYSICS_STEP) { game->play.delta_s_accumulator -= PHYSICS_STEP) {
FP_Update(platform, game, input); FP_Update(platform, game, input, audio);
} }
FP_Render(game, platform, renderer); FP_Render(game, platform, renderer, audio);
TELY_RFui_Flush(rfui, renderer, input, assets); TELY_RFui_Flush(rfui, renderer, input, assets);
TELY_Audio_MixPlaybackSamples(audio, assets); TELY_Audio_MixPlaybackSamples(audio, assets);

View File

@ -459,7 +459,7 @@ static FP_GameEntityHandle FP_Entity_CreateTerry(FP_Game *game, Dqn_V2 pos, DQN_
entity->local_hit_box_size = FP_Game_MetersToPixelsNx2(game->play, 0.5f, entity->sprite_height.meters * .6f); entity->local_hit_box_size = FP_Game_MetersToPixelsNx2(game->play, 0.5f, entity->sprite_height.meters * .6f);
entity->hp_cap = FP_DEFAULT_DAMAGE * 3; entity->hp_cap = FP_DEFAULT_DAMAGE * 3;
entity->hp = entity->hp_cap; entity->hp = entity->hp_cap;
entity->coins = 0;//1'000'000; entity->coins = 1'000'000;
FP_Entity_AddDebugEditorFlags(game, result); FP_Entity_AddDebugEditorFlags(game, result);
entity->flags |= FP_GameEntityFlag_NonTraversable; entity->flags |= FP_GameEntityFlag_NonTraversable;
entity->flags |= FP_GameEntityFlag_Attackable; entity->flags |= FP_GameEntityFlag_Attackable;

View File

@ -260,6 +260,9 @@ enum FP_GameAudio
FP_GameAudio_TestAudio, FP_GameAudio_TestAudio,
FP_GameAudio_TerryHit, FP_GameAudio_TerryHit,
FP_GameAudio_Smooch, FP_GameAudio_Smooch,
FP_GameAudio_Woosh,
FP_GameAudio_Ching,
FP_GameAudio_Church,
FP_GameAudio_Count, FP_GameAudio_Count,
}; };