Skip to content

Instantly share code, notes, and snippets.

@mohsenheydari
Created January 8, 2019 01:29
Show Gist options
  • Save mohsenheydari/6f1ec87b7463c3653650c564e8c1f57e to your computer and use it in GitHub Desktop.
Save mohsenheydari/6f1ec87b7463c3653650c564e8c1f57e to your computer and use it in GitHub Desktop.
Draw O's in Tic Tac Toe Board
drawO(x, y){
let halfCellSize = (0.5 * this.cellSize);
let centerX = x + halfCellSize;
let centerY = y + halfCellSize;
let radius = (this.cellSize * 0.7) / 2;
let endAngle = 2 * Math.PI;
this.ctx.lineWidth = this.oLineWidth;
this.ctx.strokeStyle = this.oStyle;
this.ctx.beginPath();
this.ctx.arc(centerX, centerY, radius, 0, endAngle);
this.ctx.stroke();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment