diff options
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +const cities = data.cities +const last_city = cities.name.length - 1 + +const ui = { + map_pieces: document.getElementById("pieces"), + cities: [], +} + +function on_init() { + for (let s = 0; s <= last_city; ++s) { + let e = ui.cities[s] = document.createElement("div") + e.className = "city" + e.style.left = (cities.x[s] - 9) + "px" + e.style.top = (cities.y[s] - 9) + "px" + map_pieces.appendChild(e) + } +} + +on_init() |