Add idle animation
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <flecs.h>
|
||||
|
||||
#include "utils/building_types.h"
|
||||
#include "utils/entity_types.h"
|
||||
|
||||
extern ECS_TAG_DECLARE(TextureTerrain);
|
||||
extern ECS_TAG_DECLARE(TextureBuildings);
|
||||
@@ -67,22 +68,19 @@ typedef struct TextureRegion {
|
||||
} TextureRegion;
|
||||
extern ECS_COMPONENT_DECLARE(TextureRegion);
|
||||
|
||||
typedef enum AnimationType {
|
||||
ANIMATION_IDLE,
|
||||
ANIMATION_WALK,
|
||||
} AnimationType;
|
||||
extern ECS_COMPONENT_DECLARE(AnimationType);
|
||||
|
||||
typedef struct Animation {
|
||||
TextureRegion firstFrame;
|
||||
AnimationType currAnimation;
|
||||
i32 currFrame;
|
||||
i32 frameCount;
|
||||
EntityType entityType;
|
||||
AnimationType animType;
|
||||
AnimationSequence sequence;
|
||||
BzTileset *tileset;
|
||||
i32 curFrame;
|
||||
f32 frameDuration;
|
||||
f32 elapsed;
|
||||
} Animation;
|
||||
extern ECS_COMPONENT_DECLARE(Animation);
|
||||
|
||||
extern ECS_COMPONENT_DECLARE(AnimationType);
|
||||
|
||||
#define PATH_DATA_SIZE 8
|
||||
typedef struct PathData {
|
||||
Position waypoints[PATH_DATA_SIZE];
|
||||
|
||||
Reference in New Issue
Block a user