Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 339)
+++ proj/include/ent.h	(revision 340)
@@ -11,11 +11,31 @@
 #include "basic_sprite.h"
 #include "list.h"
 
+/**
+ * @brief Set scale.
+ * @param   n   Scale
+ */
 void (ent_set_scale) (double n);
+/**
+ * @brief Set origin of screen (upper-left corner) in game referential coordinates.
+ * @param   x   X-position of the upper-left corner of the screen
+ * @param   y   Y-position of the upper-left corner of the screen
+ */
 void (ent_set_origin)(double x, double y);
-
+/**
+ * @brief Get scale.
+ * @return  Scale
+ */
 double (ent_get_scale)  (void);
+/**
+ * @brief Get X-length of the screen in game referencial coordinates.
+ * @return X-length
+ */
 double (ent_get_XLength)(void);
+/**
+ * @brief Get Y-length of the screen in game referencial coordinates.
+ * @return Y-length
+ */
 double (ent_get_YLength)(void);
 
 /**
@@ -30,35 +50,159 @@
  * @{
  */
 
+/// @brief Identifier of a melee gunner
 #define GUNNER_MELEE    BIT(0)
+/// @brief Identifier of a ranged gunner
 #define GUNNER_RANGED   BIT(1)
+/// @brief Identifier of a player-controlled gunner
 #define GUNNER_PLAYER   BIT(2)
+/// @brief Identifier of an automatic follower gunner
 #define GUNNER_FOLLOW   BIT(3)
 
+/**
+ * @brief Gunner.
+ */
 typedef struct gunner gunner_t;
+/**
+ * @brief Construct gunner.
+ * @param   dude    Basic sprite representing the gunner
+ * @param   weapon  Basic sprite representing the weapon of the gunner
+ * @param   type    Type of gunner. Can be one of the identifier macros and also the OR-merge of any combination of them
+ * @param   team    Team of the gunner. 1 for player 1, 2 for player 2, 3 for opponents and 0 for no team (temporary gunner)
+ */
 gunner_t* (gunner_ctor)(basic_sprite_t *dude, basic_sprite_t *weapon, uint16_t type, int team);
+/**
+ * @brief Destruct gunner.
+ * @param   p   Pointer to gunner to be destructed
+ */
 void      (gunner_dtor)(gunner_t *p);
+/**
+ * @brief   Set gunner position.
+ * @param   p   Pointer to gunner
+ * @param   x   X-position of the gunner in game coordinates
+ * @param   y   Y-position of the gunner in game coordinates
+ */
 void (gunner_set_pos)               (gunner_t *p, double x, double y);
+/**
+ * @brief   Set gunner spawn position.
+ * @param   p   Pointer to gunner
+ * @param   x   Spawn X-position of the gunner in game coordinates
+ * @param   y   Spawn Y-position of the gunner in game coordinates
+ */
 void (gunner_set_spawn)             (gunner_t *p, double x, double y);
-void (gunner_set_angle)             (gunner_t *p, double angle      );
+/**
+ * @brief   Set gunner angle.
+ * @param   p       Pointer to gunner
+ * @param   angle   Angle in radians
+ */
+void (gunner_set_angle)             (gunner_t *p, double angle);
+/**
+ * @brief   Set gunner health (total, max health).
+ * @param   p       Pointer to gunner
+ * @param   health  Health
+ */
 void (gunner_set_health)            (gunner_t *p, double health);
+/**
+ * @brief   Set gunner current health.
+ * @param   p       Pointer to gunner
+ * @param   health  Current health
+ */
 void (gunner_set_curr_health)       (gunner_t *p, double health);
+/**
+ * @brief   Get gunner X-position.
+ * @param   p   Pointer to gunner
+ * @return  X-position of the gunner
+ */
 double  (gunner_get_x)              (const gunner_t *p);
+/**
+ * @brief   Get gunner Y-position.
+ * @param   p   Pointer to gunner
+ * @return  Y-position of the gunner
+ */
 double  (gunner_get_y)              (const gunner_t *p);
+/**
+ * @brief   Get gunner spawn X-position.
+ * @param   p   Pointer to gunner
+ * @return  Spawn X-position of the gunner
+ */
 double  (gunner_get_spawn_x)        (const gunner_t *p);
+/**
+ * @brief   Get gunner spawn Y-position.
+ * @param   p   Pointer to gunner
+ * @return  Spawn Y-position of the gunner
+ */
 double  (gunner_get_spawn_y)        (const gunner_t *p);
