Skip to content

Commit

Permalink
Merge pull request #16 from jwunderl/stop-on-null-path
Browse files Browse the repository at this point in the history
stop sprite when user gives invalid path
  • Loading branch information
jwunderl authored Oct 18, 2020
2 parents cc5a0c6 + 925d790 commit 352e6af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions path-following.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ namespace scene {
for (let i = pathFollowingSprites.length - 1; i >= 0; i--) {
const pfs = pathFollowingSprites[i];
if (pfs.sprite === sprite) {
sprite.vx = 0;
sprite.vy = 0;
pathFollowingSprites.removeAt(i);
}
}
Expand Down

0 comments on commit 352e6af

Please sign in to comment.