root / proj / include / ent.h @ 339
History | View | Annotate | Download (3.63 KB)
1 | 193 | up20180642 | #ifndef ENT_H_INCLUDED
|
---|---|---|---|
2 | #define ENT_H_INCLUDED
|
||
3 | |||
4 | 339 | up20180642 | /**
|
5 | * @defgroup ent ent
|
||
6 | * @brief Entities module
|
||
7 | *
|
||
8 | * @{
|
||
9 | */
|
||
10 | |||
11 | 332 | up20180642 | #include "basic_sprite.h" |
12 | 231 | up20180655 | #include "list.h" |
13 | 193 | up20180642 | |
14 | void (ent_set_scale) (double n); |
||
15 | void (ent_set_origin)(double x, double y); |
||
16 | |||
17 | 194 | up20180642 | double (ent_get_scale) (void); |
18 | 193 | up20180642 | double (ent_get_XLength)(void); |
19 | double (ent_get_YLength)(void); |
||
20 | |||
21 | 339 | up20180642 | /**
|
22 | * @}
|
||
23 | */
|
||
24 | |||
25 | /**
|
||
26 | * @defgroup gunner_t gunner_t
|
||
27 | * @ingroup ent
|
||
28 | * @brief Gunner module.
|
||
29 | *
|
||
30 | * @{
|
||
31 | */
|
||
32 | |||
33 | 321 | up20180642 | #define GUNNER_MELEE BIT(0) |
34 | #define GUNNER_RANGED BIT(1) |
||
35 | #define GUNNER_PLAYER BIT(2) |
||
36 | #define GUNNER_FOLLOW BIT(3) |
||
37 | 301 | up20180642 | |
38 | 201 | up20180642 | typedef struct gunner gunner_t; |
39 | 321 | up20180642 | gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, uint16_t type, int team);
|
40 | 201 | up20180642 | void (gunner_dtor)(gunner_t *p);
|
41 | 229 | up20180655 | void (gunner_set_pos) (gunner_t *p, double x, double y); |
42 | 236 | up20180642 | void (gunner_set_spawn) (gunner_t *p, double x, double y); |
43 | 229 | up20180655 | void (gunner_set_angle) (gunner_t *p, double angle ); |
44 | 267 | up20180655 | void (gunner_set_health) (gunner_t *p, double health); |
45 | void (gunner_set_curr_health) (gunner_t *p, double health); |
||
46 | 229 | up20180655 | double (gunner_get_x) (const gunner_t *p); |
47 | double (gunner_get_y) (const gunner_t *p); |
||
48 | 232 | up20180655 | double (gunner_get_spawn_x) (const gunner_t *p); |
49 | double (gunner_get_spawn_y) (const gunner_t *p); |
||
50 | 231 | up20180655 | double (gunner_get_angle) (const gunner_t *p); |
51 | 267 | up20180655 | double (gunner_get_health) (const gunner_t *p); |
52 | double (gunner_get_curr_health) (const gunner_t *p); |
||
53 | 229 | up20180655 | int16_t (gunner_get_x_screen) (const gunner_t *p);
|
54 | int16_t (gunner_get_y_screen) (const gunner_t *p);
|
||
55 | 321 | up20180642 | uint16_t (gunner_get_type) (const gunner_t *p);
|
56 | 302 | up20180642 | int (gunner_get_team) (const gunner_t *p); |
57 | 201 | up20180642 | void (gunner_draw)(gunner_t *p);
|
58 | 229 | up20180655 | void (gunner_draw_health)(const gunner_t *p); |
59 | 339 | up20180642 | void (gunner_draw_list)(list_t *shooter_list);
|
60 | 302 | up20180642 | double (gunner_distance)(const gunner_t *p1, const gunner_t *p2); |
61 | 339 | up20180642 | int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2); |
62 | 302 | up20180642 | |
63 | 339 | up20180642 | /**
|
64 | * @}
|
||
65 | */
|
||
66 | |||
67 | /**
|
||
68 | * @defgroup bullet_t bullet_t
|
||
69 | * @ingroup ent
|
||
70 | * @brief Bullet module.
|
||
71 | *
|
||
72 | * @{
|
||
73 | */
|
||
74 | |||
75 | 201 | up20180642 | typedef struct bullet bullet_t; |
76 | 237 | up20180642 | bullet_t* (bullet_ctor)(const gunner_t *shooter, const basic_sprite_t *b, double x, double y, double vx, double vy); |
77 | 203 | up20180642 | void (bullet_dtor)(bullet_t *p);
|
78 | double (bullet_get_x) (const bullet_t *p); |
||
79 | double (bullet_get_y) (const bullet_t *p); |
||
80 | 320 | up20180655 | double (bullet_get_vx) (const bullet_t *p); |
81 | double (bullet_get_vy) (const bullet_t *p); |
||
82 | 203 | up20180642 | int16_t (bullet_get_x_screen)(const bullet_t *p);
|
83 | int16_t (bullet_get_y_screen)(const bullet_t *p);
|
||
84 | 267 | up20180655 | double (bullet_get_damage) (const bullet_t *p); |
85 | void (bullet_set_damage) (bullet_t *p, double damage); |
||
86 | 302 | up20180642 | const gunner_t* (bullet_get_shooter)(const bullet_t *p); |
87 | 226 | up20180642 | void (bullet_update_movement)(bullet_t *p);
|
88 | 231 | up20180655 | void (bullet_update_movement_list)(list_t *bullet_list);
|
89 | 203 | up20180642 | void (bullet_draw)(bullet_t *p);
|
90 | 231 | up20180655 | void (bullet_draw_list)(list_t *bullet_list);
|
91 | 193 | up20180642 | |
92 | 339 | up20180642 | /**
|
93 | * @}
|
||
94 | */
|
||
95 | |||
96 | /**
|
||
97 | * @defgroup map_t map_t
|
||
98 | * @ingroup ent
|
||
99 | * @brief Bullet module.
|
||
100 | *
|
||
101 | * @{
|
||
102 | */
|
||
103 | |||
104 | 216 | up20180642 | typedef struct map map_t; |
105 | 321 | up20180642 | map_t* (map_ctor)(const char *const *background, const char *const *collide); |
106 | 216 | up20180642 | void (map_dtor)(map_t *p);
|
107 | 323 | up20180642 | uint16_t (map_get_width) (const map_t *p);
|
108 | uint16_t (map_get_height) (const map_t *p);
|
||
109 | 321 | up20180642 | int (map_make_dijkstra)(map_t *p, double x_, double y_); |
110 | int (map_where_to_follow)(const map_t *p, double x, double y, double *theta); |
||
111 | 216 | up20180642 | void (map_draw)(map_t *p);
|
112 | 339 | up20180642 | int (map_collides_point)(const map_t *p, double x, double y); |
113 | 216 | up20180642 | |
114 | 339 | up20180642 | /**
|
115 | * @}
|
||
116 | */
|
||
117 | |||
118 | int (map_collides_gunner)(const map_t *p, const gunner_t *gunner); |
||
119 | int (map_collides_bullet)(const map_t *p, const bullet_t *bullet); |
||
120 | int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull); |
||
121 | |||
122 | 193 | up20180642 | #endif //ENT_H_INCLUDED |