Even more improvements

This commit is contained in:
Andras Schmelczer 2026-06-11 21:43:49 +01:00
parent e3c44f775b
commit ec579650d7
5 changed files with 724 additions and 109 deletions

View file

@ -311,7 +311,8 @@ export class NPC extends PlayerBase {
const leadTime = distance / projectileSpeed;
const aim = vec2.scaleAndAdd(vec2.create(), target.center, velocity, leadTime);
(npcTuning.spreadBase + distance * npcTuning.spreadPerDistance) *
const spread =
(npcTuning.spreadBase + distance * npcTuning.spreadPerDistance) *
(npcTuning.spreadAggressionFalloff - this.aggression);
aim.x += Random.getRandomInRange(-spread, spread);
aim.y += Random.getRandomInRange(-spread, spread);