summaryrefslogtreecommitdiff
path: root/player.h
diff options
context:
space:
mode:
authorDobbertin, Niclas <niclas.dobbertin@gmx.de>2023-06-24 23:04:23 +0200
committerDobbertin, Niclas <niclas.dobbertin@gmx.de>2023-06-24 23:04:23 +0200
commit3422a87bdb087b6d927203e266beb71027779dbe (patch)
tree3d8381b27c94529c45ad7287695befe3eaa241c5 /player.h
init codeHEADmaster
Diffstat (limited to 'player.h')
-rw-r--r--player.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/player.h b/player.h
new file mode 100644
index 0000000..b250d0f
--- /dev/null
+++ b/player.h
@@ -0,0 +1,26 @@
+#ifndef PLAYER_H_
+#define PLAYER_H_
+
+#include <SDL2/SDL.h>
+
+struct Player {
+ float pos_x, pos_y;
+ double vel_x, vel_y;
+ int accel_x, accel_y;
+ int max_vel_x, max_vel_y;
+ int hp;
+ SDL_Vertex *geometry;
+ int geometry_len;
+};
+
+enum Direction {
+ UP,
+ DOWN,
+ LEFT,
+ RIGHT,
+};
+
+void player_accelerate(struct Player *player, int x, int y, float delta);
+void player_move(struct Player *player, enum Direction direction, float delta);
+
+#endif // PLAYER_H_