Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 301)
+++ proj/include/ent.h	(revision 302)
@@ -19,7 +19,7 @@
 
 struct gunner;
 typedef struct gunner gunner_t;
-gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type tp);
+gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type type, int team);
 void      (gunner_dtor)(gunner_t *p);
 void (gunner_set_pos)               (gunner_t *p, double x, double y);
 void (gunner_set_spawn)             (gunner_t *p, double x, double y);
@@ -36,9 +36,12 @@
 int16_t (gunner_get_x_screen)       (const gunner_t *p);
 int16_t (gunner_get_y_screen)       (const gunner_t *p);
 gunner_type (gunner_get_type)       (const gunner_t *p);
+int     (gunner_get_team)           (const gunner_t *p);
 void (gunner_draw)(gunner_t *p);
 void (gunner_draw_health)(const gunner_t *p);
 
+double (gunner_distance)(const gunner_t *p1, const gunner_t *p2);
+
 struct bullet;
 typedef struct bullet bullet_t;
 bullet_t* (bullet_ctor)(const gunner_t *shooter, const basic_sprite_t *b, double x, double y, double vx, double vy);
@@ -49,6 +52,7 @@
 int16_t (bullet_get_y_screen)(const bullet_t *p);
 double  (bullet_get_damage)  (const bullet_t *p);
 void    (bullet_set_damage)  (bullet_t *p, double damage);
+const gunner_t* (bullet_get_shooter)(const bullet_t *p);
 void (bullet_update_movement)(bullet_t *p);
 void (bullet_update_movement_list)(list_t *bullet_list);
 void (bullet_draw)(bullet_t *p);
Index: proj/include/proj_macros.h
===================================================================
--- proj/include/proj_macros.h	(revision 301)
+++ proj/include/proj_macros.h	(revision 302)
@@ -26,4 +26,7 @@
 #define HIGHLIGHT_COLOR         0x404040
 #define DELIMITER_COLOR         0x404040
 
+#define MEELEE_RANGE    150
+#define MEELEE_DAMAGE   1
+
 #endif /* end of include guard: PROJ_MACROS_H_INCLUDED */
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 301)
+++ proj/src/ent.c	(revision 302)
@@ -24,8 +24,9 @@
     sprite_t *weapon;
     double health, current_health;
     gunner_type type;
+    int team;
 };
-gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type tp){
+gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, gunner_type type, int team){
     gunner_t *ret = malloc(sizeof(gunner_t));
     if(ret == NULL) return NULL;
     ret->spawn_x = 0.0;
@@ -34,7 +35,8 @@
     ret->y = 0.0;
     ret->health = 100;
     ret->current_health = ret->health;
-    ret->type = tp;
+    ret->type = type;
+    ret->team = team;
     ret->dude   = sprite_ctor(dude  );
     ret->weapon = sprite_ctor(weapon);
     if(ret->dude == NULL || ret->weapon == NULL){
@@ -72,6 +74,7 @@
 int16_t (gunner_get_x_screen)       (const gunner_t *p){ return (p->x-x_origin)*scale; }
 int16_t (gunner_get_y_screen)       (const gunner_t *p){ return (p->y-y_origin)*scale; }
 gunner_type (gunner_get_type)       (const gunner_t *p){ return p->type; }
+int     (gunner_get_team)           (const gunner_t *p){ return p->team; }
 void (gunner_draw)(gunner_t *p){
     const int16_t x_screen = gunner_get_x_screen(p);
     const int16_t y_screen = gunner_get_y_screen(p);
@@ -102,6 +105,12 @@
     rectangle_dtor(red_bar);
 }
 
+double (gunner_distance)(const gunner_t *p1, const gunner_t *p2){
+    double dx = gunner_get_x(p1) - gunner_get_x(p2);
+    double dy = gunner_get_y(p1) - gunner_get_y(p2);
+    return sqrt(dx*dx+dy*dy);
+}
+
 struct bullet{
     const gunner_t *shooter;
     double x, y; //real position
@@ -141,6 +150,7 @@
     if (damage < 0) damage = 0;
     p->damage = damage;
 }
+const gunner_t* (bullet_get_shooter)(const bullet_t *p){ return p->shooter; }
 void (bullet_update_movement)(bullet_t *p){
     p->x += p->vx;
     p->y += p->vy;
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 301)
+++ proj/src/proj.c	(revision 302)
@@ -288,11 +288,11 @@
 
     list_t *shooter_list = list_ctor();
 
-    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player); if(shooter1 == NULL) printf("Failed to get shooter1\n");
+    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
     gunner_set_spawn(shooter1, 75, 75);
     gunner_set_pos(shooter1, 75, 75);
 
-    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_nothing, gunner_player);
+    gunner_t *shooter2 = gunner_ctor(bsp_shooter, bsp_nothing, gunner_player, 2);
     gunner_set_spawn(shooter2, 975, 75);
     gunner_set_pos(shooter2, 775, 75);
 
@@ -343,8 +343,8 @@
 
                                graph_clear_screen();
                                map_draw   (map1);
+                               bullet_draw_list(bullet_list);
                                gunner_draw_list(shooter_list);
-                               bullet_draw_list(bullet_list);
 
                                text_draw(in_game_timer->text);
 
