game: extract jitter for fidget

This commit is contained in:
He4eT 2025-06-16 12:51:14 +02:00
commit 2c5465222e

View file

@ -256,7 +256,8 @@ const enemyBlueprints = {
dangerZone: 8, dangerZone: 8,
value: 3, value: 3,
behaviour: (enemy) => { behaviour: (enemy) => {
if (Math.random() < 0.05) { const jitter = 0.05
if (Math.random() < jitter) {
const angle = Math.random() * 2 * Math.PI const angle = Math.random() * 2 * Math.PI
const current = enemy.positions[0] const current = enemy.positions[0]
const randomPrevious = { const randomPrevious = {