]> git.lizzy.rs Git - nothing.git/blob - src/player.h
(#122) use wavy_rect for lava
[nothing.git] / src / player.h
1 #ifndef PLAYER_H_
2 #define PLAYER_H_
3
4 #include "./goals.h"
5 #include "./lava.h"
6 #include "./camera.h"
7
8 typedef struct player_t player_t;
9 typedef struct platforms_t platforms_t;
10 typedef struct SDL_Renderer SDL_Renderer;
11
12 player_t *create_player(float x, float y, color_t color);
13 player_t *create_player_from_stream(FILE *stream);
14 void destroy_player(player_t * player);
15
16 int player_render(const player_t * player,
17                   SDL_Renderer *renderer,
18                   const camera_t *camera);
19 void player_update(player_t * player,
20                    const platforms_t *platforms,
21                    Uint32 delta_time);
22
23 void player_move_left(player_t *player);
24 void player_move_right(player_t *player);
25 void player_stop(player_t *player);
26 void player_jump(player_t *player);
27 void player_die(player_t *player);
28
29 void player_focus_camera(player_t *player,
30                          camera_t *camera);
31 void player_hide_goals(const player_t *player,
32                        goals_t *goal);
33 void player_die_from_lava(player_t *player,
34                           const lava_t *lava);
35
36 #endif  // PLAYER_H_