Merge branch 'master-basic'

This commit is contained in:
Amine B. Hassouna
2019-02-07 19:11:42 +01:00
13 changed files with 1945 additions and 24 deletions

View File

@@ -1,8 +1,15 @@
# Basic C SDL game
# Basic C SDL2 game
This project is a basic C [SDL][] game that uses [CMake][] as a build system.<br>
This project is a basic C [SDL2][SDL] game that uses [CMake][] as a build system.<br>
It shows how we can develop a basic grid-based game.
It could be used as a base for any SDL2 grid-based game. Just fork it, clone it
and execute the `rename_project.sh` script. You will be prompted to enter the
new project name, the new executable name and the new git repository, but you
can keep the autodetected values. Finally, just commit and push the result to
your repository.
## Dependencies
- [Git][]
@@ -21,9 +28,11 @@ sudo apt install git build-essential pkg-config cmake cmake-data libsdl2-dev lib
- [SDL2_image][] library
- [SDL2_ttf][] library
- [SDL2_net][] library
- [SDL2_mixer][] library
```sh
sudo apt install libsdl2-image-dev libsdl2-ttf-dev
sudo apt install libsdl2-image-dev libsdl2-ttf-dev libsdl2-net-dev libsdl2-mixer-dev
```
## Build instructions
@@ -45,8 +54,9 @@ make
./basic-c-sdl-game
```
***Note:*** To use SDL2_image or SDL2_ttf, you should uncomment
some instructions in the CMakeLists.txt file and re-execute `cmake ..` and `make`
***Note:*** To use SDL2_image, SDL2_ttf, SDL2_net or SDL2_mixer, you should
uncomment some instructions in the CMakeLists.txt file and re-execute the
`make` command.
### Open the project with an IDE under Linux
@@ -66,4 +76,6 @@ This project is distributed under the terms of the MIT license
[Git]: https://git-scm.com
[SDL2_image]: https://www.libsdl.org/projects/SDL_image
[SDL2_ttf]: https://www.libsdl.org/projects/SDL_ttf
[SDL2_net]: https://www.libsdl.org/projects/SDL_net
[SDL2_mixer]: https://www.libsdl.org/projects/SDL_mixer
[SDL2_gfx]: http://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx