diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-03-18 01:49:30 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-03-18 01:49:30 +0100 |
commit | a2bcf4451cbf7b763d7fb50d4b8a65ad5321af7e (patch) | |
tree | 55ca169154fedea57b37eb0b28f1c6826a5b0b62 /play.js | |
parent | 0b8fbd420d0c34d862027ce2562146f7b3084c53 (diff) | |
download | maria-a2bcf4451cbf7b763d7fb50d4b8a65ad5321af7e.tar.gz |
markers.
Diffstat (limited to 'play.js')
-rw-r--r-- | play.js | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -22,23 +22,25 @@ function make_road(type, x, y, dx, dy) { } function on_init() { - for (let a = 0; a <= last_city; ++a) { - for (let b of cities.major_roads[a]) { - if (a < b) { - let dx = cities.x[a] - cities.x[b] - let dy = cities.y[a] - cities.y[b] - let x = (cities.x[a] + cities.x[b]) / 2 - let y = (cities.y[a] + cities.y[b]) / 2 - make_road("major_road", x - 10, y - 3, dx, dy) + if (false) { + for (let a = 0; a <= last_city; ++a) { + for (let b of cities.major_roads[a]) { + if (a < b) { + let dx = cities.x[a] - cities.x[b] + let dy = cities.y[a] - cities.y[b] + let x = (cities.x[a] + cities.x[b]) / 2 + let y = (cities.y[a] + cities.y[b]) / 2 + make_road("major_road", x - 10, y - 3, dx, dy) + } } - } - for (let b of cities.roads[a]) { - if (a < b) { - let dx = cities.x[a] - cities.x[b] - let dy = cities.y[a] - cities.y[b] - let x = (cities.x[a] + cities.x[b]) / 2 - let y = (cities.y[a] + cities.y[b]) / 2 - make_road("road", x - 10, y - 1, dx, dy) + for (let b of cities.roads[a]) { + if (a < b) { + let dx = cities.x[a] - cities.x[b] + let dy = cities.y[a] - cities.y[b] + let x = (cities.x[a] + cities.x[b]) / 2 + let y = (cities.y[a] + cities.y[b]) / 2 + make_road("road", x - 10, y - 1, dx, dy) + } } } } @@ -64,6 +66,7 @@ function on_init() { y -= 12 } + e.classList.add("hide") e.style.left = x + "px" e.style.top = y + "px" e.title = cities.name[a] |