2018-09-20 01:27:47 +00:00
|
|
|
typedef struct room Room;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int x, y;
|
|
|
|
} Coord;
|
|
|
|
|
|
|
|
typedef struct player
|
|
|
|
{
|
|
|
|
int counter;
|
|
|
|
Coord point;
|
|
|
|
Coord bearing;
|
|
|
|
SDL_Rect boundBox;
|
|
|
|
SDL_Rect frontFaceBox;
|
|
|
|
SDL_Surface* spriteSheet;
|
|
|
|
SDL_Surface* sprite;
|
|
|
|
|
|
|
|
} Player;
|
|
|
|
|
|
|
|
Player* newPlayer(char* filename, int a, int b);
|
|
|
|
void killPlayer(Player* target);
|
|
|
|
|
|
|
|
void movePlayer(Player* self, Room* rightHere);
|
|
|
|
void changeSprite(Player* self, SDL_Rect* clip);
|
|
|
|
void drawPlayer(Player* self);
|
2018-10-13 03:35:45 +00:00
|
|
|
void walkAnim(Player* self);
|
|
|
|
|
|
|
|
int playerFaces(Player* self, char dir);
|
|
|
|
int playerIsInRect(Player* self, SDL_Rect* rect);
|