From 7664fdafb9a6d6f4aa3339fe38958b24b234218e Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 30 Sep 2024 19:01:53 +1000 Subject: player slashing --- obj.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'obj.h') diff --git a/obj.h b/obj.h index 9a331b7..7f93ecc 100644 --- a/obj.h +++ b/obj.h @@ -4,8 +4,9 @@ #include "rect.h" struct App; -struct Renderer; struct Map; +struct Renderer; +struct World; typedef enum { face_left, @@ -17,6 +18,7 @@ typedef struct { int frame; int anim; int grounded, headbutted, on_ramp, jumping; + int cooldown; Face face; Rect rect; } Player; @@ -24,9 +26,21 @@ typedef struct { void init_player(Player* p); void update_player( Player* p, - struct App* app, + struct World* w, + const struct App* app, const struct Map* map ); -void ren_player(Player* p, struct Renderer* r); +void ren_player(const Player* p, struct Renderer* r); + +typedef struct { + int x, y; + int frame, anim; + int bmp; + Rect rect; +} Particle; + +void init_particle(Particle* p, int x, int y, int anim, int bmp); +int update_particle(Particle* p); +void ren_particle(const Particle* p, struct Renderer* r); #endif -- cgit v1.2.3-54-g00ecf