Revision 335
more docs
ent.c | ||
---|---|---|
298 | 298 |
else return false; |
299 | 299 |
} |
300 | 300 |
int (map_collides_gunner)(const map_t *p, const gunner_t *shooter) { |
301 |
double radius = dmax(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
|
|
301 |
double radius = max_d(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
|
|
302 | 302 |
return map_collides_gunner_pos(p, gunner_get_x(shooter), gunner_get_y(shooter), radius); |
303 | 303 |
} |
304 | 304 |
int (map_make_dijkstra)(map_t *p, double x_, double y_){ |
... | ... | |
347 | 347 |
} |
348 | 348 |
|
349 | 349 |
int (map_collides_bullet)(const map_t *p, const bullet_t *bull){ |
350 |
double radius = dmax(sprite_get_w(bull->b), sprite_get_h(bull->b))/2.0;
|
|
350 |
double radius = max_d(sprite_get_w(bull->b), sprite_get_h(bull->b))/2.0;
|
|
351 | 351 |
double bullet_x = bullet_get_x(bull); |
352 | 352 |
double bullet_y = bullet_get_y(bull); |
353 | 353 |
for (double x = -radius; x < radius; x += 1){ |
... | ... | |
361 | 361 |
int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull){ |
362 | 362 |
if(bull->shooter == shooter) return false; |
363 | 363 |
|
364 |
double shooter_radius = dmax(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
|
|
364 |
double shooter_radius = max_d(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
|
|
365 | 365 |
double shooter_x = gunner_get_x(shooter); |
366 | 366 |
double shooter_y = gunner_get_y(shooter); |
367 | 367 |
|
368 |
double bullet_radius = dmax(sprite_get_w(bull->b), sprite_get_h(bull->b))/2.0;
|
|
368 |
double bullet_radius = max_d(sprite_get_w(bull->b), sprite_get_h(bull->b))/2.0;
|
|
369 | 369 |
double bullet_x = bullet_get_x(bull); |
370 | 370 |
double bullet_y = bullet_get_y(bull); |
371 | 371 |
|
... | ... | |
389 | 389 |
|
390 | 390 |
int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2) { |
391 | 391 |
if (shooter1 == shooter2) return false; |
392 |
double shooter1_radius = dmax(sprite_get_w(shooter1->dude), sprite_get_h(shooter1->dude))/2.0;
|
|
393 |
double shooter2_radius = dmax(sprite_get_w(shooter2->dude), sprite_get_h(shooter2->dude))/2.0;
|
|
392 |
double shooter1_radius = max_d(sprite_get_w(shooter1->dude), sprite_get_h(shooter1->dude))/2.0;
|
|
393 |
double shooter2_radius = max_d(sprite_get_w(shooter2->dude), sprite_get_h(shooter2->dude))/2.0;
|
|
394 | 394 |
double distance = distance_gunners(shooter1, shooter2); |
395 | 395 |
return distance <= shooter1_radius+shooter2_radius; |
396 | 396 |
} |
Also available in: Unified diff