Adoranda/include/player.h

24 lines
579 B
C
Raw Normal View History

2021-07-29 18:33:22 +02:00
#pragma once
#include "animation.h"
2021-08-07 01:49:03 +02:00
#include "engine.h"
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-07-29 18:33:22 +02:00
int x, y;
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-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*/
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);
void set_player_xy(struct Player *player, int x, int y);