/**
 * Player Entity
 */
game.PlayerEntity = me.Entity.extend({

    /**
     * constructor
     */
    init:function (x, y, settings) {
        // call the constructor
        this._super(me.Entity, 'init', [x, y , settings]);
        this.name = 'player';

        // viewport must follow the player
        me.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH);

        // we set the velocity of the player's body
        this.body.setVelocity(2, 9);

        // we always update the player, ALWAYS
        this.alwaysUpdate = true;

        // setting constants related to jumping
        this.onAirTime = 100;
        this.JUMP_MAX_AIRBONRNE_TIME = 80;

        // animations
        this.renderable.addAnimation('idle', [0, 1, 2], 150);
        this.renderable.addAnimation('walk', [3, 4, 5, 6, 7, 8], 100);
        this.renderable.addAnimation('jump', [15, 16], 50);
        this.renderable.addAnimation('fall', [18, 19], 50);
        this.setCurrentAnimation('idle');
    },

    setCurrentAnimation: function(name, onComplete) {
        if (!this.renderable.isCurrentAnimation(name)) {
            this.renderable.setCurrentAnimation(name, onComplete);
        }
    },

    /**
     * update the entity
     */
    update : function (dt) {

        // handling movement on the side
        if (me.input.isKeyPressed('left')) {
            this.renderable.flipX(true);
            this.body.vel.x -= this.body.accel.x * me.timer.tick;
        } else if (me.input.isKeyPressed('right')) {
            this.renderable.flipX(false);
            this.body.vel.x += this.body.accel.x * me.timer.tick;
        } else {
            this.body.vel.x = 0;
        }

        //TODO : remove, just for debug purposes
        if (me.input.isKeyPressed('e')) {
          me.game.world.getChildByName("HUD")[0].pigletRescued();
        }

        //handling jump
        if (me.input.isKeyPressed('up')) {
            if (!this.body.jumping &&
                (!this.body.falling ||
                 this.onAirTime < this.JUMP_MAX_AIRBONRNE_TIME)) {
                this.body.vel.y = -this.body.maxVel.y * me.timer.tick;
                this.body.jumping = true;
            }
        }

        this.onAirTime += dt;
        if (!this.body.falling && !this.body.jumping) {
            this.onAirTime = 0;
        }

        // apply physics to the body (this moves the entity)
        this.body.update(dt);

        // handle collisions against other shapes
        me.collision.check(this);

        // update animation
        if (this.body.jumping) {
            this.setCurrentAnimation('jump');
        } else if (this.body.falling) {
            this.setCurrentAnimation('fall');
        } else if (this.body.vel.x !== 0) {
            this.setCurrentAnimation('walk');
        } else {
            this.setCurrentAnimation('idle');
        }

        // return true if we moved or if the renderable was updated
        return (this._super(me.Entity, 'update', [dt]) || this.body.vel.x !== 0 || this.body.vel.y !== 0);
    },

   /**
     * colision handler
     * (called when colliding with other objects)
     */
    onCollision : function (response, other) {
        if (other.name === 'ball') {
            return false;
        }
        // Make all other objects solid
        return true;
    }
});

@@ -812,24 +812,98 @@
 , 8%5D, 100);%0A
+        this.renderable.addAnimation('run', %5B9, 10, 11, 12, 13, 14%5D, 70);%0A
         this
@@ -1002,32 +1002,262 @@
  %5B18, 19%5D, 50);%0A
+        this.renderable.addAnimation('kick', %5B20, 21, 21, 21, 22%5D, 50);%0A        this.renderable.addAnimation('stun', %5B23, 24, 23, 24, 23, 24%5D, 50); // Must blink%0A        this.renderable.addAnimation('win', %5B25, 26, 27, 26%5D, 120);%0A
         this.set

define other pig animations