1
0
Fork 0
forked from NotAShelf/rogged

core: fix enemy movement collision with the player

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I8bfcc0f8816fbc02dbd7ad462b5c0a4e6a6a6964
This commit is contained in:
raf 2026-03-24 17:09:47 +03:00
commit 5fbe7c8c60
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
3 changed files with 66 additions and 57 deletions

View file

@ -56,9 +56,26 @@ typedef enum { ENEMY_GOBLIN, ENEMY_SKELETON, ENEMY_ORC } EnemyType;
typedef struct {
int x, y;
int hp;
int max_hp;
int attack;
int alive;
EnemyType type;
} Enemy;
#endif // COMMON_H
// GameState - encapsulates all game state for testability and save/load
typedef struct {
Player player;
Map map;
Dungeon dungeon;
Enemy enemies[MAX_ENEMIES];
int enemy_count;
Item items[MAX_ITEMS];
int item_count;
int game_over;
int game_won;
const char *last_message;
int message_timer;
int turn_count;
} GameState;
#endif // COMMON_H