Skip to content

samuelgamito/2048-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

A 2048 C implementation

This is an implementation of the 2048 game, created with the purpose of learning algorithms in C

C, SDL2, 2048 game, Graphics Using C

License: GPL v3

Menu Screen

Recordit GIF


Table of Contents


Installation

Clone

  • Clone this repo to your local machine using

https://github.com/samuelgamito/2048-C.git

Setup

  • 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

Follow the SDL steps on.


Features

  • Homepage with options(Play, Scores, Load Game)
  • Save game options
  • List of Last scores saved
  • Use keyboard arroy to play
    • Supported Languages:
    • Portuguese

Usage

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

Using on Windows

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.

Using on Linux

An Linux version is comming soon

How to build?

$ gcc main.c `pkg-config --cflags --libs sdl2` -o main

Team

Samuel Gamito
github.com/samuelgamito

License

License: GPL v3

About

A 2048 game implemented with C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages