diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:28:47 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:28:47 +0200 |
| commit | 1950fe7b0679c6b6486cc7b25bef813db2b1bb4e (patch) | |
| tree | c2098c9ec65f9a9e5fada68c0b51b0217f14b00c /src/game | |
| parent | 06056a9b5e900f67702c509ce1ba2e2351357fb7 (diff) | |
| download | jancity-1950fe7b0679c6b6486cc7b25bef813db2b1bb4e.tar.gz | |
Implement sub-tile collboxes
These will be later used by the pathfinding algorithm.
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/src/game.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) { |
