A RPG I'm messing with made in Raylib.
1#ifndef PLAYER_H
2#define PLAYER_H
3
4#include "animated_texture.h"
5#include "player_state/player_state.h"
6#include "raylib.h"
7
8typedef enum
9{
10 PLAYER_TEXTURE_FORWARD,
11 PLAYER_TEXTURE_WALK_FORWARD,
12 PLAYER_TEXTURE_BACKWARD,
13 PLAYER_TEXTURE_WALK_BACKWARD,
14 PLAYER_TEXTURE_LEFT,
15 PLAYER_TEXTURE_WALK_LEFT,
16 PLAYER_TEXTURE_RIGHT,
17 PLAYER_TEXTURE_WALK_RIGHT,
18 PLAYER_TEXTURE_FALLING,
19 _PLAYER_TEXTURE_LENGTH
20} PlayerTexture;
21
22typedef struct Player {
23 Camera2D camera;
24 Vector2 position;
25 Vector2 velocity;
26 Vector2 control;
27 float speed;
28 float friction;
29 AnimatedTexture texture;
30 AnimatedTexture textures[_PLAYER_TEXTURE_LENGTH];
31 PlayerState state;
32 Color color;
33} Player;
34
35Player *player_create(float x, float y);
36int player_destroy(Player *player);
37void player_draw(Player *player);
38void player_update(Player *player);
39
40#endif