Compare commits

..

3 Commits

Author SHA1 Message Date
95a8714513 fp: Redo the attack boxes 2023-10-08 16:44:48 +11:00
da41e986c5 fp: Reset game on game completion 2023-10-08 16:17:40 +11:00
1ae76db2f6 fp: Wire up game reset 2023-10-08 16:14:31 +11:00
7 changed files with 10 additions and 23 deletions

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

View File

@ -498,9 +498,6 @@ 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_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_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;
{
@ -721,7 +718,6 @@ void FP_EntityActionStateMachine(FP_Game *game, TELY_Audio *audio, TELY_Platform
*acceleration_meters_per_s *= 35.f;
entity->stamina -= FP_TERRY_DASH_STAMINA_COST;
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Woosh], 1.f);
#if 0
FP_GameRenderSprite *cosmetic_sprite = Dqn_FArray_Make(&entity->extra_cosmetic_anims, Dqn_ZeroMem_Yes);
@ -1346,7 +1342,7 @@ void FP_EntityActionStateMachine(FP_Game *game, TELY_Audio *audio, TELY_Platform
}
}
void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input, TELY_Audio *audio)
void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input)
{
Dqn_Profiler_ZoneScopeWithIndex("FP_Update", FP_ProfileZone_FPUpdate);
@ -1856,7 +1852,6 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
FP_Entity_CreateClubTerry(game, placement_pos, "Club Terry");
} else if (placeable_building.type == FP_EntityType_ChurchTerry) {
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) {
FP_Entity_CreateAirportTerry(game, placement_pos, "Airport Terry");
} else {
@ -2096,7 +2091,7 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
Dqn_Profiler_EndZone(update_zone);
}
void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer, TELY_Audio *audio)
void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer)
{
Dqn_Profiler_ZoneScopeWithIndex("FP_Render", FP_ProfileZone_FPRender);
TELY_PlatformInput *input = &platform->input;
@ -2516,7 +2511,6 @@ 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 (mapping.inventory_count) {
player->coins -= *mapping.building_base_price;
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Ching], 1.f);
*mapping.building_base_price *= 2;
// NOTE: Raise the prices of everything else
@ -2603,7 +2597,6 @@ void FP_Render(FP_Game *game, TELY_Platform *platform, TELY_Renderer *renderer,
if (game->play.clock_ms > game->play.player_trigger_purchase_upgrade_timestamp) {
player->coins -= *mapping.upgrade_base_price;
*mapping.upgrade_base_price *= 2;
TELY_Audio_Play(audio, game->audio[FP_GameAudio_Ching], 1.f);
if (mapping.merchant == game->play.merchant_terry) {
// TODO(doyle): Attack damage? Or increase attack range?
@ -3201,10 +3194,10 @@ void TELY_DLL_FrameUpdate(void *user_data)
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) {
FP_Update(platform, game, input, audio);
FP_Update(platform, game, input);
}
FP_Render(game, platform, renderer, audio);
FP_Render(game, platform, renderer);
TELY_RFui_Flush(rfui, renderer, input, 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->hp_cap = FP_DEFAULT_DAMAGE * 3;
entity->hp = entity->hp_cap;
entity->coins = 1'000'000;
entity->coins = 0;//1'000'000;
FP_Entity_AddDebugEditorFlags(game, result);
entity->flags |= FP_GameEntityFlag_NonTraversable;
entity->flags |= FP_GameEntityFlag_Attackable;

View File

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