Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 245)
+++ proj/include/ent.h	(revision 246)
@@ -55,6 +55,8 @@
 int    (map_collides_point)(const map_t *p, double x, double y);
 int    (map_collides_gunner)(const map_t *p, const gunner_t *gunner);
 int    (map_collides_bullet)(const map_t *p, const bullet_t *bullet);
+int16_t (map_get_width)   (const map_t *p);
+int16_t (map_get_height)  (const map_t *p);
 int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull);
 int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2);
 void   (map_draw)(map_t *p);
Index: proj/include/proj_func.h
===================================================================
--- proj/include/proj_func.h	(revision 245)
+++ proj/include/proj_func.h	(revision 246)
@@ -28,7 +28,7 @@
 /**
  * @brief Updates movement variables.
  */
-void update_movement(const map_t *map, gunner_t *p, gunner_t *p2);
+void update_movement(const map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list);
 
 void update_mouse(struct packet *p);
 
@@ -38,6 +38,8 @@
 
 void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list);
 
+void (get_random_spawn)(const map_t *map, gunner_t *p);
+
 void update_scale(void);
 
 int32_t get_mouse_X(void);
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 245)
+++ proj/src/ent.c	(revision 246)
@@ -215,6 +215,8 @@
 }
 int16_t (map_get_x_screen)(const map_t *p){ return (-x_origin)*scale; }
 int16_t (map_get_y_screen)(const map_t *p){ return (-y_origin)*scale; }
+int16_t (map_get_width)   (const map_t *p){ return sprite_get_w(p->background); }
+int16_t (map_get_height)  (const map_t *p){ return sprite_get_h(p->background); }
 int (map_collides_point)(const map_t *p, double x, double y){
     const uint16_t w = sprite_get_w(p->background), h = sprite_get_h(p->background);
     int16_t x_ = x, y_ = y;
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 245)
+++ proj/src/proj.c	(revision 246)
@@ -223,17 +223,26 @@
 
                                         if (no_interrupts % 180 == 0) gunner_set_pos(shooter2, 775, 75);
 
