Instance variables are better suited for this.. And who knows how those "is animation playing" checks affect performance, especially considering that you run them on every tick.
And it just doesn't feel right to me
Develop games in your browser. Powerful, performant & highly capable.