This commit is contained in:
2026-03-21 15:45:24 +01:00
commit 048575c14c
22 changed files with 589 additions and 0 deletions

32
src/sprite.h Normal file
View File

@@ -0,0 +1,32 @@
#pragma once
#include "defs.h"
#include "raylib.h"
typedef struct Animation {
u8 frame_count;
u8 current_frame;
u8 fps;
float current_time;
} Animation;
typedef struct Sprite {
Texture2D tex;
Vector2 pos;
Vector2 anchor;
Rectangle source;
Color color;
Animation* animation;
} Sprite;
Sprite* sprite_new(const char* path,
Vector2* pos,
Vector2* anchor,
Rectangle* source,
Color* color);
void sprite_draw(Sprite* sprite);
void sprite_free(Sprite* sprite);
void animation_update(Animation* a);