From 7664fdafb9a6d6f4aa3339fe38958b24b234218e Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 30 Sep 2024 19:01:53 +1000 Subject: player slashing --- particle.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 particle.c (limited to 'particle.c') diff --git a/particle.c b/particle.c new file mode 100644 index 0000000..c10e3aa --- /dev/null +++ b/particle.c @@ -0,0 +1,28 @@ +#include "animation.h" +#include "asset.h" +#include "obj.h" +#include "render.h" + +void init_particle(Particle* p, int x, int y, int anim, int bmp) { + p->x = x; + p->y = y; + p->frame = 0; + p->anim = anim; + p->bmp = bmp; +} + +int update_particle(Particle* p) { + const Animation* a = get_animation(p->anim); + return update_anim(a, &p->frame, &p->rect); +} + +void ren_particle(const Particle* p, Renderer* r) { + const Bitmap* b = get_bitmap(p->bmp); + ren_map( + r, + p->x, + p->y, + &p->rect, + b + ); +} -- cgit v1.2.3-54-g00ecf