Revision 321
correcting some problems
ent.c | ||
---|---|---|
30 | 30 |
double health, current_health; |
31 | 31 |
rectangle_t *green_bar, *red_bar; |
32 | 32 |
text_t *txt; |
33 |
gunner_type type;
|
|
33 |
uint16_t type;
|
|
34 | 34 |
int team; |
35 | 35 |
}; |
36 |
gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type type, int team){
|
|
36 |
gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, uint16_t type, int team){
|
|
37 | 37 |
gunner_t *ret = malloc(sizeof(gunner_t)); |
38 | 38 |
if(ret == NULL) return NULL; |
39 | 39 |
ret->spawn_x = 0.0; |
... | ... | |
93 | 93 |
double (gunner_get_curr_health) (const gunner_t *p){ return p->current_health; } |
94 | 94 |
int16_t (gunner_get_x_screen) (const gunner_t *p){ return (p->x-x_origin)*scale; } |
95 | 95 |
int16_t (gunner_get_y_screen) (const gunner_t *p){ return (p->y-y_origin)*scale; } |
96 |
gunner_type (gunner_get_type) (const gunner_t *p){ return p->type; }
|
|
96 |
uint16_t (gunner_get_type) (const gunner_t *p){ return p->type; }
|
|
97 | 97 |
int (gunner_get_team) (const gunner_t *p){ return p->team; } |
98 | 98 |
void (gunner_draw)(gunner_t *p){ |
99 | 99 |
const int16_t x_screen = gunner_get_x_screen(p); |
... | ... | |
232 | 232 |
} |
233 | 233 |
return 0; |
234 | 234 |
} |
235 |
map_t* (map_ctor)(const char **background, const char **collide){
|
|
235 |
map_t* (map_ctor)(const char *const *background, const char *const *collide){
|
|
236 | 236 |
map_t *ret = malloc(sizeof(map_t)); |
237 | 237 |
if(ret == NULL) return NULL; |
238 | 238 |
|
... | ... | |
299 | 299 |
double radius = max(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0; |
300 | 300 |
return map_collides_gunner_pos(p, gunner_get_x(shooter), gunner_get_y(shooter), radius); |
301 | 301 |
} |
302 |
int (map_make_dijkstra)(map_t *p, int16_t x, int16_t y){ |
|
302 |
int (map_make_dijkstra)(map_t *p, double x_, double y_){ |
|
303 |
int16_t x = x_, y = y_; |
|
303 | 304 |
|
304 | 305 |
const uint16_t W = basic_sprite_get_w(p->bsp_background), |
305 | 306 |
H = basic_sprite_get_h(p->bsp_background); |
... | ... | |
334 | 335 |
|
335 | 336 |
return SUCCESS; |
336 | 337 |
} |
337 |
int (map_where_to_follow)(const map_t *p, float x, float y, float *theta){
|
|
338 |
int (map_where_to_follow)(const map_t *p, double x, double y, double *theta){
|
|
338 | 339 |
const uint16_t W = basic_sprite_get_w(p->bsp_background); |
339 | 340 |
int x_ = x, y_ = y; |
340 | 341 |
int pos = y_*W+x_; |
Also available in: Unified diff