FPS
This commit is contained in:
@@ -10,9 +10,11 @@
|
||||
#include "rpg/entity/player.h"
|
||||
#include "npc.h"
|
||||
#include "physics/physics.h"
|
||||
#include "rpg/world/worldunit.h"
|
||||
|
||||
#define ENTITY_FRICTION 0.9f
|
||||
#define ENTITY_MIN_VELOCITY 0.05f
|
||||
#define ENTITY_FRICTION 1
|
||||
#define ENTITY_MIN_VELOCITY 1
|
||||
#define ENTITY_COUNT 256
|
||||
|
||||
typedef struct map_s map_t;
|
||||
|
||||
@@ -25,12 +27,10 @@ typedef enum {
|
||||
} entitytype_t;
|
||||
|
||||
typedef struct entity_s {
|
||||
map_t *map;
|
||||
entitytype_t type;
|
||||
direction_t direction;
|
||||
|
||||
vec2 position;
|
||||
vec2 velocity;
|
||||
worldchunkpos_t position[3];
|
||||
worldsubtile_t velocity[3];
|
||||
|
||||
union {
|
||||
player_t player;
|
||||
@@ -38,14 +38,15 @@ typedef struct entity_s {
|
||||
};
|
||||
} entity_t;
|
||||
|
||||
extern entity_t ENTITIES[ENTITY_COUNT];
|
||||
|
||||
/**
|
||||
* Initializes an entity structure.
|
||||
*
|
||||
* @param entity Pointer to the entity structure to initialize.
|
||||
* @param type The type of the entity.
|
||||
* @param map Pointer to the map the entity belongs to.
|
||||
*/
|
||||
void entityInit(entity_t *entity, const entitytype_t type, map_t *map);
|
||||
void entityInit(entity_t *entity, const entitytype_t type);
|
||||
|
||||
/**
|
||||
* Updates an entity.
|
||||
|
||||
Reference in New Issue
Block a user