diff game/js/monster.js @ 14:7fda634d15ad

adjustments to wave logic, tower pivot points
author ark
date 2026-10-19 22:50 +0200
parents 22b604680c5a
children
line wrap: on
line diff
--- a/game/js/monster.js	Mon Oct 19 21:59:53 2026 +0200
+++ b/game/js/monster.js	Mon Oct 19 22:50:52 2026 +0200
@@ -10,13 +10,13 @@
     var AIR = 0.8;
 
     // a new monster of the given kind at the start of a route chosen by
-    // the map's route weights
+    // the map's route weights. a boss takes the shortest route
     function create(game, kind) {
         var def = cfg.monster[kind];
         var mv = cfg.movement;
         var map = game.map;
         var speed = def.speed * (1 + mv.speed_variation * (2 * game.random() - 1));
-        var r = MM.util.pick(map.routeWeights(speed), game.random);
+        var r = def.boss ? map.shortestRoute() : MM.util.pick(map.routeWeights(speed), game.random);
         var route = map.routes[r];
         // sideways offsets at every wander_step along the route: a fixed
         // lean plus a wandering part, together within the map's largest offset