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:
parent
0894466532
commit
5fbe7c8c60
3 changed files with 66 additions and 57 deletions
19
src/common.h
19
src/common.h
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue