3 * Struct for the game map and routines to create and scroll on it.
9 #include <stdint.h> /* uint8_t */
10 #include "../common/yx_uint16.h" /* yx_uint16 struct */
16 struct yx_uint16 size; /* Map's height/width in number of cells. */
17 char * cells; /* Sequence of bytes encoding map cells. */
18 uint8_t dist_orthogonal; /* Ratio of the diagonal movement penalty as */
19 uint8_t dist_diagonal; /* encoded by (.dist_diagonal/.dist_orthonal). */
24 /* Initialize island map "~" cells representing water and "." cells representing
25 * land. The shape of the island is generated randomly by starting with a sea
26 * containing one land cell in the middle and then going into a cycle of
27 * repeatedly selecting a random cell on the map and transforming it into a land
28 * cell if it is horizontally or vertically neighbor to one; the cycle ends when
29 * a land cell is due to be created right at the border of the map.
31 extern void init_map();
33 /* Check if coordinate "pos" on (or beyond) world.map is accessible to map
36 extern uint8_t is_passable(struct yx_uint16 pos);