ig.module(
    'game.entities.busting'
)
    .requires(
    'impact.entity'
)
    .defines(function () {
        Entitybust = ig.Entity.extend({
          size:{x:182, y:185},
            animSheet:new ig.AnimationSheet('media/Burst6_01-09.png',189,189),
            animSheet2:new ig.AnimationSheet('media/Burst6_10-90.png',189,189),
            zIndex:1000, 
               addAnim: function( name, frameTime, sequence, stop , SheetToUse) {
             if( typeof(SheetToUse) == "undefined" ) {
                    SheetToUse = this.animSheet;
                    //throw( 'No animSheet to add the animation '+name+' to.' );
                }
                var a = new ig.Animation( SheetToUse, frameTime, sequence, stop );
                this.anims[name] = a;
                if( !this.currentAnim ) {
                    this.currentAnim = a;
                }
                return a;
            },
                init:function (x,y,settings){
                  this.parent(x, y, settings);
                this.addAnim('busting1', 0.1,[1,2,3,4,5,7,8,9], true);
                this.addAnim('busting2', 0.1,[10,11,12,13,14,15,16,17,18], true);
                this.addAnim('busting3', 0.1,[19,20,21,22,23,24,25,26,27], true);
                this.addAnim('busting4', 0.1,[28,29,30,31,32,33,34,35,36], true);
                this.addAnim('busting5', 0.1,[37,38,39,40,41,42,43,44,45], true);
                this.addAnim('busting6', 0.1,[46,47,48,49,50,51,52,53,54],true);
                this.addAnim('busting7', 0.1,[55,56,57,58,59,60,61,62,63],true);
                this.addAnim('busting8', 0.1,[64,65,66,67,68,69,70,71,72],true);
                this.addAnim('busting9', 0.1,[73,74,75,76,77,78,79,80,81,82],true);
          

                this.addAnim('busting10', 0.1,[1,2,3,4,5,7,8,9], true, this.animSheet2);
                this.addAnim('busting20', 0.1,[10,11,12,13,14,15,16,17,18], true,  this.animSheet2);
                this.addAnim('busting30', 0.1,[19,20,21,22,23,24,25,26,27], true, this.animSheet2);
                this.addAnim('busting40', 0.1,[28,29,30,31,32,33,34,35,36], true, this.animSheet2);
                this.addAnim('busting50', 0.1,[37,38,39,40,41,42,43,44,45], true, this.animSheet2);
                this.addAnim('busting60', 0.1,[46,47,48,49,50,51,52,53,54],true, this.animSheet2);
                this.addAnim('busting70', 0.1,[55,56,57,58,59,60,61,62,63],true, this.animSheet2);
                this.addAnim('busting80', 0.1,[64,65,66,67,68,69,70,71,72],true, this.animSheet2);
                this.addAnim('busting90', 0.1,[73,74,75,76,77,78,79,80,81,82],true, this.animSheet2);
              

              
                this.vel.x=0;
               this.vel.y=0;
       },

               changeAnimationSheet:function(number,obj){
                switch (number) {
                    case 1:
                        return obj.anims.busting1;
                        break;
                    case 2:
                        return obj.anims.busting2;
                        break;
                    case 3:
                        return obj.anims.busting3;
                        break;
                    case 4:
                        return obj.anims.busting4;
                        break;
                    case 5:
                        return obj.anims.busting5;
                        break;
                    case 6:
                        return obj.anims.busting6;
                        break;
                    case 7:
                        return obj.anims.busting7;
                        break;
                    case 8:
                        return obj.anims.busting8;
                        break;

                    case 9:
                        return obj.anims.busting9;
                        break;

                    case 10:case 11:  case 12:case 13:  case 14:case 15:  case 16:case 17:  case 18:case 19:
                        return obj.anims.busting10;
                    break;

                    case 20:  case 21:  case 22:case 23:  case 24:case 25:  case 26:case 27:  case 28:case 29:
                        return obj.anims.busting20;
                        break;

                    case 30:case 31:  case 32:case 33:  case 34:case 35:  case 36:case 37:  case 38:case 39:
                        return obj.anims.busting30;
                        break;

                    case 40:case 41:  case 42:case 43:  case 44:case 45:  case 46:case 47:  case 48:case 49:
                        return obj.anims.busting40;
                        break;

                    case 50:case 51:  case 52:case 53:  case 54:case 55:  case 56:case 57:  case 58:case 59:
                        return obj.anims.busting50;
                        break;

                    case 60:case 61:  case 62:case 63:  case 64:case 65:  case 66:case 67:  case 68:case 69:
                        return obj.anims.busting60;
                        break;

                    case 70:case 71:  case 72:case 73:  case 74:case 75:  case 76:case 77:  case 78:case 79:
                        return obj.anims.busting70;
                        break;

                    case 80:case 81:  case 82:case 83:  case 84:case 85:  case 86:case 87:  case 88:case 89:
                        return obj.anims.busting80;
                        break;

                    case 90:case 91:  case 92:case 93:  case 94:case 95:  case 96:case 97:  case 98:case 99:
                        return obj.anims.busting90;
                        break;

                       default:
                        return obj.anims.busting1;
                }
            },
            check:function (other) {
                return false;
            },
            update:function () {

                this.parent();
            }

        });
    });