function Piece(options) {
  this.options = options || {};
  this.width = this.options.width ? this.options.width : 10;
  this.x = this.options.x ? this.options.x : 0;
  this.y = this.options.y ? this.options.y : 0;
  this.color = this.options.color || '#FFF';
  this.border = this.options.border || '#000';
}
/**
 * Piece Class
 * Creating a simple 2d object
 * with an inner color and a border
 */
Piece Class
Creating a simple 2d object
with an inner color and a border
Piece Class Creating a simple 2d object with an inner color and a border
function Piece(options) {
  this.options = options || {};
  this.width = this.options.width ? this.options.width : 10;
  this.x = this.options.x ? this.options.x : 0;
  this.y = this.options.y ? this.options.y : 0;
  this.color = this.options.color || '#FFF';
  this.border = this.options.border || '#000';
}
function Piece ( options ) { this . options = options || { } ; this . width = this . options . width ? this . options . width : 10 ; this . x = this . options . x ? this . options . x : 0 ; this . y = this . options . y ? this . options . y : 0 ; this . color = this . options . color || '#FFF' ; this . border = this . options . border || '#000' ; }
Piece Class
 Creating a simple 2d object
 with an inner color and a border
Piece Class Creating a simple 2d object with an inner color and a border