+/**
+ * @brief   Get gunner angle.
+ * @param   p   Pointer to gunner
+ * @return  Angle of the gunner
+ */
 double  (gunner_get_angle)          (const gunner_t *p);
+/**
+ * @brief   Get gunner max health.
+ * @param   p   Pointer to gunner
+ * @return  Max health of the gunner
+ */
 double  (gunner_get_health)         (const gunner_t *p);
+/**
+ * @brief   Get gunner current health.
+ * @param   p   Pointer to gunner
+ * @return  Current health of the gunner
+ */
 double  (gunner_get_curr_health)    (const gunner_t *p);
+/**
+ * @brief   Get gunner X-position in screen coordinates.
+ * @param   p   Pointer to gunner
+ * @return  X-position of the gunner in screen coordinates
+ */
 int16_t (gunner_get_x_screen)       (const gunner_t *p);
+/**
+ * @brief   Get gunner Y-position in screen coordinates.
+ * @param   p   Pointer to gunner
+ * @return  Y-position of the gunner in screen coordinates
+ */
 int16_t (gunner_get_y_screen)       (const gunner_t *p);
+/**
+ * @brief   Get gunner type.
+ * @param   p   Pointer to gunner
+ * @return  Type of gunner
+ */
 uint16_t (gunner_get_type)          (const gunner_t *p);
+/**
+ * @brief   Get gunner team.
+ * @param   p   Pointer to gunner
+ * @return  Team of gunner
+ */
 int     (gunner_get_team)           (const gunner_t *p);
+/**
+ * @brief   Draw gunner on screen buffer.
+ * @param   p   Pointer to gunner
+ */
 void (gunner_draw)(gunner_t *p);
+/**
+ * @brief   Draw gunner health bar on screen buffer.
+ * @param   p   Pointer to gunner
+ */
 void (gunner_draw_health)(const gunner_t *p);
+/**
+ * @brief   Draw list of gunners on screen buffer.
+ * @param   shooter_list    List of gunners
+ */
 void (gunner_draw_list)(list_t *shooter_list);
+/**
+ * @brief Get distance between two gunners.
+ * @param   p1  Gunner 1
+ * @param   p2  Gunner 2
+ * @return  Euclidian distance between the two gunners
+ */
 double (gunner_distance)(const gunner_t *p1, const gunner_t *p2);
-int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2);
+/**
+ * @brief Check if two gunners are colliding.
+ * @param   p1  Gunner 1
+ * @param   p2  Gunner 2
+ * @return  true if the two gunners are colliding, false otherwise
+ */
+int (gunner_collides_gunner)(const gunner_t *p1, const gunner_t *p2);
 
 /**
  * @}
@@ -72,21 +216,99 @@
  * @{
  */
 
+/**
+ * @brief Bullet.
+ */
 typedef struct bullet bullet_t;
+/**
+ * @brief Construct bullet.
+ * @param   shooter Pointer to gunner that shot that bullet
+ * @param   b       Basic sprite of the bullet
+ * @param   x       X-position
+ * @param   y       Y-position
+ * @param   vx      X-speed
+ * @param   vy      Y-speed
+ * @return Pointer to constructed bullet, or NULL if failed
+ */
 bullet_t* (bullet_ctor)(const gunner_t *shooter, const basic_sprite_t *b, double x, double y, double vx, double vy);
+/**
+ * @brief Destruct bullet.
+ * @param   p   Pointer to bullet to be destructed
+ */
 void      (bullet_dtor)(bullet_t *p);
+/**
+ * @brief   Get bullet X-position.
+ * @param   p   Pointer to bullet
+ * @return  X-position of the bullet
+ */
 double  (bullet_get_x)       (const bullet_t *p);
+/**
+ * @brief   Get bullet Y-position.
+ * @param   p   Pointer to bullet
+ * @return  Y-position of the bullet
+ */
 double  (bullet_get_y)       (const bullet_t *p);
+/**
+ * @brief   Get bullet X-speed.
+ * @param   p   Pointer to bullet
+ * @return  X-speed of the bullet
+ */
 double  (bullet_get_vx)      (const bullet_t *p);
+/**
+ * @brief   Get bullet Y-speed.
+ * @param   p   Pointer to bullet
+ * @return  Y-speed of the bullet
+ */
 double  (bullet_get_vy)      (const bullet_t *p);
+/**
+ * @brief   Get bullet X-position in screen coordinates.
+ * @param   p   Pointer to bullet
+ * @return  X-position of the bullet in screen coordinates
+ */
 int16_t (bullet_get_x_screen)(const bullet_t *p);
+/**
+ * @brief   Get bullet Y-position in screen coordinates.
+ * @param   p   Pointer to bullet
+ * @return  Y-position of the bullet in screen coordinates
+ */
 int16_t (bullet_get_y_screen)(const bullet_t *p);
+/**
+ * @brief   Get bullet damage.
+ * @param   p   Pointer to bullet
+ * @return  Damage
+ */
 double  (bullet_get_damage)  (const bullet_t *p);
+/**
+ * @brief   Set bullet damage.
+ * @param   p   Pointer to bullet
+ * @param   damage  Damage
+ */
 void    (bullet_set_damage)  (bullet_t *p, double damage);
+/**
+ * @brief Get gunner that shot the bullet.
+ * @param   p   Pointer to bullet
+ * @return  Pointer to gunner that shot the bullet
+ */
 const gunner_t* (bullet_get_shooter)(const bullet_t *p);
+/**
+ * @brief Update bullet position (i.e., advance it according to its speed).
+ * @param   p   Pointer to bullet
+ */
 void (bullet_update_movement)(bullet_t *p);
+/**
+ * @brief Update movement of bullets in a list.
+ * @param   bullet_list     Pointer to bullet list
+ */
 void (bullet_update_movement_list)(list_t *bullet_list);
+/**
+ * @brief Draw bullet on screen buffer.
+ * @param   p   Pointer to bullet
+ */
 void (bullet_draw)(bullet_t *p);
+/**
+ * @brief Draw bullets in list on screen buffer.
+ * @param   bullet_list     Pointer to bullet list
+ */
 void (bullet_draw_list)(list_t *bullet_list);
 
 /**
@@ -101,14 +323,69 @@
  * @{
  */
 
+/**
+ * @brief Map.
+ */
 typedef struct map map_t;
+/**
+ * @brief Construct map.
+ * @param   backgroup   XPM describing map as it should be rendered
+ * @param   collide     XPM with transparency describing what parts of the map will cause collision
+ * @return  Pointer to constructed map, or NULL if failed
+ */
 map_t* (map_ctor)(const char *const *background, const char *const *collide);
+/**
+ * @brief Destruct map.
+ * @param   p   Pointer to map to be destructed
+ */
 void   (map_dtor)(map_t *p);
+/**
+ * @brief Get map width.
+ * @param   p   Pointer to map
+ * @return      Width of map
+ */
 uint16_t (map_get_width)   (const map_t *p);
+/**
+ * @brief Get map height.
+ * @param   p   Pointer to map
+ * @return      Height of map
+ */
 uint16_t (map_get_height)  (const map_t *p);
+/**
+ * @brief Use Dijkstra's path-finding algorithm.
+ *
+ * Allows a follower to know where to move so it gets closer to a given target.
+ *
+ * This function is implemented in a clever way that reduces the time of execution.
+ * On the other hand, it might not always give the shortest path, but it is
+ * guaranteeed to provide a decent, valid path to the target.
+ *
+ * @param   p   Pointer to map
+ * @param   x_  X-position of the target
+ * @param   y_  Y-position of the target
+ * @return  SUCCESS if operation is successful, false otherwise
+ */
 int (map_make_dijkstra)(map_t *p, double x_, double y_);
+/**
+ * @brief Get the direction a follower should move to get closer to the target.
+ * @param   p       Pointer to map
+ * @param   x       X-position of the follower
+ * @param   y       Y-position of the follower
+ * @param   theta   Pointer to angle that will be updated
+ * @return SUCCESS if operation was successful, other value otherwise
+ */
 int (map_where_to_follow)(const map_t *p, double x, double y, double *theta);
+/**
+ * @brief Draw map on screen buffer.
+ * @param   p   Pointer to map
+ */
 void   (map_draw)(map_t *p);
+/**
+ * @brief Evaluate if point collides with map.
+ * @param   x   X-position of the point
+ * @param   y   Y-position of the point
+ * @return true if the point collides with the map, false otherwise
+ */
 int    (map_collides_point)(const map_t *p, double x, double y);
 
 /**
@@ -115,8 +392,28 @@
  * @}
  */
 
+/**
+ * @brief Evaluate if gunner is colliding with map.
+ * @param   p       Pointer to map
+ * @param   gunner  Pointer to gunner
+ * @return true if the gunner collides with the map, false otherwise
+ */
 int    (map_collides_gunner)(const map_t *p, const gunner_t *gunner);
+/**
+ * @brief Evaluate if bullet is colliding with map.
+ * @param   p       Pointer to map
+ * @param   bullet  Pointer to bullet
+ * @return true if the bullet collides with the map, false otherwise
+ */
 int    (map_collides_bullet)(const map_t *p, const bullet_t *bullet);
+/**
+ * @brief Evaluate if bullet is colliding with gunner.
+ * @param   shooter     Pointer to gunner
+ * @param   bull        Pointer to bullet
+ * @return true if the bullet collides with the gunner, false otherwise
+ */
 int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull);
 
+void (get_random_spawn)(const map_t *map, gunner_t *p, list_t *l);
+
 #endif //ENT_H_INCLUDED
Index: proj/include/interrupts_func.h
===================================================================
--- proj/include/interrupts_func.h	(revision 339)
+++ proj/include/interrupts_func.h	(revision 340)
@@ -2,6 +2,13 @@
 #define INTERRUPTS_FUNC_H_INCLUDED
 
 /**
+ * @defgroup interrupts_func interrupts_func
+ * @brief Interrupts functions.
+ *
+ * @{
+ */
+
+/**
  * @brief Subscribes all drivers used (timer->keyboard->mouse)
  * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
  * @see {_ERRORS_H_::errors}
@@ -23,4 +30,8 @@
 
 int get_interrupts_vector(uint64_t *p);
 
+/**
+ * @}
+ */
+
 #endif /* end of include guard: INTERRUPTS_FUNC_H_INCLUDED */
Index: proj/include/makecode_map.h
===================================================================
--- proj/include/makecode_map.h	(revision 339)
+++ proj/include/makecode_map.h	(revision 340)
@@ -1,11 +1,18 @@
 #ifndef MAKE_CODE_MAP_H_
 #define MAKE_CODE_MAP_H_
 
+/**
+ * @defgroup makecode_map makecode_map
+ * @brief Makecode map.
+ *
+ * @{
+ */
+
+#include <stdint.h>
+
 #define BASE_CODE    0x02
 #define ERROR_CODE      0
 
-#include <stdint.h>
-
 /**
  * @brief Maps make code into char
  * @param code      Make code to map.
@@ -13,4 +20,8 @@
  */
 char (map_makecode)(uint8_t code);
 
+/**
+ * @}
+ */
+
 #endif /* end of include guard: MAKE_CODE_MAP_H_ */
Index: proj/include/proj_func.h
===================================================================
--- proj/include/proj_func.h	(revision 339)
+++ proj/include/proj_func.h	(revision 340)
@@ -1,6 +1,13 @@
 #ifndef PROJ_FUNC_H_INCLUDED
 #define PROJ_FUNC_H_INCLUDED
 
+/**
+ * @defgroup proj_func proj_func
+ * @brief Project helper functions.
+ *
+ * @{
+ */
+
 #include "ent.h"
 #include "text.h"
 #include "proj_structures.h"
@@ -29,8 +36,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, list_t *l);
 
+
 void update_scale(void);
 
 int16_t* get_mouse_X(void);
@@ -43,17 +50,38 @@
 
 double get_mouse_angle(gunner_t *p);
 
+/**
+ * @}
+ */
+
+/**
+ * @defgroup text_timer_t text_timer_t
+ * @ingroup proj_func
+ * @brief Text timer.
+ *
+ * @{
+ */
+
+/**
+ * @brief Text timer.
+ */
 typedef struct {
+    /// @brief Time since construction.
     int time;
+    /// @brief Text.
     text_t *text;
 } text_timer_t;
 
 text_timer_t* (timer_ctor)(const font_t *fnt);
 
+void (timer_dtor)(text_timer_t *p);
+
 void (timer_update)(text_timer_t *p);
 
 void (timer_reset)(text_timer_t *p);
 
-void (timer_dtor)(text_timer_t *p);
+/**
+ * @}
+ */
 
 #endif /* end of include guard: PROJ_FUNC_H_INCLUDED */
Index: proj/include/proj_macros.h
===================================================================
--- proj/include/proj_macros.h	(revision 339)
+++ proj/include/proj_macros.h	(revision 340)
@@ -1,34 +1,62 @@
 #ifndef PROJ_MACROS_H_INCLUDED
 #define PROJ_MACROS_H_INCLUDED
 
