Neat Javascript Game

I am almost done with this JS Game but I am having an error in the game where once I am hit by an enemy, the game does not end, it jut starts over. What is wrong?

What part of the code do you think “should” be stopping the game?

Starting around underneath line 183…?

The error I’m getting is AnimationId is not defined

That is because you never defined a variable named AnimationId.


It’s supposed to be defines on line 152 right?

JavaScript is case-sensitive.


Haha whoops! It’s all good now. Thank you!