comparison game/js/map.js @ 14:7fda634d15ad

adjustments to wave logic, tower pivot points
author ark
date 2026-10-19 22:50 +0200
parents 22b604680c5a
children
comparison
equal deleted inserted replaced
13:8df95050fc8b 14:7fda634d15ad
215 if (r.weight !== null) return r.weight; 215 if (r.weight !== null) return r.weight;
216 return Math.max(rp.min_weight, 1 + rp.bias * f * (2 * r.value - 1)); 216 return Math.max(rp.min_weight, 1 + rp.bias * f * (2 * r.value - 1));
217 }); 217 });
218 }; 218 };
219 219
220 // index of the shortest route, leaving out routes with a fixed weight
221 // of 0 in routes.toml
222 GameMap.prototype.shortestRoute = function () {
223 var best = -1;
224 this.routes.forEach(function (r, i) {
225 if (r.weight === 0) return;
226 if (best < 0 || r.length < this.routes[best].length) best = i;
227 }, this);
228 return best;
229 };
230
220 return GameMap; 231 return GameMap;
221 })(); 232 })();