Project

General

Profile

Revision 320

multiplayer almost working, serial data not being transmitted?

View differences:

ent.c
155 155
    sprite_set_angle(ret->b, angle-M_PI_2);
156 156
    return ret;
157 157
}
158

  
158 159
void (bullet_dtor)(bullet_t *p){
159 160
    if(p == NULL) return;
160 161
    sprite_dtor(p->b);
......
162 163
}
163 164
double  (bullet_get_x)       (const bullet_t *p){ return p->x; }
164 165
double  (bullet_get_y)       (const bullet_t *p){ return p->y; }
166
double  (bullet_get_vx)      (const bullet_t *p){ return p->vx; }
167
double  (bullet_get_vy)      (const bullet_t *p){ return p->vy; }
165 168
int16_t (bullet_get_x_screen)(const bullet_t *p){ return (p->x-x_origin)*scale; }
166 169
int16_t (bullet_get_y_screen)(const bullet_t *p){ return (p->y-y_origin)*scale; }
167 170
double  (bullet_get_damage)  (const bullet_t *p){ return p->damage; }
......
384 387
}
385 388

  
386 389
int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2) {
390
    if (shooter1 == shooter2) return false;
387 391
    double shooter1_radius = max(sprite_get_w(shooter1->dude), sprite_get_h(shooter1->dude))/2.0;
388 392
    double shooter2_radius = max(sprite_get_w(shooter2->dude), sprite_get_h(shooter2->dude))/2.0;
389 393
    double distance = distance_gunners(shooter1, shooter2);

Also available in: Unified diff