mirror of
https://github.com/He4eT/DotDashPit.git
synced 2026-05-04 17:37:23 +00:00
game: extract jitter for fidget
This commit is contained in:
parent
f93942d9ed
commit
2c5465222e
1 changed files with 2 additions and 1 deletions
3
game.js
3
game.js
|
|
@ -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 = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue