code: function (key, value) {
              if (arguments.length === 1) {
                  //if just the key, return the value
                  if (typeof key === "string") {
                      return this[key];
                  }
  
                  //extend if object
                  this.extend(key);
                  this.trigger("Change", key); //trigger change event
                  return this;
              }
              //if key value pair
              this[key] = value;
  
              var change = {};
              change[key] = value;
              this.trigger("Change", change); //trigger change event
              return this;
          }
docs: @
  #.attr
  @comp Crafty Core
  @sign public this .attr(String property, * value)
  @param property - Property of the entity to modify
  @param value - Value to set the property to
  @sign public this .attr(Object map)
  @param map - Object where the key is the property to modify and the value as the property value
  @trigger Change - when properties change - {key: value}
  
  Use this method to set any property of the entity.
  
  @example
  ~~~
  this.attr({key: "value", prop: 5});
  this.key; //value
  this.prop; //5
  
  this.attr("key", "newvalue");
  this.key; //newvalue
  ~~~