refactor(movement): generalize movement and use vectors

This commit is contained in:
Squirrel Modeller 2026-04-09 14:28:41 +02:00
commit d01a54161d
No known key found for this signature in database
GPG key ID: C9FBA7B8C387BF70
9 changed files with 134 additions and 85 deletions

View file

@ -6,8 +6,8 @@
// Initialize player at position
void player_init(Player *p, int x, int y);
// Move player to (x+dx, y+dy); returns 1 if moved, 0 if blocked
int player_move(Player *p, int dx, int dy, Map *map);
// Apply status effect, healing ect
void player_on_move(Player *p);
// Find a living enemy at tile (x, y); returns NULL if none
Enemy *player_find_enemy_at(Enemy *enemies, int count, int x, int y);