-                                        update_game_state(map1, shooter_list, bullet_list);
+    while (good) {
+        /* Get a request message. */
+        if ((r = driver_receive(ANY, &msg, &ipc_status)) != 0) {
+            printf("driver_receive failed with %d", r);
+            continue;
+        }
+        if (is_ipc_notify(ipc_status)) { /* received notification */
+            switch (_ENDPOINT_P(msg.m_source)) {
+                case HARDWARE: /* hardware interrupt notification */
+                    for (uint32_t i = 0, n = 1; i < 32; i++, n <<= 1) {
+                        if (msg.m_notify.interrupts & n) {
+                            interrupt_handler(i);
+                            if ((scancode[0]) == ESC_BREAK_CODE) good = 0;
+                            #ifdef TELMO
+                            if (i == 0) {
+                                if (no_interrupts % refresh_count_value == 0) {
+                                    update_movement(map1, shooter1, get_key_presses(), shooter_list);
+                                    //bullet_update_movement(bullet);
 
-                                        if(map_collides_gunner(map1, shooter1)){
-                                            printf("COLLIDING\n");
-                                        }
-
                                         update_scale();
-
-                                        ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
-                                                       gunner_get_y(shooter1)-ent_get_YLength()/2.0);
-
                                         sprite_set_pos(sp_crosshair, get_mouse_X(), get_mouse_Y());
                                         double angle = get_mouse_angle(shooter1);
                                         gunner_set_angle(shooter1, angle - M_PI_2);
@@ -246,8 +255,6 @@
                                         gunner_draw(shooter1);
                                         bullet_draw_list(bullet_list);
 
-                                        t = clock()-t; //printf("%d\n", (t*1000)/CLOCKS_PER_SEC);
-
                                         sprite_draw(sp_crosshair);
                                         graph_draw();
                                     }
@@ -258,11 +265,6 @@
                                         update_mouse(&pp);
                                         //printf("X: %d Y: %d\n", get_mouse_X(), get_mouse_Y());
                                         counter_mouse_ih = 0;
-
-                                        if (last_lb ^ get_key_presses()->lb_pressed && get_key_presses()->lb_pressed) {
-                                            shoot_bullet(shooter1, bullet_list, bsp_bullet);
-                                        }
-
                                         last_lb = get_key_presses()->lb_pressed;
                                     }
                                 }
Index: proj/src/proj_func.c
===================================================================
--- proj/src/proj_func.c	(revision 245)
+++ proj/src/proj_func.c	(revision 246)
@@ -48,20 +48,38 @@
     }
 }
 
-
-void update_movement(const map_t *map, gunner_t *p, gunner_t *p2) {
-    int ver_mov = key_presses.s_pressed - key_presses.w_pressed;
-    int hor_mov = key_presses.d_pressed - key_presses.a_pressed;
+void update_movement(const map_t *map, gunner_t *p, keys_t *keys, list_t *shooter_list) {
+    int ver_mov = keys->s_pressed - keys->w_pressed;
+    int hor_mov = keys->d_pressed - keys->a_pressed;
     double x = gunner_get_x(p);
     double y = gunner_get_y(p);
+
     gunner_set_pos(p, x + SHOOTER_SPEED * hor_mov, y);
-    if (map_collides_gunner(map, p) || gunner_collides_gunner(p, p2)) {
-        gunner_set_pos(p, x, y);
+    if (map_collides_gunner(map, p)) gunner_set_pos(p, x, y);
+    else {
+        list_node_t *it = list_begin(shooter_list);
+        while (it != list_end(shooter_list)) {
+            gunner_t *p2 = *(gunner_t**)list_node_val(it);
+            if (p != p2 && gunner_collides_gunner(p, p2)) {
+                gunner_set_pos(p, x, y);
+                break;
+            }
+            it = list_node_next(it);
+        }
     }
-        x = gunner_get_x(p);
+    x = gunner_get_x(p);
     gunner_set_pos(p, x, y + SHOOTER_SPEED * ver_mov);
-    if (map_collides_gunner(map, p) || gunner_collides_gunner(p, p2)) {
-        gunner_set_pos(p, x, y);
+    if (map_collides_gunner(map, p)) gunner_set_pos(p, x, y);
+    else {
+        list_node_t *it = list_begin(shooter_list);
+        while (it != list_end(shooter_list)) {
+            gunner_t *p2 = *(gunner_t**)list_node_val(it);
+            if (p != p2 && gunner_collides_gunner(p, p2)) {
+                gunner_set_pos(p, x, y);
+                break;
+            }
+            it = list_node_next(it);
+        }
     }
 }
 
@@ -99,8 +117,8 @@
                 /// Change health
                 gunner_set_curr_health(shooter, gunner_get_curr_health(shooter) - bullet_get_damage(bullet));
                 if (gunner_get_curr_health(shooter) <= 0) {
-                    shooter = list_erase(shooter_list, shooter_it);
-                    gunner_dtor(shooter);
+                    gunner_set_curr_health(shooter, gunner_get_health(shooter));
+                    get_random_spawn(map, shooter);
                 }
                 /// Delete bullet
                 bullet_dtor(list_erase(bullet_list, bullet_it)); deleted_bullet = true;
@@ -115,6 +133,17 @@
     }
 }
 
+void (get_random_spawn)(const map_t *map, gunner_t *p) {
+    uint16_t w = map_get_width(map), h = map_get_height(map);
+    double x, y;
+
+    do {
+        x = rand() % w;
+        y = rand() % h;
+        gunner_set_pos(p, x, y);
+    } while (map_collides_gunner(map, p));
+}
+
 void update_scale(void) {
     static uint8_t last_plus = 0, last_minus = 0;
     if (key_presses.ctrl_pressed) {
