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