Collab_RPG/src/player.h

44 lines
1.1 KiB
C
Raw Normal View History

#ifndef PLAYER_H
#define PLAYER_H
/* The size of the player. */
#ifdef FXCG50
#define P_WIDTH 16
#define P_HEIGHT 16
#else
#define P_WIDTH 8
#define P_HEIGHT 8
#endif
/* SPEED should NOT be 8 or bigger: it this may cause bugs when handling
* collisions! */
#define SPEED PXSIZE*2
#include <stdbool.h>
#include "game.h"
#include "memory.h"
/* Draws the player player. This function should be called after drawing the
* map! */
void player_draw(Player *player);
/* Move the player player in the direction direction. */
void player_move(Map *map_level, Player *player, Direction direction);
/* (Mibi88) TODO: Describe this function please, I've no idea what she's for! */
void player_action(Player *player);
/* Check if the player is in collision with the map or a NPC. Checkpos is used
* to check the axis where the player is not moving. */
bool player_collision(Map *map_level, Player *player, Direction direction,
Checkpos nomov_axis_check);
/* Fix the position of the player so that he's not a bit inside of a hard block
* after a collision. */
void player_fix_position(Player *player, bool fix_x, bool fix_y);
#endif