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. */
23 /* Initialize island map "~" cells representing water and "." cells representing
24 * land. The island shape is built randomly by starting with a sea of one land
25 * cell in the middle, then going into a cycle of repeatedly selecting a random
26 * seal cell and transforming it into land if it is neighbor to land; the cycle
27 * ends when a land cell is due to be created right at the border of the map.
29 extern void init_map();
31 /* Check if coordinate "pos" on (or beyond) world.map is accessible to map
34 extern uint8_t is_passable(struct yx_uint8 pos);