window.Hex = function(x, y) {
  this.x = x;
  this.y = y;
  this.wall = false;
  this.crash_site = false;
  this.player = null;
}

Hex.prototype.draw = function(stage, radius) {
  var thickness = 1;
  if (_.isUndefined(this.hex)) {
    this.hex = new createjs.Shape();
  }
  var color = 'white';
  if (this.wall) {
    color = this.player.wall_color;
  }
  if (this.crash_site) {
    color = "orange";
  }
  this.hex.graphics
      .clear()
      .setStrokeStyle(thickness)
      .beginStroke("#000")
      .beginFill(color)
      .drawPolyStar(0, 0, radius, 6, 0, 0);

  var padding = 2;
  var h_rad = 0.5*radius;
  var hex_halfheight = Math.sqrt(radius*radius - h_rad*h_rad);
  this.hex.x = padding + radius + (this.x * radius * 1.5);
  this.hex.y = padding + hex_halfheight + (2*hex_halfheight * this.y) + (this.x % 2 == 0 ? hex_halfheight : 0);
  stage.addChild(this.hex);

  if (this.player && !this.wall && !this.crash_site) {
    this.player.circle.x = this.hex.x;    
    this.player.circle.y = this.hex.y;    
    this.player.circle.graphics.beginFill(this.player.color)
                   .drawCircle(0, 0, hex_halfheight / 2);
    stage.addChild(this.player.circle);
  }
}

Hex.prototype.setPlayer = function(p) {
  this.player = p;
}

Hex.prototype.setWall = function() {
  this.wall = true;
}


@@ -120,24 +120,116 @@
  = null;%0A%7D%0A%0A
+Hex.prototype.to_string = function() %7B%0A  return String(this.x) + %22, %22 + String(this.y);%0A%7D;%0A%0A
 Hex.prototyp
@@ -354,16 +354,218 @@
 hape();%0A
+    this.hex.addEventListener(%22click%22, _.throttle(function(evt) %7B%0A      console.log(this.x, this.y);%0A    %7D.bind(this), 1000));%0A    this.text = new createjs.Text(this.to_string(), %228px Arial%22, %22black%22);%0A
   %7D%0A  va
@@ -1469,16 +1469,163 @@
 e);%0A  %7D%0A
+  this.text.x = this.hex.x - (0.5 * radius);%0A  this.text.y = this.hex.y - (radius * .4);%0A  this.textAlign = %22center%22;%0A  stage.addChild(this.text);%0A
 %7D%0A%0AHex.p

Add coords to grid