/**
* Created by Largoyle on 12/04/2014.
*/
var __extends = this.__extends || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    __.prototype = b.prototype;
    d.prototype = new __();
};
/// <reference path="H:/Webpages/LudumDare/LD30/_assets/phaser/build/phaser.d.ts" />
var LEesLD30;
(function (LEesLD30) {
    var Player = (function (_super) {
        __extends(Player, _super);
        function Player(game, x, y) {
            _super.call(this, game, x, y, 'simon', 0);

            this.anchor.setTo(0.5, 0);

            this.animations.add('walk', [0, 1, 2, 3, 4], 10, true);

            game.add.existing(this);
        }
        Player.prototype.update = function () {
            this.body.velocity.x = 0;

            if (this.game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
                this.body.velocity.x = -150;
                this.animations.play('walk');

                if (this.scale.x == 1) {
                    this.scale.x = -1;
                }
            } else if (this.game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
                this.body.velocity.x = 150;
                this.animations.play('walk');

                if (this.scale.x == -1) {
                    this.scale.x = 1;
                }
            } else if (this.game.input.keyboard.isDown(Phaser.Keyboard.UP)) {
                this.body.y = -150;
                // this.animations.play('walk');
                //                if (this.scale.x == -1) {
                //                    this.scale.x = 1;
                //                }
            } else {
                this.animations.frame = 0;
            }
        };
        return Player;
    })(Phaser.Sprite);
    LEesLD30.Player = Player;
})(LEesLD30 || (LEesLD30 = {}));
//# sourceMappingURL=Player.js.map