@@ -424,7 +424,7 @@
 
     list_t *shooter_list = list_ctor();
 
-    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player); if(shooter1 == NULL) printf("Failed to get shooter1\n");
+    gunner_t *shooter1 = gunner_ctor(bsp_shooter, bsp_pistol, gunner_player, 1); if(shooter1 == NULL) printf("Failed to get shooter1\n");
     gunner_set_spawn(shooter1, 75, 75);
     gunner_set_pos(shooter1, 75, 75);
 
@@ -444,10 +444,11 @@
     int ipc_status;
     message msg;
     int good = true;
+    int dead = false;
 
     int health = 50;
 
-    while (good) {
+    while (good && !dead) {
        /* Get a request message. */
        if ((r = driver_receive(ANY, &msg, &ipc_status)) != 0) {
            printf("driver_receive failed with %d", r);
@@ -467,6 +468,12 @@
 
                                update_game_state(map1, shooter_list, bullet_list);//printf("L468\n");
 
+                               if(list_find(shooter_list, shooter1) == list_end(shooter_list)){ printf("YOU DIED\n");
+                                   good = false;
+                                   dead = true;
+                                   break;
+                               } //printf("L489\n");
+
                                //update_scale();
                                double angle = get_mouse_angle(shooter1);//printf("L471\n");
                                gunner_set_angle(shooter1, angle - M_PI_2); //printf("L472\n");
@@ -475,7 +482,7 @@
                                               gunner_get_y(shooter1)-ent_get_YLength()/2.0);
 
                                while(list_size(shooter_list) < ZOMBIES_NUM){
-                                   gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, gunner_meelee);
+                                   gunner_t *zombie = gunner_ctor(bsp_zombie, bsp_nothing, gunner_meelee, 3);
                                    gunner_set_health(zombie, health);
                                    gunner_set_curr_health(zombie, health);
                                    health *= ZOMBIE_HEALTH_FACTOR;
@@ -483,14 +490,10 @@
                                    list_push_back(shooter_list, zombie);
                                } //printf("L484\n");
 
-                               if(list_find(shooter_list, shooter1) == list_end(shooter_list)){
-                                   good = false;
-                                   break;
-                               } //printf("L489\n");
                                graph_clear_screen();
                                map_draw   (map1);
+                               bullet_draw_list(bullet_list);
                                gunner_draw_list(shooter_list);
-                               bullet_draw_list(bullet_list); //printf("L502\n");
 
                                text_draw(in_game_timer->text);
 
@@ -553,6 +556,10 @@
     }
     if(list_dtor(bullet_list)) printf("COULD NOT DESTRUCT BULLET LIST\n");
 
+    if(dead){
+        printf("YOU DIED\n");
+    }
+
     timer_dtor(in_game_timer); in_game_timer = NULL;
 
     return SUCCESS;
Index: proj/src/proj_func.c
===================================================================
--- proj/src/proj_func.c	(revision 301)
+++ proj/src/proj_func.c	(revision 302)
@@ -92,9 +92,8 @@
 }
 
 void (update_game_state)(const map_t *map, list_t *shooter_list, list_t *bullet_list) {
-
+    /// BULLETS
     bullet_update_movement_list(bullet_list);
-
     list_node_t *bullet_it = list_begin(bullet_list);
     while (bullet_it != list_end(bullet_list)) {
         /// Collision with walls
@@ -112,7 +111,8 @@
         int deleted_bullet = false;
         while(shooter_it != list_end(shooter_list)){
             gunner_t *shooter = *(gunner_t**)list_node_val(shooter_it);
-            if(gunner_collides_bullet(shooter, bullet)) {
+            if(gunner_collides_bullet(shooter, bullet) &&
+               gunner_get_team(shooter) != gunner_get_team(bullet_get_shooter(bullet))) {
                 list_node_t *aux = list_node_next(bullet_it);
                 /// Change health
                 gunner_set_curr_health(shooter, gunner_get_curr_health(shooter) - bullet_get_damage(bullet));
@@ -130,6 +130,24 @@
         /// Advance iterator if necessary
         bullet_it = list_node_next(bullet_it);
     }
+    /// MEELEE
+    list_node_t *it1 = list_begin(shooter_list);
+    while(it1 != list_end(shooter_list)){
+        gunner_t *s1 = *list_node_val(it1);
+        if(gunner_get_type(s1) != gunner_meelee){ it1 = list_node_next(it1); continue; }
+        list_node_t *it2 = list_begin(shooter_list);
+        while(it2 != list_end(shooter_list)){
+            gunner_t *s2 = *list_node_val(it2);
+            if(s1 != s2 && gunner_distance(s1, s2) < MEELEE_RANGE)
+                gunner_set_curr_health(s2, gunner_get_curr_health(s2) - MEELEE_DAMAGE);
+            if(gunner_get_curr_health(s2) <= 0){
+                list_node_t *aux = list_node_next(it2);
+                gunner_dtor(list_erase(shooter_list, it2));
+                it2 = aux;
+            }else it2 = list_node_next(it2);
+        }
+        it1 = list_node_next(it1);
+    }
 }
 
 void (get_random_spawn)(const map_t *map, gunner_t *p) {
