Skip to content

Repository files navigation

2048-clone

VŠB-TUO — School project · Programming in C

C SDL2 License

A recreation of the classic 2048 sliding-tile puzzle game implemented in C using the SDL2 graphics library. Supports configurable board sizes and includes game-over and victory screens.

4×4 board     8×8 board

Requirements

  • GCC or compatible C compiler
  • SDL2, SDL2_image, SDL2_ttf

Setup

  1. Clone the repository:

    git clone https://github.com/Firestone82/2048-clone.git
    cd 2048-clone
  2. Install SDL2 libraries (Debian/Ubuntu):

    apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
  3. Build:

    gcc *.c -o main -Wall -ISDL2/include -LSDL2/lib -lSDL2 -lSDL2main -lSDL2_image -lSDL2_ttf

Usage

./main [columns] [rows]   # defaults to 4×4
./main 8 8                # 8×8 board

Controls:

Key Action
WASD / Arrow keys Move tiles
R Restart game
ESC Exit

License

This project was created as a school assignment at VŠB-TUO.

About

VŠB-TUO — School project: SDL2-based 2048 game clone in C

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages