TicTacToe-Online
A downloadable game for Windows
Context
This project was made during our course of Windows Online Programming and Multi-Threading. The goal was to develop a basic Tic Tac Toe game with a simple GUI and a server capable of handling multiple games simultaneously.
- Basic TicTacToe game using the SFML and C++
- State machine to easily create multiple views (i.e : Home, Login, History, Lobby, Game)
- Two different game modes:
- CLASSIC: The original TicTacToe experience.
- FAST: Each player has a limited time to make a move!
- Server sending and receiving messages from multiple clients
send
andreceive
procedure via Windows window events:- Custom window messages
- Send and Read data as JSON using Niels Lohmann's library
- Lobby management to handle multiple games
- Multi-threading paradigms and functionalities
- Main client loop on the main thread
- Communications with the server are on a secondary thread
- Web server accessible via any browser to observer all ongoing games
Follow these steps to play the game:
- Download the project.
- Run the local server by executing the
Server.exe
file. The server is needed to play as it will host your games. - Run the client by executing the
Client.exe
file. - Enjoy!
NOTE: You can run multiple clients on the same computer. WARNING: You need to be on the same network to connect to the server.
How to play
Connection
When you start Client.exe
, you will need to connect to the server with a PassPhrase.
The PassPhrase can be found in the Server console and look like this: => Game Server Phrase: PASSPHRASE
Lobby
Once connected, you can enter in a CLASSIC or FAST lobby.
We recommend the FAST mode, it's more fun!
Game
The game will automatically start when there are 2 players in the lobby.
When the game is over, the server will automatically reset the board. If any player leaves, the board will be reset, and lobby will return to a waiting state.
History
Once connected, you can view all the games played in the server.
The games history is lost when the server shuts down.
How to access the web server
Make sure the server is running 😉
When you start Server.exe
, a web server is also started.
The URL of the web server is printed in the console like this: => Web Server Address: YOUR_IP
You can Ctrl + Click
it to open the link in your browser, instead of copying.
NOTE: You cannot play the game on your browser, it is only used to observe the ongoing games.
Leave a comment
Log in with itch.io to leave a comment.