This is an implementation of the 2048 game, created with the purpose of learning algorithms in C
C, SDL2, 2048 game, Graphics Using C
- Clone this repo to your local machine using
https://github.com/samuelgamito/2048-C.git
- Install SDL2 on Linux
If you have some Advanced Packaging Tool available (ie Ubuntu and Debian) use the follow commands
#install sdl2
$ sudo apt install libsdl2-dev libsdl2-2.0-0 -y;
#install sdl image
$ sudo apt install libjpeg9-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;
#install sdl mixer
$ sudo apt install libmikmod-dev libfishsound1-dev libsmpeg-dev liboggz2-dev libflac-dev libfluidsynth-dev libsdl2-mixer-dev libsdl2-mixer-2.0-0 -y;
#install sdl true type fonts
$ sudo apt install libfreetype6-dev libsdl2-ttf-dev libsdl2-ttf-2.0-0 -y;
If somehow you don't have a package manager, you can install from the source the classic Unix way.
Download the source code from SDL Website
# Using Curl
$ curl https://www.libsdl.org/release/SDL2-2.0.12.tar.gz --output SDL.tar.gz
Now extract the SDL, configure and make to install
$ mkdir sdl
$ tar -zxf SDL.tar.gz -C ./sdl
$ rm SDL.tar.gz
$ cd sdl
$ ./configure
$ make all
$ make install
- Install SDL2 on Windows
- Homepage with options(Play, Scores, Load Game)
- Save game options
- List of Last scores saved
- Use keyboard arroy to play
- Portuguese
-
Supported Languages:
The first implementation was using Code Blocks and Windows, and was a first contact with C and SDL. The Linux implementation is something like a remastering, then the project it's more organized and easy to run or build
The project was created using Code Block, so the best way is open the windows project as Code Blocks project and run or build using this him.
An Linux version is comming soon
How to build?
$ gcc main.c `pkg-config --cflags --libs sdl2` -o main
Samuel Gamito |
---|
github.com/samuelgamito |