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

@ -4,6 +4,10 @@
#include "settings.h"
#include <raylib.h>
typedef struct {
int x, y;
} Vec2;
// Tile types
typedef enum { TILE_WALL, TILE_FLOOR, TILE_STAIRS } TileType;
@ -57,7 +61,7 @@ typedef struct {
// Player
typedef struct {
int x, y;
Vec2 position;
int hp, max_hp;
int attack;
int defense;
@ -83,7 +87,7 @@ typedef enum { ENEMY_GOBLIN, ENEMY_SKELETON, ENEMY_ORC } EnemyType;
// Enemy
typedef struct {
int x, y;
Vec2 position;
int hp;
int max_hp;
int attack;