Skip to content

Commit

Permalink
Stop Militia if they are close to you
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikketer committed Jul 14, 2024
1 parent f6cb179 commit 20d9f3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion militia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 20d9f3b

Please sign in to comment.