fp: Make terry more animation respond immediately to movement

This commit is contained in:
doyle 2023-10-25 20:23:42 +11:00
parent 27d55b36d4
commit 345318967d
2 changed files with 10 additions and 5 deletions

View File

@ -1407,11 +1407,14 @@ static void FP_Update(TELY_Platform *platform, FP_Game *game, TELY_PlatformInput
case FP_EntityType_Billboard: break;
}
if (move_entity)
if (move_entity) {
acceleration_meters_per_s += dir_vector * entity->base_acceleration_per_s.meters;
}
if (dir_vector == Dqn_V2_Zero) {
if (dir_vector.x)
entity->direction = entity->velocity.x > 0.f ? FP_GameDirection_Right : FP_GameDirection_Left;
if (dir_vector.y)
entity->direction = entity->velocity.y > 0.f ? FP_GameDirection_Down : FP_GameDirection_Up;
}
} else {
if (entity->velocity.x)
entity->direction = entity->velocity.x > 0.f ? FP_GameDirection_Right : FP_GameDirection_Left;
else if (entity->velocity.y)

View File

@ -334,9 +334,11 @@ int main(int argc, char const **argv)
Dqn_List<Dqn_Str8> compile_flags = Dqn_List_InitSliceCopy(scratch.arena, 128, common_compile_flags);
Dqn_List_Add(&compile_flags, DQN_STR8("/LD"));
Dqn_List_Add(&compile_flags, DQN_STR8("/analyze"));
Dqn_List_Add(&compile_flags, DQN_STR8("/Fetely_dll_msvc"));
if (!dev_fast_build)
Dqn_List_Add(&compile_flags, DQN_STR8("/analyze"));
Dqn_CPPBuildContext build_context = {};
build_context.compiler = Dqn_CPPBuildCompiler_MSVC;
build_context.compile_files = Dqn_Slice_InitCArrayCopy(scratch.arena, {build_file});