// namespace
var App = App || {};

App.Flag = (function () {
    "use strict";

    var fn = function (game, x, y, args) {
        Phaser.Sprite.call(this, game, x, y, args.image_key);

        // Create animation linked to this object
        if (args.init) args.init(this, args);

        this.animations.play('wave');

        this.game.physics.arcade.enable(this);

        this.following = null;
    };

    fn.prototype = Object.create(Phaser.Sprite.prototype);
    fn.prototype.constructor = fn;

    fn.prototype.update = function () {
        if (this.game.global.player && ! this.following) {
            if (this.game.physics.arcade.collide(this.game.global.player, this) ) {
                this.following = this.game.global.player;
            }
        }

        if (this.following) {
            this.x = this.following.x;
            this.y = this.following.y;
        }
    };

    return fn;
})();

@@ -279,24 +279,144 @@
 s);%0A%0A       
+ // If there exists any animation, then play it.%0A        var anim = _.keys(this.animations._anims)%5B0%5D;%0A        if (anim)
  this.animat
@@ -429,14 +429,12 @@
 lay(
-'wave'
+anim
 );%0A%0A

Change flag.js to just play any animation instead of hard coding animation_name "wave"