Skip to content

wilsonsilva/raylib-tic-tac-toe

Repository files navigation

Raylib Tic Tac Toe

A tic-tac-toe game powered by raylib, compiling for both desktop and web using emscripten.

Tic Tac Toe Screenshot

Motivation

Practice my C programming skills.

Prerequisites

  1. Install raylib
  2. Install CMake
  3. emsdk is required for web builds
  4. Install the just command runner (optional)

Compiling

Using just

  1. List Commands: To see a list of available commands:

    just help
  2. Build for Desktop: Debug:

    just build-debug

    Release:

    just build-release
  3. 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 :

  4. Clean: To remove the build and out directories:

    just clean

Manual Building

If you don't want to use just, you can also follow these manual steps:

Desktop Build

  1. Create a build directory:

    mkdir build && cd build
  2. Run CMake:

    cmake ..
  3. Build the project:

    cmake --build . --config [Debug/Release] --target raylib-tic-tac-toe -j 10

Web Build

  1. Activate emsdk:

    sudo emsdk activate latest
    source "/usr/lib/emsdk/emsdk_env.sh"
  2. Create the web build directory:

    mkdir build-web && cd build-web
  3. Ensure the resources folder is copied:

    rm -rf resources || true
    cp -R ../resources .
  4. 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
  5. Compile the project:

    emmake make

Contributing

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.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

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.