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