From 3a1f9fe6800ef5fe7bbf1c0a5976720383ba84fe Mon Sep 17 00:00:00 2001 From: Joel Stålnacke Date: Mon, 23 Mar 2026 19:50:18 +0200 Subject: Rewrite native code in Odin and use ECS --- lib/player.c | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 lib/player.c (limited to 'lib/player.c') diff --git a/lib/player.c b/lib/player.c deleted file mode 100644 index 35c3b80..0000000 --- a/lib/player.c +++ /dev/null @@ -1,36 +0,0 @@ -#include "snapshot.h" - -#include "player.h" - -vec2 -dp_player_calculate_acceleration(const struct player *p) -{ - vec2 acc, dec; - int x = 0, y = 0; - - if (p->input & INPUT_UP) - { - y -= 1; - } - if (p->input & INPUT_DOWN) - { - y += 1; - } - - if (p->input & INPUT_LEFT) - { - x -= 1; - } - if (p->input & INPUT_RIGHT) - { - x += 1; - } - - acc = dp_vec2_new((float)x, (float)y); - acc = dp_vec2_normal(acc); - acc = dp_vec2_mul(acc, PLAYER_ACCELERATION); - - dec = dp_vec2_mul(p->vel, -1.0f * PLAYER_DRAG); - - return dp_vec2_add(acc, dec); -} -- cgit v1.2.3