ig.module( 
    'game.entities.spawnchest' 
)
.requires(
    'impact.entity' 
)

.defines(function(){

// Play this when a character spawns in a or leaves a map.
EntitySpawnchest = ig.Entity.extend({

    animSheet: new ig.AnimationSheet( 'media/T.png', 48, 48 ),
    collides: ig.Entity.COLLIDES.NEVER,
    id: -1,

    init: function( x, y, settings ) {
        this.parent(x, y, settings);

        //this.addAnim('default', 1, [0] );

        if(!ig.editor){
            var chest = ig.game.spawnEntity(EntityChest, this.pos.x, this.pos.y, {});
            ig.game.chests.push(chest);

            // Re-sort Entities
            ig.game.sortEntitiesDeferred();
        }
    },
})
});