2021-07-29 18:33:22 +02:00
|
|
|
#pragma once
|
2021-07-31 18:44:06 +02:00
|
|
|
#include "animation.h"
|
2021-08-07 01:49:03 +02:00
|
|
|
#include "engine.h"
|
2021-08-25 01:01:43 +02:00
|
|
|
#include "vec2.h"
|
2022-01-23 00:53:07 +01:00
|
|
|
#include "stats.h"
|
2022-01-24 15:15:12 +01:00
|
|
|
#include "capacite.h"
|
|
|
|
|
2021-07-31 18:44:06 +02:00
|
|
|
|
2021-08-15 03:46:49 +02:00
|
|
|
struct Player {
|
2021-08-19 02:29:51 +02:00
|
|
|
/*current position of the player on the map - Tile*/
|
2021-08-25 01:01:43 +02:00
|
|
|
struct Vec2 pos;
|
|
|
|
/*current position of the player on the map - pixels */
|
|
|
|
struct Vec2f pos_visual;
|
2022-01-23 00:53:07 +01:00
|
|
|
|
|
|
|
struct Stats stats;
|
2022-01-24 15:15:12 +01:00
|
|
|
struct Move moves[2];
|
2021-08-19 02:29:51 +02:00
|
|
|
/*player mid - offset pixels*/
|
|
|
|
int x_mid, y_mid;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*the direction the player facing to*/
|
2021-07-29 18:33:22 +02:00
|
|
|
int direction;
|
2021-12-23 18:37:48 +01:00
|
|
|
/*if the player is sprinting*/
|
|
|
|
int sprint;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*current frame of the animation*/
|
2021-07-29 18:33:22 +02:00
|
|
|
int frame;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*where to draw the player on the screen*/
|
2021-08-04 20:12:53 +02:00
|
|
|
int show_x, show_y;
|
2021-08-08 01:43:26 +02:00
|
|
|
/*the current animation*/
|
2021-07-31 18:44:06 +02:00
|
|
|
int idle;
|
2021-08-15 03:46:49 +02:00
|
|
|
struct AnimData anim;
|
2021-07-29 18:33:22 +02:00
|
|
|
};
|
|
|
|
|
2021-08-08 01:43:26 +02:00
|
|
|
/*return the info tile value the player is facing to*/
|
2021-08-15 03:46:49 +02:00
|
|
|
int player_facing(struct Game const *game);
|
2021-08-27 02:11:05 +02:00
|
|
|
struct Player init_player(void);
|
2022-01-24 21:27:51 +01:00
|
|
|
void add_move(struct Player *player, struct Move move);
|
|
|
|
void draw_player_moves(struct Player *player);
|