This is a tic tac toe game with a Mario theme! You can click here to play it! Have fun :)
- Define all initial variables (DOM Objects, counters)
- The game start with a pop-up
div
in the scree, where player can choose which character will be player 1. This is done with an If Statement that will check the input selected - Each player will have a turn. There is a function to check if the counter is odd content will be 'X', otherwise content will be 'O'
- You can win in 8 different ways: 3 columns, 3 rows, 2 diagonals. This function will add specific classes to each clicked box
- After a win, there is a function to unable players to keep clicking, and a message shows in the screen indicating the winner.
- Check if the game is draw when no one win in the 9th turn
- Keep the scores of both players with an individual counter
- To reset the board, there is a function that removes classes for the 9 boxes, this way the players can keep playing, and score will not be deleted
- Function to start a new game will set all the variables and classes to its inital values. After this, the option to choose a player shows in the screen again
- Responsive CSS to mobile
- Javascript
- HTML
- CSS
- Solving the problem with basic logic bedore trying to make it clean code!
- New CSS properties
- Adding sounds in JS