Skip to content

kolyaka32/tic-tak-toe-on-SDL-net

Repository files navigation

The standard "Tic-tac-toe" game on c++ using SDL3

en ru

This codebase implement standart tic-tac-toe game with cooperative and online mods.

Screenshot of game

Usage

Classical game "tic-tac-toe", ported on computer. Rules are simple you need to set crosses or circles at field. You goal - have pre-set number of your shape in one line/column/diagonal. As server or first player you can choose, how place first. Game have 3 mode:

  • Singleplayer (only for field with width 3);
  • Local two-person mode (for two people at one machine, walking in turns);
  • Internet two person mode (for two people at two different machines, by LAN, UDP);

Also you can change start field configuration and other usefull things from "settings-tic-tac-toe.ini" file.

Supported languages

  • English
  • Russian (Русский)
  • German (Deutsch) (WIP)
  • Bellarussian (Беларускі) (WIP)

Screenshot of extended game

Launching of the game

Download archieve from releases, depend on platform, unzip and run 'Tic-tak-toe.exe'/'Tic-tak-toe'!

Building by yourself (windows)

  1. Install C++ compiler (such as MSYS2);
  2. Install Make;
  3. Install CMake;
  4. Download and extract external SDL libraries: 4.1. SDL3; 4.2. SDL3-image; 4.3. SDL3-mixer; 4.4. SDL3-ttf; 4.5. SDL3-net;
  5. Extra library - libzip (build by your own), required: 5.1. zlib; 5.2. bzip (came with GNU); 5.3. libzip itself, build (required launch command line as a administator):
git clone https://github.com/nih-at/libzip.git
cd ./libzip; mkdir build; cd build;
cmake ../; make .; make install
  1. (Optional) Code editor Visual Studio Code (for better usage) (Recomended to use with plugins on c++ and cmake). 6.1. (Recomended) Install extensions: C/C++ Extension pack, CMake Language Supports, CMake Tools.
  2. Compile project itself 7.1. Without visual studio code:
cd ./Shaft-production-planner
mkdir build
cmake --build ./build --config Release --target all --

7.2. With visual studio code: Open folder with project, select complier kit, select build configuration, and build.

Prepaired sources for windows

Sources with all builded libraries can be located at releases (Development-kit-windows).

Building by yourself (unux systems)

  1. Check updates
  2. Check availability of compiler, make and cmake;
  3. Check availability of git;
  4. Install all necesery external libraries: 4.1 Necesary external libraries: libasound2-dev wavpack libxmp libfreetype-dev; 4.2. External SDL libraries (SDL3, SDL3-image, SDL3-mixer, SDL3-ttf, SDL3-net); 4.3. External archieve library (build by you own), required: libzip;
  5. (Optional) Code editor Visual Studio Code (for easier usage). 5.1. (Recomended) Install extensions: C/C++ Extension pack, CMake Language Supports, CMake Tools.
  6. Compile project itself

Installing on Debian-like systems

sudo apt-get update
# Installing c++ compiling system
sudo apt-get install -y g++ git make cmake
# Installing libraries for SDL_mixer
sudo apt-get install -y libasound2-dev wavpack libxmp
# Installing libraries for SDL_ttf
sudo apt-get install -y libfreetype-dev
# Installing libraries for libzip
sudo apt-get install -y libzip-dev

# Building external libraries
# SDL
git clone https://github.com/libsdl-org/SDL.git
cd SDL; mkdir build; cd build
cmake ..
make; sudo make install
cd ../../
# SDL_image
git clone https://github.com/libsdl-org/SDL_image.git
cd SDL_image; mkdir build; cd build
cmake ..
make; sudo make install
cd ../../
# SDL_mixer
git clone https://github.com/libsdl-org/SDL_mixer.git
cd SDL_mixer; mkdir build; cd build
cmake ..
make; sudo make install
cd ../../
# SDL_ttf
git clone https://github.com/libsdl-org/SDL_ttf.git
cd SDL_ttf; mkdir build; cd build
cmake ..
make; sudo make install
cd ../../
# SDL_net
git clone https://github.com/libsdl-org/SDL_net.git
cd SDL_net; mkdir build; cd build
cmake ..
make; sudo make install
cd ../../
# libzip
git clone https://github.com/nih-at/libzip.git
cd libzip; mkdir build; cd build
cmake ..
make; sudo make install
cd ../../

# Building app itself
git clone https://github.com/kolyaka32/tic-tak-toe-on-SDL-net.git
cd tic-tak-toe-on-SDL-net; mkdir build
cmake --build ./build --config Release --target all

Prepaired sources for unix

Sources with all builded libraries can be located at releases (Development-kit-unix).

Used external libraries: