comparison doc/architecture.md @ 9:53f015966118

map, path, tower placement adjustments
author ark
date 2026-10-19 15:55 +0200
parents 2c4fed8baed9
children 22b604680c5a
comparison
equal deleted inserted replaced
8:2c4fed8baed9 9:53f015966118
108 levels 2-5. fill the inside of the outline with white (flood fill from 108 levels 2-5. fill the inside of the outline with white (flood fill from
109 outside, everything not reached is inside), trim, write as t0_2..t0_5 and 109 outside, everything not reached is inside), trim, write as t0_2..t0_5 and
110 so on. see art.md 110 so on. see art.md
111 3. maps: copy the map images, possibly converted to a smaller format 111 3. maps: copy the map images, possibly converted to a smaller format
112 4. masks: for each map 112 4. masks: for each map
113 - classify pixels as path, entrance, exit or free, using colour 113 - classify pixels as path, entrance, exit or free by their exact colour.
114 thresholds (the mask edges are soft) 114 masks must have hard edges: a pixel that is neither fully transparent
115 - compute the distance from every free pixel to the nearest path pixel 115 nor opaque pure red, blue or green stops the build (art.md)
116 - extract routes, see below
116 - write a placement grid: cells where a tower footprint fits next to the 117 - write a placement grid: cells where a tower footprint fits next to the
117 path, within the limits in balance.md 118 road, within the limits in balance.md. the red path in the mask is the
118 - extract routes, see below 119 centre line of the road; the road's half width is set per map
119 5. sounds: embed art/sounds/*.mp3 as base64 in game/data/sounds.js, 120 5. sounds: embed art/sounds/*.mp3 as base64 in game/data/sounds.js,
120 grouped by event 121 grouped by event
121 6. config: read config/game.toml, check it, write game/data/config.js 122 6. config: read config/game.toml, check it, write game/data/config.js
122 7. checks: print a summary per map (routes with length and turning, monster 123 7. checks: print a summary per map (routes with length and turning, monster
123 counts, coins and hp per map against the target) and warn on problems 124 counts, coins and hp per map against the target) and warn on problems