aboutsummaryrefslogtreecommitdiff
path: root/obj.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-09-30 22:13:31 +1000
committerquou <quou@disroot.org>2024-09-30 22:13:31 +1000
commitee655819d44307d974fb27e1fa04d079a3810d63 (patch)
treefaa7c7c833dab0ed83dece311576b53bd2e4b840 /obj.h
parentde9a4fd93343d4654dfe7e2a566704644a9f306f (diff)
enemy
Diffstat (limited to 'obj.h')
-rw-r--r--obj.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/obj.h b/obj.h
index 57172f5..8824a2d 100644
--- a/obj.h
+++ b/obj.h
@@ -43,4 +43,39 @@ 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);
+typedef enum {
+ enemy_demon
+} Enemy_Type;
+
+typedef struct {
+ Enemy_Type t;
+ int x, y, vx, vy;
+ int hp, frame, anim;
+ int grounded, headbutted, on_ramp;
+ int state;
+ Face face;
+ Rect rect;
+} Enemy;
+
+void init_enemy(Enemy* e, Enemy_Type t, int x, int y);
+int update_enemy(Enemy* e, struct World* w);
+void ren_enemy(const Enemy* e, struct Renderer* r);
+
+typedef struct {
+ Rect r;
+ int vx, vy;
+ int hp, life, friendly;
+} Deathzone;
+
+void init_deathzone(
+ Deathzone* d,
+ const Rect* r,
+ int vx,
+ int vy,
+ int hp,
+ int life,
+ int friendly
+);
+int update_deathzone(Deathzone* d);
+
#endif