fp: Fix moving diagonally faster

This commit is contained in:
doyle 2023-09-21 17:18:32 +10:00
parent a12a7d218b
commit f9f3cec9cc

View File

@ -647,6 +647,11 @@ void FP_GameUpdate(TELY_Platform *platform, FP_Game *game, TELY_Renderer *render
if (TELY_Platform_InputScanCodeIsDown(input, TELY_PlatformInputScanCode_D)) if (TELY_Platform_InputScanCodeIsDown(input, TELY_PlatformInputScanCode_D))
dir_vector.x = +1.f; dir_vector.x = +1.f;
if (dir_vector.x && dir_vector.y) {
dir_vector.x *= 0.7071067811865475244f;
dir_vector.y *= 0.7071067811865475244f;
}
if (game->clicked_entity.id) { if (game->clicked_entity.id) {
if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_Delete)) if (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_Delete))
FP_Game_DeleteEntity(game, game->clicked_entity); FP_Game_DeleteEntity(game, game->clicked_entity);