forked from NotAShelf/rogged
refactor(movement): generalize movement and use vectors
This commit is contained in:
parent
1d738c35d4
commit
d01a54161d
9 changed files with 134 additions and 85 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue