Index: proj/include/ent.h
===================================================================
--- proj/include/ent.h	(revision 338)
+++ proj/include/ent.h	(revision 339)
@@ -1,6 +1,13 @@
 #ifndef ENT_H_INCLUDED
 #define ENT_H_INCLUDED
 
+/**
+ * @defgroup ent ent
+ * @brief Entities module
+ *
+ * @{
+ */
+
 #include "basic_sprite.h"
 #include "list.h"
 
@@ -11,6 +18,18 @@
 double (ent_get_XLength)(void);
 double (ent_get_YLength)(void);
 
+/**
+ * @}
+ */
+
+/**
+ * @defgroup gunner_t gunner_t
+ * @ingroup ent
+ * @brief Gunner module.
+ *
+ * @{
+ */
+
 #define GUNNER_MELEE    BIT(0)
 #define GUNNER_RANGED   BIT(1)
 #define GUNNER_PLAYER   BIT(2)
@@ -37,9 +56,22 @@
 int     (gunner_get_team)           (const gunner_t *p);
 void (gunner_draw)(gunner_t *p);
 void (gunner_draw_health)(const gunner_t *p);
-
+void (gunner_draw_list)(list_t *shooter_list);
 double (gunner_distance)(const gunner_t *p1, const gunner_t *p2);
+int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2);
 
+/**
+ * @}
+ */
+
+/**
+ * @defgroup bullet_t bullet_t
+ * @ingroup ent
+ * @brief Bullet module.
+ *
+ * @{
+ */
+
 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);
 void      (bullet_dtor)(bullet_t *p);
@@ -55,24 +87,36 @@
 void (bullet_update_movement)(bullet_t *p);
 void (bullet_update_movement_list)(list_t *bullet_list);
 void (bullet_draw)(bullet_t *p);
-
-void (gunner_draw_list)(list_t *shooter_list);
 void (bullet_draw_list)(list_t *bullet_list);
-void (gunner_draw_health)(const gunner_t *p);
 
+/**
+ * @}
+ */
+
+/**
+ * @defgroup map_t map_t
+ * @ingroup ent
+ * @brief Bullet module.
+ *
+ * @{
+ */
+
 typedef struct map map_t;
 map_t* (map_ctor)(const char *const *background, const char *const *collide);
 void   (map_dtor)(map_t *p);
-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);
 uint16_t (map_get_width)   (const map_t *p);
 uint16_t (map_get_height)  (const map_t *p);
 int (map_make_dijkstra)(map_t *p, double x_, double y_);
 int (map_where_to_follow)(const map_t *p, double x, double y, double *theta);
-int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull);
-double (distance_gunners)(const gunner_t *shooter1, const gunner_t *shooter2);
-int (gunner_collides_gunner)(const gunner_t *shooter1, const gunner_t *shooter2);
 void   (map_draw)(map_t *p);
+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);
+int (gunner_collides_bullet)(const gunner_t *shooter, const bullet_t *bull);
+
 #endif //ENT_H_INCLUDED
Index: proj/include/proj_func.h
===================================================================
--- proj/include/proj_func.h	(revision 338)
+++ proj/include/proj_func.h	(revision 339)
@@ -43,7 +43,7 @@
 
 double get_mouse_angle(gunner_t *p);
 
-typedef struct timer {
+typedef struct {
     int time;
     text_t *text;
 } text_timer_t;
Index: proj/include/proj_structures.h
===================================================================
--- proj/include/proj_structures.h	(revision 338)
+++ proj/include/proj_structures.h	(revision 339)
@@ -4,7 +4,10 @@
 #include <stdint.h>
 #include "ent.h"
 
-typedef struct keys {
+/**
+ * @brief Key presses.
+ */
+typedef struct {
     /// @brief W is pressed when 1
     uint8_t w_pressed       : 1;
     /// @brief A is pressed when 1
@@ -23,6 +26,9 @@
     uint8_t lb_pressed      : 1;
 } keys_t;
 
+/**
+ * @brief Information to transmit from host to remote.
+ */
 typedef struct {
     // host
     /// @brief Host player X-position
@@ -49,14 +55,35 @@
     int16_t    remote_current_health;
 
     // bullets
+    /// @brief Number of bullets
     uint8_t    no_bullets;
+    /// @brief X-position of the bullets
     int16_t   *bullets_x;
+    /// @brief Y-position of the bullets
     int16_t   *bullets_y;
+    /// @brief X-speed of the bullets
     int16_t   *bullets_vx;
+    /// @brief Y-speed of the bullets
     int16_t   *bullets_vy;
+    /// @brief Who shot each bullet
     bool      *bullets_shooter; // false for host, true for remote
 } host_info_t;
+/**
+ * @brief Construct host information.
+ * @param   host    Pointer to host gunner
+ * @param   remote  Pointer to remote gunner
+ * @return  Pointer to constructed host information, or NULL if failed
+ */
+host_info_t* host_info_ctor(gunner_t *host, gunner_t *remote);
+/**
+ * @brief Destruct host information.
+ * @param   p   Pointer to host information to be destructed
+ */
+void host_info_dtor(host_info_t *p);
 
+/**
+ * @brief Information to transmit from remote to host.
+ */
 typedef struct {
     /// @brief Remote keys that are pressed
     keys_t  remote_keys_pressed;
@@ -63,22 +90,33 @@
     /// @brief Remote player angle
     double  remote_angle;
 } remote_info_t;
+/**
+ * @brief Construct remote information.
+ * @return  Pointer to constructed remote information, or NULL if failed
+ */
+remote_info_t* remote_info_ctor(void);
+/**
+ * @brief Destruct remote information.
+ * @param   p   Pointer to remote information to be destructed
+ */
+void remote_info_dtor(remote_info_t *p);
 
+/**
+ * @brief Bullet event to transmit from remote to host.
+ */
 typedef struct {
     /// @brief New bullet signal from remote
     bool   new_bullet;
 } bullet_info_t;
-
-host_info_t* host_info_ctor(gunner_t *host, gunner_t *remote);
-
-void host_info_dtor(host_info_t *p);
-
-remote_info_t* remote_info_ctor(void);
-
-void remote_info_dtor(remote_info_t *p);
-
+/**
+ * @brief Construct bullet event.
+ * @return  Pointer to constructed bullet event, or NULL if failed
+ */
 bullet_info_t* bullet_info_ctor(void);
-
+/**
+ * @brief Destruct bullet event.
+ * @param   p   Pointer to bullet event to be destructed
+ */
 void bullet_info_dtor(bullet_info_t *p);
 
 #endif /* end of include guard: PROJ_STRUCTURES_H_INCLUDED */
Index: proj/libs/graph/include/basic_sprite.h
===================================================================
--- proj/libs/graph/include/basic_sprite.h	(revision 338)
+++ proj/libs/graph/include/basic_sprite.h	(revision 339)
@@ -10,6 +10,10 @@
  *
  * @{
  */
+
+/**
+ * @brief Basic sprite.
+ */
 typedef struct basic_sprite basic_sprite_t;
 
 /**
Index: proj/libs/kbc/include/mouse.h
===================================================================
--- proj/libs/kbc/include/mouse.h	(revision 338)
+++ proj/libs/kbc/include/mouse.h	(revision 339)
@@ -19,9 +19,27 @@
 int (subscribe_mouse_interrupt)(uint8_t interrupt_bit, int *interrupt_id);
 
 //These have to do with mouse_ih
+/**
+ * @brief Get previous mouse interrupt handler call exit code.
+ * @return  Exit code of previous mouse IH call
+ */
 int (mouse_get_got_error_mouse_ih)(void);
+/**
+ * @brief Get mouse packet.
+ * @return  Pointer to mouse packet
+ */
 const uint8_t* (mouse_get_packet_mouse_ih)(void);
+/**
+ * @brief Number of mouse bytes received (0 to 3).
+ * @return  Number of bytes
+ */
 int (mouse_get_counter_mouse_ih)(void);
+/**
+ * @brief Set number of received mouse bytes.
+ *
+ * Usually this function is used to reset counter_mouse_ih.
+ * @param   n   New value of the counter
+ */
 void (mouse_set_counter_mouse_ih)(int n);
 
 /**
Index: proj/libs/timer/include/timer.h
===================================================================
--- proj/libs/timer/include/timer.h	(revision 338)
+++ proj/libs/timer/include/timer.h	(revision 339)
@@ -11,10 +11,24 @@
 /** @brief Timer 0 IRQ line */
 #define TIMER0_IRQ     0
 
+/**
+ * @brief Subscribes Timer Interrupts and disables Minix Default IH.
+ * @param interrupt_bit Bit of Interrupt Vector that will be set when Timer Interrupt is pending
+ * @param interrupt_id Timer Interrupt ID to specify the Timer Interrupt in other calls
+ * @return ERROR_CODE code representing the result of the operation, SUCCESS code is returned if everything is OK
+ * @see {_ERRORS_H_::errors}
+ */
 int (subscribe_timer_interrupt)(uint8_t interrupt_bit, int *interrupt_id);
 
+/**
+ * @brief Timer interrupt handler. Increases interrupt counter.
+ */
 void (timer_int_handler)(void);
 
+/**
+ * @brief Get number of timer interrupts.
+ * @return  Number of timer interrupts.
+ */
 uint32_t (timer_get_no_interrupts)(void);
 
 /**
Index: proj/src/ent.c
===================================================================
--- proj/src/ent.c	(revision 338)
+++ proj/src/ent.c	(revision 339)
@@ -375,23 +375,11 @@
     return distance <= shooter_radius+bullet_radius;
 }
 
-double (distance_gunners)(const gunner_t *shooter1, const gunner_t *shooter2) {
-    double shooter1_x = gunner_get_x(shooter1);
-    double shooter1_y = gunner_get_y(shooter1);
-
-    double shooter2_x = gunner_get_x(shooter2);
-    double shooter2_y = gunner_get_y(shooter2);
-
-    double dx = shooter1_x - shooter2_x;
-    double dy = shooter1_y - shooter2_y;
-    return sqrt(dx*dx + dy*dy);
-}
-
 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 = distance_gunners(shooter1, shooter2);
+    double distance = gunner_distance(shooter1, shooter2);
     return distance <= shooter1_radius+shooter2_radius;
 }
 
Index: proj/src/proj.c
===================================================================
--- proj/src/proj.c	(revision 338)
+++ proj/src/proj.c	(revision 339)
@@ -296,7 +296,7 @@
     do {
         get_random_spawn(map1, shooter1, shooter_list);
         get_random_spawn(map1, shooter2, shooter_list);
-    } while (distance_gunners(shooter1, shooter2) < 500);
+    } while (gunner_distance(shooter1, shooter2) < 500);
 
     host_info = host_info_ctor(shooter1, shooter2);
     remote_info = remote_info_ctor();
