Skip to content

Instantly share code, notes, and snippets.

@mohsenheydari
Created January 8, 2019 01:28
Show Gist options
  • Save mohsenheydari/9c254cb843d58f9d12633c626ac810bb to your computer and use it in GitHub Desktop.
Save mohsenheydari/9c254cb843d58f9d12633c626ac810bb to your computer and use it in GitHub Desktop.
Draw X's in Tic Tac Toe Board
drawX(x, y){
this.ctx.lineWidth = this.xLineWidth;
this.ctx.strokeStyle = this.xStyle;
this.ctx.beginPath();
let offset = this.cellSize * 0.25;
this.ctx.moveTo(x + offset, y + offset);
this.ctx.lineTo(x + this.cellSize - offset, y + this.cellSize - offset);
this.ctx.moveTo(x + offset, y + this.cellSize - offset);
this.ctx.lineTo(x + this.cellSize - offset, y + offset);
this.ctx.stroke();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment