Created
January 8, 2019 01:28
-
-
Save mohsenheydari/9c254cb843d58f9d12633c626ac810bb to your computer and use it in GitHub Desktop.
Draw X's in Tic Tac Toe Board
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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