+/**
+ * @defgroup proj_macros proj_macros
+ * @brief Project macros.
+ *
+ * @{
+ */
+
 // Movement Directions
-#define UP      -1  /** @brief Moving to the top side of screen */
-#define DOWN    1   /** @brief Moving to the bottom side of screen */
-#define LEFT    -1  /** @brief Moving to the left side of screen */
-#define RIGHT   1   /** @brief Moving to the right side of screen */
-#define REST    0   /** @brief Not moving */
+/** @brief Moving to the top side of screen */
+#define UP      -1
+/** @brief Moving to the bottom side of screen */
+#define DOWN    1
+/** @brief Moving to the left side of screen */
+#define LEFT    -1
+/** @brief Moving to the right side of screen */
+#define RIGHT   1
+/** @brief Not moving */
+#define REST    0
 
 // Movement Constants
-#define SHOOTER_SPEED   5   /** @brief Shooter speed */
-#define BULLET_SPEED    8   /** @brief Bullet speet */
+/** @brief Shooter speed */
+#define SHOOTER_SPEED   5
+/** @brief Bullet speet */
+#define BULLET_SPEED    8
 
 // Refresh Rate
-#define REFRESH_RATE    60      /** @brief Screen refresh rate */
+/** @brief Screen refresh rate */
+#define REFRESH_RATE    60
 
 //Graphics mode
-#define GRAPH_MODE      DIRECT_1024_768_888 /** @brief Graphic mode used */
-#define MIN_SCALE       0.2                  /** @brief Minimum zoom */
-#define DEFAULT_SCALE   0.5                  /** @brief Default zoom */
-#define MAX_SCALE       10.0                 /** @brief Maximum zoom */
+/** @brief Graphic mode used */
+#define GRAPH_MODE      DIRECT_1024_768_888
+/** @brief Minimum zoom */
+#define MIN_SCALE       0.2
+/** @brief Default zoom */
+#define DEFAULT_SCALE   0.5
+/** @brief Maximum zoom */
+#define MAX_SCALE       10.0
 
 // Colors
+/** @brief Text color */
 #define TEXT_COLOR              0xFFFFFF
+/** @brief Highlight color */
 #define HIGHLIGHT_COLOR         0x404040
+/** @brief Delimiter color */
 #define DELIMITER_COLOR         0x404040
 
+/** @brief Melee attacks range */
 #define MELEE_RANGE    80
+/** @brief Melee attack damage (for zombies). */
 #define MELEE_DAMAGE   1
-
+/** @brief Zombie speed */
 #define ZOMBIE_SPEED    1.0
 
+/**
+ * @}
+ */
+
 #endif /* end of include guard: PROJ_MACROS_H_INCLUDED */
Index: proj/include/proj_structures.h
===================================================================
--- proj/include/proj_structures.h	(revision 339)
+++ proj/include/proj_structures.h	(revision 340)
@@ -1,12 +1,31 @@
 #ifndef PROJ_STRUCTURES_H_INCLUDED
 #define PROJ_STRUCTURES_H_INCLUDED
 
+/**
+ * @defgroup proj_structures proj_structures
+ * @brief Project structures.
+ *
+ * @{
+ */
+
 #include <stdint.h>
 #include "ent.h"
 
 /**
- * @brief Key presses.
+ * @}
  */
+
+/**
+ * @defgroup keys_t keys_t
+ * @ingroup proj_structures
+ * @brief Keys pressed module.
+ *
+ * @{
+ */
+
+/**
+ * @brief Keys pressed.
+ */
 typedef struct {
     /// @brief W is pressed when 1
     uint8_t w_pressed       : 1;
@@ -27,6 +46,18 @@
 } keys_t;
 
 /**
+ * @}
+ */
+
+/**
+* @defgroup host_info_t host_info_t
+* @ingroup proj_structures
+* @brief Host info module.
+*
+* @{
+*/
+
+/**
  * @brief Information to transmit from host to remote.
  */
 typedef struct {
@@ -82,6 +113,18 @@
 void host_info_dtor(host_info_t *p);
 
 /**
+ * @}
+ */
+
+/**
+* @defgroup remote_info_t remote_info_t
+* @ingroup proj_structures
+* @brief Remote info module.
+*
+* @{
+*/
+
+/**
  * @brief Information to transmit from remote to host.
  */
 typedef struct {
@@ -102,6 +145,19 @@
 void remote_info_dtor(remote_info_t *p);
 
 /**
+ * @}
+ */
+
+/**
+* @defgroup bullet_info_t bullet_info_t
+* @ingroup proj_structures
+* @brief Bullet event module.
+*
+* @{
+*/
+
+
+/**
  * @brief Bullet event to transmit from remote to host.
  */
 typedef struct {
@@ -119,4 +175,8 @@
  */
 void bullet_info_dtor(bullet_info_t *p);
 
+/**
+ * @}
+ */
+
 #endif /* end of include guard: PROJ_STRUCTURES_H_INCLUDED */
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 339)
+++ proj/src/ent.c	(revision 340)
@@ -124,12 +124,27 @@
     rectangle_draw(p->red_bar);
     text_draw(p->txt);
 }
+void (gunner_draw_list)(list_t *shooter_list) {
+    if (list_size(shooter_list) == 0) return;
 
+    list_node_t *it = list_begin(shooter_list);
+    while (it != list_end(shooter_list)) {
+        gunner_draw(*(gunner_t**)list_node_val(it));
+        it = list_node_next(it);
+    }
+}
 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);
 }
+int (gunner_collides_gunner)(const gunner_t *p1, const gunner_t *p2) {
+    if (p1 == p2) return false;
+    double p1_radius = max_d(sprite_get_w(p1->dude), sprite_get_h(p1->dude))/2.0;
+    double p2_radius = max_d(sprite_get_w(p2->dude), sprite_get_h(p2->dude))/2.0;
+    double distance = gunner_distance(p1, p2);
+    return distance <= p1_radius+p2_radius;
+}
 
 struct bullet{
     const gunner_t *shooter;
@@ -156,7 +171,6 @@
     sprite_set_angle(ret->b, angle-M_PI_2);
     return ret;
 }
-
 void (bullet_dtor)(bullet_t *p){
     if(p == NULL) return;
     sprite_dtor(p->b);
@@ -178,7 +192,6 @@
     p->x += p->vx;
     p->y += p->vy;
 }
-
 void (bullet_update_movement_list)(list_t *bullet_list){
     if (list_size(bullet_list) == 0) return;
 
@@ -188,7 +201,6 @@
         it = list_node_next(it);
     }
 }
-
 void (bullet_draw)(bullet_t *p){
     const int16_t x_screen = bullet_get_x_screen(p);
     const int16_t y_screen = bullet_get_y_screen(p);
@@ -196,17 +208,6 @@
     sprite_set_scale(p->b, scale);
     sprite_draw     (p->b);
 }
-
-void (gunner_draw_list)(list_t *shooter_list) {
-    if (list_size(shooter_list) == 0) return;
-
-    list_node_t *it = list_begin(shooter_list);
-    while (it != list_end(shooter_list)) {
-        gunner_draw(*(gunner_t**)list_node_val(it));
-        it = list_node_next(it);
-    }
-}
-
 void (bullet_draw_list)(list_t *bullet_list) {
     if (list_size(bullet_list) == 0) return;
 
@@ -233,6 +234,8 @@
     }
     return 0;
 }
+static int16_t (map_get_x_screen)(const map_t *p){ (void)p; return (int16_t)((-x_origin)*scale); }
+static int16_t (map_get_y_screen)(const map_t *p){ (void)p; return (int16_t)((-y_origin)*scale); }
 map_t* (map_ctor)(const char *const *background, const char *const *collide){
     map_t *ret = malloc(sizeof(map_t));
     if(ret == NULL) return NULL;
@@ -285,22 +288,8 @@
     free(p->visited);
     free(p);
 }
-static int16_t (map_get_x_screen)(const map_t *p){ (void)p; return (int16_t)((-x_origin)*scale); }
-static int16_t (map_get_y_screen)(const map_t *p){ (void)p; return (int16_t)((-y_origin)*scale); }
 uint16_t (map_get_width)   (const map_t *p){ return sprite_get_w(p->background); }
 uint16_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_ = (int16_t)x, y_ = (int16_t)y;
-    if(x_ < 0 || w <= x_ || y_ < 0 || h <= y_) return 0;
-    int32_t pos = x_ + y_*w;
-    if(0 <= pos && pos < w*h) return p->collide[pos];
-    else return false;
-}
-int (map_collides_gunner)(const map_t *p, const gunner_t *shooter) {
-    double radius = max_d(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
-    return map_collides_gunner_pos(p, gunner_get_x(shooter), gunner_get_y(shooter), radius);
-}
 int (map_make_dijkstra)(map_t *p, double x_, double y_){
     int16_t x = (int16_t)x_, y = (int16_t)y_;
 
@@ -345,7 +334,26 @@
     *theta = atan2(-(newy-y_), newx-x_);
     return SUCCESS;
 }
+void   (map_draw)(map_t *p){
+    const int16_t x_screen = map_get_x_screen(p);
+    const int16_t y_screen = map_get_y_screen(p);
+    sprite_set_pos  (p->background, x_screen, y_screen);
+    sprite_set_scale(p->background, scale);
+    sprite_draw     (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_ = (int16_t)x, y_ = (int16_t)y;
+    if(x_ < 0 || w <= x_ || y_ < 0 || h <= y_) return 0;
+    int32_t pos = x_ + y_*w;
+    if(0 <= pos && pos < w*h) return p->collide[pos];
+    else return false;
+}
 
+int (map_collides_gunner)(const map_t *p, const gunner_t *shooter) {
+    double radius = max_d(sprite_get_w(shooter->dude), sprite_get_h(shooter->dude))/2.0;
+    return map_collides_gunner_pos(p, gunner_get_x(shooter), gunner_get_y(shooter), radius);
+}
 int (map_collides_bullet)(const map_t *p, const bullet_t *bull){
     double radius = max_d(sprite_get_w(bull->b), sprite_get_h(bull->b))/2.0;
     double bullet_x = bullet_get_x(bull);
@@ -357,7 +365,6 @@
     }
     return 0;
 }
-
 int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull){
     if(bull->shooter == shooter) return false;
 
@@ -374,19 +381,24 @@
     double distance = sqrt(dx*dx + dy*dy);
     return distance <= shooter_radius+bullet_radius;
 }
+void (get_random_spawn)(const map_t *map, gunner_t *p, list_t *l) {
+    uint16_t w = map_get_width(map), h = map_get_height(map);
+    double x, y;
 
-int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2) {
-    if (shooter1 == shooter2) return false;
-    double shooter1_radius = max_d(sprite_get_w(shooter1->dude), sprite_get_h(shooter1->dude))/2.0;
-    double shooter2_radius = max_d(sprite_get_w(shooter2->dude), sprite_get_h(shooter2->dude))/2.0;
-    double distance = gunner_distance(shooter1, shooter2);
-    return distance <= shooter1_radius+shooter2_radius;
+    while(true){
+        x = rand() % w;
+        y = rand() % h;
+        gunner_set_pos(p, x, y);
+        if(map_collides_gunner(map, p)) continue;
+        int collides = false;
+        list_node_t *it = list_begin(l);
+        while(it != list_end(l)){
+            if(gunner_collides_gunner(p, *list_node_val(it))){
+                collides = true;
+                break;
+            }
+            it = list_node_next(it);
+        }
+        if(!collides) return;
+    }
 }
-
-void   (map_draw)(map_t *p){
-    const int16_t x_screen = map_get_x_screen(p);
-    const int16_t y_screen = map_get_y_screen(p);
-    sprite_set_pos  (p->background, x_screen, y_screen);
-    sprite_set_scale(p->background, scale);
-    sprite_draw     (p->background);
-}
Index: proj/src/proj_func.c
===================================================================
--- proj/src/proj_func.c	(revision 339)
+++ proj/src/proj_func.c	(revision 340)
@@ -251,28 +251,6 @@
     }
 }
 
-void (get_random_spawn)(const map_t *map, gunner_t *p, list_t *l) {
-    uint16_t w = map_get_width(map), h = map_get_height(map);
-    double x, y;
-
-    while(true){
-        x = rand() % w;
-        y = rand() % h;
-        gunner_set_pos(p, x, y);
-        if(map_collides_gunner(map, p)) continue;
-        int collides = false;
-        list_node_t *it = list_begin(l);
-        while(it != list_end(l)){
-            if(gunner_collides_gunner(p, *list_node_val(it))){
-                collides = true;
-                break;
-            }
-            it = list_node_next(it);
-        }
-        if(!collides) return;
-    }
-}
-
 void update_scale(void) {
     static uint8_t last_plus = 0, last_minus = 0;
     if (key_presses.ctrl_pressed) {
