A tic-tac-toe game powered by raylib, compiling for both desktop and web using emscripten.
Practice my C programming skills.
- Install raylib
- Install CMake
- emsdk is required for web builds
- Install the
just
command runner (optional)
-
List Commands: To see a list of available commands:
just help
-
Build for Desktop: Debug:
just build-debug
Release:
just build-release
-
Build for Web: Before building for the web, ensure that the emsdk environment is correctly set up on your system.
just build-web
Alternatively, you can build a debug version for the web :
-
Clean: To remove the build and out directories:
just clean
If you don't want to use just
, you can also follow these manual steps:
-
Create a build directory:
mkdir build && cd build
-
Run CMake:
cmake ..
-
Build the project:
cmake --build . --config [Debug/Release] --target raylib-tic-tac-toe -j 10
-
Activate emsdk:
sudo emsdk activate latest source "/usr/lib/emsdk/emsdk_env.sh"
-
Create the web build directory:
mkdir build-web && cd build-web
-
Ensure the resources folder is copied:
rm -rf resources || true cp -R ../resources .
-
Run emscripten's CMake:
emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html" -DWEB_SHELL=minshell.html
-
Compile the project:
emmake make
Bug reports and pull requests are welcome on GitHub at https://github.com/wilsonsilva/raylib-tic-tac-toe. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the raylib-tic-tac-toe project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.