comparison game/js/map.js @ 36:a464bd43b76c 1.0.0

clean documentation rewrite
author ark
date 2026-10-21 22:34 +0200
parents 2f555a54c332
children
comparison
equal deleted inserted replaced
35:0d40f346059c 36:a464bd43b76c
203 return count.map(function (c, i) { 203 return count.map(function (c, i) {
204 return total ? c >= SIDE_SHARE * total : i === nearSide; 204 return total ? c >= SIDE_SHARE * total : i === nearSide;
205 }); 205 });
206 }; 206 };
207 207
208 // route weights for a monster of the given speed (balance.md, route 208 // route weights for a monster of the given speed (game.md, routes)
209 // preference)
210 GameMap.prototype.routeWeights = function (speed) { 209 GameMap.prototype.routeWeights = function (speed) {
211 var rp = cfg.route_preference; 210 var rp = cfg.route_preference;
212 var f = MM.util.clamp((speed - rp.reference_speed) / rp.reference_speed, -1, 1); 211 var f = MM.util.clamp((speed - rp.reference_speed) / rp.reference_speed, -1, 1);
213 return this.routes.map(function (r) { 212 return this.routes.map(function (r) {
214 return Math.max(rp.min_weight, 1 + rp.bias * f * (2 * r.value - 1)); 213 return Math.max(rp.min_weight, 1 + rp.bias * f * (2 * r.value - 1));