System.register(["../manager/Sequence"], function(exports_1) {
    var __extends = (this && this.__extends) || function (d, b) {
        for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
    var Sequence_1;
    var End;
    return {
        setters:[
            function (Sequence_1_1) {
                Sequence_1 = Sequence_1_1;
            }],
        execute: function() {
            End = (function (_super) {
                __extends(End, _super);
                function End() {
                    _super.apply(this, arguments);
                }
                End.prototype.preload = function () {
                    this.game.load.image('end_bg', 'assets/images/end_bg.png');
                    this.game.load.image('princess', 'assets/images/princess.png');
                    this.game.load.image('credits', 'assets/images/credits.png');
                    this.game.load.audio('end_music', 'assets/music/end.ogg');
                };
                End.prototype.create = function () {
                    var _this = this;
                    this.game.stage.backgroundColor = '#fff';
                    this.game.add.image(0, 0, 'end_bg');
                    this.music = this.game.add.audio('end_music');
                    this.music.play();
                    var princess = this.game.add.image(this.game.world.centerX, this.game.world.centerY, 'princess');
                    princess.anchor.setTo(0.5, 0.5);
                    var credits = this.game.add.image(0, 0, 'credits');
                    credits.position.y += this.game.height;
                    credits.position.x += 100;
                    var sequence = new Sequence_1.Sequence(this.game);
                    sequence.chain(5000, function () {
                        _this.game.add.tween(credits.position).to({ y: -240 }, 8000, Phaser.Easing.Linear.None, true);
                    });
                };
                End.prototype.shutdown = function () {
                    this.music.stop();
                };
                return End;
            })(Phaser.State);
            exports_1("End", End);
        }
    }
});
//# sourceMappingURL=End.js.map