text: game.EnemyBaseEntity = me.Entity.extend({
      init: function(x, y, settings){
          this._super(me.Entity, 'init', [x, y, {
              image: "tower",
              width: 100,
              height: 100,
              spritewidth: "100",
              spriteheight: "100",
              getShape: function(){
                  return (new me.Rect(0, 0, 100, 70)).toPolygon();
              }
          }]);
          //sets so the state is not broken
          this.broken = false;
          //sets health to the health set in game.js
          this.health = game.data.enemyBaseHealth;
          this.alwaysUpdate = true;
          this.body.onCollision = this.onCollision.bind(this);
          //type is set
          this.type = "EnemyBaseEntity";
          //set the animation
          this.renderable.addAnimation("idle", [0]);
          this.renderable.addAnimation("broken", [1]);
          this.renderable.setCurrentAnimation("idle");
      },
      
      update:function(delta){
          if(this.health<=0){
              //sets the castle to be broken and sets the state to play
              this.broken = true;
              game.data.win = true;
              alert("YOU WON");
              me.state.change(me.state.MENU);
              this.renderable.setCurrentAnimation("broken");
          }
          //updates the castle to check if anything happens
          this.body.update(delta);
          
          this._super(me.Entity, "update", [delta]);
          return true;
      },
      
      onCollision: function(){
          
      },
      
      loseHealth: function(damage){
          //when the base loses health, it subracts the ammount of damage form it's health
          this.health =this.health - damage;
      }
      
  });