Files
PixelDefense/game/components.h
2023-11-12 19:04:25 +01:00

52 lines
842 B
C

#ifndef PIXELDEFENSE_COMPONENTS_H
#define PIXELDEFENSE_COMPONENTS_H
#include <breeze.h>
#include "utils/building_types.h"
typedef struct TilePosition {
BzTile x;
BzTile y;
} TilePosition;
typedef struct TileSize {
BzTile sizeX;
BzTile sizeY;
} TileSize;
typedef struct Owner {
BuildingType playerID;
} Owner;
typedef Vector2 Position, Size;
typedef f32 Rotation;
typedef f32 Health;
typedef struct TextureRegion {
Texture2D texture;
Rectangle rec;
bool flipX;
bool flipY;
} TextureRegion;
typedef enum AnimationType {
ANIMATION_IDLE,
ANIMATION_WALK,
} AnimationType;
typedef struct Animation {
TextureRegion firstFrame;
AnimationType currAnimation;
i32 currFrame;
i32 frameCount;
f32 frameDuration;
f32 elapsed;
} Animation;
#endif //PIXELDEFENSE_COMPONENTS_H