]> git.lizzy.rs Git - nothing.git/blob - src/game/level/player.h
(#639) Introduce rigid_bodies_collide_with_itself
[nothing.git] / src / game / level / player.h
1 #ifndef PLAYER_H_
2 #define PLAYER_H_
3
4 #include <SDL2/SDL.h>
5
6 #include "game/camera.h"
7 #include "game/sound_samples.h"
8 #include "lava.h"
9 #include "platforms.h"
10 #include "boxes.h"
11
12 typedef struct Player Player;
13 typedef struct Goals Goals;
14 typedef struct Rigid_rect Rigid_rect;
15 typedef struct LineStream LineStream;
16 typedef struct Script Script;
17 typedef struct Broadcast Broadcast;
18
19 Player *create_player_from_line_stream(LineStream *line_stream, Broadcast *broadcast);
20 void destroy_player(Player * player);
21
22 Solid_ref player_as_solid(Player *player);
23
24 int player_render(const Player * player,
25                   Camera *camera);
26 void player_update(Player * player,
27                    float delta_time);
28 void player_collide_with_solid(Player *player, Solid_ref solid);
29 void player_touches_rect_sides(Player *player,
30                                Rect object,
31                                int sides[RECT_SIDE_N]);
32
33 int player_sound(Player *player,
34                  Sound_samples *sound_samples);
35 void player_checkpoint(Player *player,
36                        Vec checkpoint);
37
38 void player_move_left(Player *player);
39 void player_move_right(Player *player);
40 void player_stop(Player *player);
41 void player_jump(Player *player);
42 void player_die(Player *player);
43
44 void player_focus_camera(Player *player,
45                          Camera *camera);
46 void player_hide_goals(const Player *player,
47                        Goals *goal);
48 void player_die_from_lava(Player *player,
49                           const Lava *lava);
50
51 bool player_overlaps_rect(const Player *player,
52                           Rect rect);
53
54 /** \brief Implements solid_apply_force
55  */
56 void player_apply_force(Player *player, Vec force);
57
58 Rigid_rect *player_rigid_rect(Player *player, const char *id);
59
60 #endif  // PLAYER_H_