From 3422a87bdb087b6d927203e266beb71027779dbe Mon Sep 17 00:00:00 2001 From: "Dobbertin, Niclas" Date: Sat, 24 Jun 2023 23:04:23 +0200 Subject: init code --- player.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 player.h (limited to 'player.h') 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 + +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_ -- cgit v1.2.3