From 20d9f3b1be44560f3b700b50863b412128b6ca19 Mon Sep 17 00:00:00 2001 From: Chris Weed Date: Sun, 14 Jul 2024 16:34:19 -0500 Subject: [PATCH] Stop Militia if they are close to you --- menu.ts | 1 + militia.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/menu.ts b/menu.ts index 1fa381e..48ef97b 100644 --- a/menu.ts +++ b/menu.ts @@ -18,6 +18,7 @@ namespace Menu { _choiceSprite.x = 80 _choiceSprite.y = 100 + music.stopAllSounds() music.play(music.createSong(assets.song`Title`), music.PlaybackMode.LoopingInBackground) controller.player1.A.addEventListener(ControllerButtonEvent.Pressed, startGame) diff --git a/militia.ts b/militia.ts index 9a62e35..1617491 100644 --- a/militia.ts +++ b/militia.ts @@ -80,7 +80,9 @@ class Militia { { x: this.sprite.x, y: this.sprite.y }, { x: this.currentTarget.sprite.x, y: this.currentTarget.sprite.y } )) < 30) { - console.log('SSTop walking!') + this.sprite.follow(this.currentTarget.sprite, 0) + } else { + this.sprite.follow(this.currentTarget.sprite, Militia.speed) } }