Skip to content

teppyboy/2048

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2048

This is 2048 built with SDL2 with optional features, written as an assignment for submitting to my university.

Preview

Preview 1 Preview 2

Installation

Go to releases and download the latest version available for your platform, if somehow a platform is not available then you can build from source using the tutorial below.

To launch the game on Windows run 2048.exe, for Linux (and possibly macOS) run start.sh

To move the tiles use the WASD key or toggle arrow key support in the game settings.

Building

To build this game, you must have Meson, Ninja, CMake, pkg-config, make, g++/clang++ along with required headers installed, both MSYS2 (MinGW) and MSVC are supported.

git clone https://github.com/teppyboy/2048
cd 2048
meson setup builddir  # Needed for installing SDL2 libraries to the project.

By default it'll build and copy files for MSYS2 environment, to build for MSVC append msvc to the build directory name (e.g. builddir-msvc)

  • Debug
meson install -C ./builddir
  • Release
# DO NOT USE --strip WHEN BUILDING WITH MSVC, IT DOESN'T WORK.
meson setup builddir-release --buildtype release --optimization 3 --strip
meson install -C ./builddir-release

The output will be in ./bin

Acknowledgements

BGM

SFX

Fonts

Images (all are blurred)

Libraries

  • SDL2 (without it this project wouldn't have existed)
  • nlohmann/json: For serialize and deserialize JSON settings.

Assistance

  • StackOverflow
  • Perplexity (with Claude 3.7 Sonnet)

License

MIT

About

The 2048 game implemented in SDL2 with optional features.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages