Making A Game: Tic-Tac-Toe
This is a set of workshop files for writing (parts of) a JS + <canvas>
Tic-Tac-Toe game.
The workshop is organized into multiple steps, each in their own branch:
- Step 1: drawing the grid lines
- Step 2: drawing the X's and O's
- Step 3: detecting and showing a win or a tie
- Step 4: adding a computer player
- Final: final solution branch
Go through the steps in order, and compare your code to the beginning of each next-step before moving on, to make sure you're getting everything in the right place.
Extra Credit
Things you can consider adding to this game to make it more fun to play:
- Add buttons/controls to select "2-player", "Easy Computer Mode", or "Hard Computer Mode"
- Add a "reset game" button so you can start a new game
- Add score tracking between X's and O's
License
The code and all the documentation are released under the MIT license.