Project

General

Profile

Revision 341

more changes in ent.h, ent.c

View differences:

proj_func.c
272 272
    last_minus = key_presses.minus_pressed;
273 273
}
274 274

  
275
void (get_random_spawn)(const map_t *map, gunner_t *p, list_t *l) {
276
    uint16_t w = map_get_width(map), h = map_get_height(map);
277
    double x, y;
278

  
279
    while(true){
280
        x = rand() % w;
281
        y = rand() % h;
282
        gunner_set_pos(p, x, y);
283
        if(map_collides_gunner(map, p)) continue;
284
        int collides = false;
285
        list_node_t *it = list_begin(l);
286
        while(it != list_end(l)){
287
            if(gunner_collides_gunner(p, *list_node_val(it))){
288
                collides = true;
289
                break;
290
            }
291
            it = list_node_next(it);
292
        }
293
        if(!collides) return;
294
    }
295
}
296

  
275 297
static int16_t mouse_x = 0, mouse_y = 0;
276 298

  
277 299
void (update_mouse)(struct packet *p) {

Also available in: Unified diff