Compare commits

..

3 Commits

Author SHA1 Message Date
0736314600 Add new sfx 2023-10-08 13:23:26 +11:00
87fb216256 fp: Add intro screen and remove nil states 2023-10-08 13:23:25 +11:00
daa6cb4cb4 Change the numbers for better balancing 2023-10-08 13:13:18 +11:00
5 changed files with 20 additions and 17 deletions

View File

@ -497,10 +497,12 @@ void TELY_DLL_Init(void *user_data)
game->merchant_phone_company = FP_Entity_CreateMerchantPhoneCompany(game, base_top_right, "PhoneCompany"); game->merchant_phone_company = FP_Entity_CreateMerchantPhoneCompany(game, base_top_right, "PhoneCompany");
} }
#if 0
FP_Entity_CreateClubTerry(game, Dqn_V2_InitNx2(+500, -191), "Club Terry"); FP_Entity_CreateClubTerry(game, Dqn_V2_InitNx2(+500, -191), "Club Terry");
FP_Entity_CreateKennelTerry(game, Dqn_V2_InitNx2(-300, -191), "Kennel Terry"); FP_Entity_CreateKennelTerry(game, Dqn_V2_InitNx2(-300, -191), "Kennel Terry");
FP_Entity_CreateChurchTerry(game, Dqn_V2_InitNx2(-800, -191), "Church Terry"); FP_Entity_CreateChurchTerry(game, Dqn_V2_InitNx2(-800, -191), "Church Terry");
FP_Entity_CreateAirportTerry(game, Dqn_V2_InitNx2(-1200, -191), "Airport Terry"); FP_Entity_CreateAirportTerry(game, Dqn_V2_InitNx2(-1200, -191), "Airport Terry");
#endif
game->tile_size = 37; game->tile_size = 37;
Dqn_V2I max_tile = platform->core.window_size / game->tile_size; Dqn_V2I max_tile = platform->core.window_size / game->tile_size;
@ -1920,14 +1922,14 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
// NOTE: Recover mobile data // NOTE: Recover mobile data
entity->terry_mobile_data_plan = entity->terry_mobile_data_plan =
DQN_MIN(entity->terry_mobile_data_plan + DQN_CAST(Dqn_usize)(FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK * .25f * PHYSICS_STEP), DQN_MIN(entity->terry_mobile_data_plan + DQN_CAST(Dqn_usize)(FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK * .125f * PHYSICS_STEP),
entity->terry_mobile_data_plan_cap); entity->terry_mobile_data_plan_cap);
// NOTE: Recover hp & stamina // NOTE: Recover hp & stamina
entity->stamina = DQN_MIN(entity->stamina + 1, entity->stamina_cap); entity->stamina = DQN_MIN(entity->stamina + 0.25f, entity->stamina_cap);
if (game->update_counter % 12 == 0) { if (game->update_counter % 12 == 0) {
entity->hp = DQN_MIN(entity->hp + 1, entity->hp_cap); entity->hp = DQN_MIN(entity->hp + 0.75f, entity->hp_cap);
} }
// NOTE: Derive dynmamic bounding boxes ==================================================== // NOTE: Derive dynmamic bounding boxes ====================================================
@ -2041,12 +2043,13 @@ void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput *input
// NOTE: Do HP ========================================================================= // NOTE: Do HP =========================================================================
defender->hp = defender->hp >= FP_DEFAULT_DAMAGE ? defender->hp - FP_DEFAULT_DAMAGE : 0; defender->hp = defender->hp >= FP_DEFAULT_DAMAGE ? defender->hp - FP_DEFAULT_DAMAGE : 0;
if (defender->hp <= 0) { if (defender->hp <= 0) {
defender->is_dying = true;
FP_GameEntity *coin_receiver = FP_Game_GetEntity(game, attacker->projectile_owner); FP_GameEntity *coin_receiver = FP_Game_GetEntity(game, attacker->projectile_owner);
if (FP_Game_IsNilEntity(coin_receiver)) if (FP_Game_IsNilEntity(coin_receiver))
coin_receiver = attacker; coin_receiver = attacker;
if (!defender->is_dying)
coin_receiver->coins += 1; coin_receiver->coins += 1;
defender->is_dying = true;
} }
// NOTE: Kickback ====================================================================== // NOTE: Kickback ======================================================================

View File

@ -137,6 +137,6 @@ struct FP_EntityRenderData
TELY_AssetAnimatedSprite sprite; TELY_AssetAnimatedSprite sprite;
}; };
Dqn_usize const FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK = DQN_KILOBYTES(1); Dqn_usize const FP_TERRY_MOBILE_DATA_PER_RANGE_ATTACK = DQN_KILOBYTES(5);
uint16_t const FP_TERRY_DASH_STAMINA_COST = 33; uint16_t const FP_TERRY_DASH_STAMINA_COST = 33;
uint16_t const FP_DEFAULT_DAMAGE = 30; uint16_t const FP_DEFAULT_DAMAGE = 30;

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, 0.5f, entity->sprite_height.meters * .6f); entity->local_hit_box_size = FP_Game_MetersToPixelsNx2(game, 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 = 1'000'000; entity->coins = 0;//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

@ -229,15 +229,15 @@ static FP_GameEntity *FP_Game_MakeEntityPointerFV(FP_Game *game, DQN_FMT_STRING_
result->hp_cap = FP_DEFAULT_DAMAGE; result->hp_cap = FP_DEFAULT_DAMAGE;
result->hp = result->hp_cap; result->hp = result->hp_cap;
result->inventory.airports_base_price = 4; result->inventory.airports_base_price = 100;
result->inventory.churchs_base_price = 2; result->inventory.churchs_base_price = 50;
result->inventory.kennels_base_price = 2; result->inventory.kennels_base_price = 50;
result->inventory.clubs_base_price = 2; result->inventory.clubs_base_price = 50;
result->inventory.stamina_base_price = 2; result->inventory.stamina_base_price = 10;
result->inventory.health_base_price = 2; result->inventory.health_base_price = 10;
result->inventory.mobile_plan_base_price = 2; result->inventory.mobile_plan_base_price = 10;
result->inventory.attack_base_price = 2; result->inventory.attack_base_price = 10;
// NOTE: Attach entity as a child to the parent // NOTE: Attach entity as a child to the parent

View File

@ -223,9 +223,9 @@ struct FP_GameEntity
Dqn_usize coins; Dqn_usize coins;
FP_GameInventory inventory; FP_GameInventory inventory;
uint16_t hp; Dqn_f32 hp;
uint16_t hp_cap; uint16_t hp_cap;
uint16_t stamina; Dqn_f32 stamina;
uint16_t stamina_cap; uint16_t stamina_cap;
bool converted_faction; bool converted_faction;