aboutsummaryrefslogtreecommitdiff
path: root/obj.h
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2024-09-29 16:39:31 +1000
committerquou <quou@disroot.org>2024-09-29 16:39:31 +1000
commitbe5c7263406aef867501c7965bcced6a7e2898a6 (patch)
tree1e7d5d3b435456c9eeb2d094c3288df259246750 /obj.h
parent9ca0a79e9cc784e14c3d8111ccb9ea1a22225472 (diff)
animation, player movement, physics etc.
Diffstat (limited to 'obj.h')
-rw-r--r--obj.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/obj.h b/obj.h
new file mode 100644
index 0000000..9a331b7
--- /dev/null
+++ b/obj.h
@@ -0,0 +1,32 @@
+#ifndef obj_h
+#define obj_h
+
+#include "rect.h"
+
+struct App;
+struct Renderer;
+struct Map;
+
+typedef enum {
+ face_left,
+ face_right
+} Face;
+
+typedef struct {
+ int x, y, vx, vy;
+ int frame;
+ int anim;
+ int grounded, headbutted, on_ramp, jumping;
+ Face face;
+ Rect rect;
+} Player;
+
+void init_player(Player* p);
+void update_player(
+ Player* p,
+ struct App* app,
+ const struct Map* map
+);
+void ren_player(Player* p, struct Renderer* r);
+
+#endif