DungeonCrawl
|
Implements functionality for populating the generated game map. More...
Go to the source code of this file.
Functions | |
int | is_dead_end (int x, int y) |
Check if a cell is a dead end (is floor and has only one neighboring non-wall cell) | |
void | place_key () |
Place a key in a dead end that is not the start or exit edge. | |
int | is_close_to_enemy (int x, int y) |
Check if a cell is close to an enemy (based on ENEMY_MIN_DISTANCE) | |
void | place_enemies () |
Place enemies in random locations on the map. | |
void | place_fountains () |
Place a mana fountain and a life fountain in random dead ends on the map. | |
void | populate_map () |
@breif Populates the map with a key, enemies, and fountains |
Implements functionality for populating the generated game map.
Definition in file map_populator.c.
int is_close_to_enemy | ( | int | x, |
int | y ) |
Check if a cell is close to an enemy (based on ENEMY_MIN_DISTANCE)
x | the x coordinate of the cell |
y | the y coordinate of the cell |
Definition at line 57 of file map_populator.c.
int is_dead_end | ( | int | x, |
int | y ) |
Check if a cell is a dead end (is floor and has only one neighboring non-wall cell)
x | the x coordinate of the cell |
y | the y coordinate of the cell |
Definition at line 17 of file map_populator.c.
void place_enemies | ( | ) |
Place enemies in random locations on the map.
Definition at line 71 of file map_populator.c.
void place_fountains | ( | ) |
Place a mana fountain and a life fountain in random dead ends on the map.
Definition at line 90 of file map_populator.c.
void place_key | ( | ) |
Place a key in a dead end that is not the start or exit edge.
Definition at line 37 of file map_populator.c.
void populate_map | ( | ) |
@breif Populates the map with a key, enemies, and fountains
Definition at line 112 of file map_populator.c.