From f9f3cec9ccf2c86f84c5f1fb4b173c4debe42f6d Mon Sep 17 00:00:00 2001 From: doyle Date: Thu, 21 Sep 2023 17:18:32 +1000 Subject: [PATCH] fp: Fix moving diagonally faster --- feely_pona.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/feely_pona.cpp b/feely_pona.cpp index 8f7b4ff..3ca8f52 100644 --- a/feely_pona.cpp +++ b/feely_pona.cpp @@ -647,6 +647,11 @@ void FP_GameUpdate(TELY_Platform *platform, FP_Game *game, TELY_Renderer *render if (TELY_Platform_InputScanCodeIsDown(input, TELY_PlatformInputScanCode_D)) 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 (TELY_Platform_InputScanCodeIsPressed(input, TELY_PlatformInputScanCode_Delete)) FP_Game_DeleteEntity(game, game->clicked_entity);