From 1950fe7b0679c6b6486cc7b25bef813db2b1bb4e Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Wed, 30 Mar 2022 08:28:47 +0200 Subject: Implement sub-tile collboxes These will be later used by the pathfinding algorithm. --- src/game/src/game.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/game') diff --git a/src/game/src/game.c b/src/game/src/game.c index 3145c91..b583c5c 100644 --- a/src/game/src/game.c +++ b/src/game/src/game.c @@ -17,6 +17,10 @@ int game(void) enum {HUMAN_PLAYERS = 1, MAP_RESOURCES = 3}; struct human_player humans[HUMAN_PLAYERS]; + struct terrain_map map; + + terrain_init(&map); + building_set_alive_cb(terrain_block_update, &map); for (size_t i = 0; i < sizeof humans / sizeof *humans; i++) { @@ -36,10 +40,9 @@ int game(void) goto end; } - struct terrain_map map; struct resource res[MAP_RESOURCES] = {0}; - terrain_init(&map); + resource_set_alive_cb(terrain_block_update, &map); if (resource_create(&(const struct resource_cfg) { -- cgit v1.2.3