2022-11-25 16:41:48 +01:00
|
|
|
# lettergamecore
|
2018-10-28 15:06:27 +01:00
|
|
|
|
2019-02-07 19:11:42 +01:00
|
|
|
This project is a basic C [SDL2][SDL] game that uses [CMake][] as a build system.<br>
|
2018-11-20 17:51:16 +01:00
|
|
|
It shows how we can develop a basic grid-based game.
|
2018-10-28 15:06:27 +01:00
|
|
|
|
2019-02-05 22:31:46 +01:00
|
|
|
|
2019-02-07 19:11:42 +01:00
|
|
|
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.
|
2019-02-05 22:31:46 +01:00
|
|
|
|
2018-10-28 15:08:50 +01:00
|
|
|
## Dependencies
|
|
|
|
|
|
2018-10-28 18:46:41 +01:00
|
|
|
- [Git][]
|
2018-10-28 15:08:50 +01:00
|
|
|
- C Compiler (gcc, ...)
|
2018-10-28 18:46:41 +01:00
|
|
|
- [CMake][]
|
|
|
|
|
- [SDL2][SDL] library
|
2018-11-20 18:36:42 +01:00
|
|
|
- [SDL2_gfx][] library
|
2018-10-28 15:08:50 +01:00
|
|
|
|
|
|
|
|
**On Debian/Ubuntu based distributions, use the following command:**
|
|
|
|
|
|
|
|
|
|
```sh
|
2018-11-24 14:47:04 +01:00
|
|
|
sudo apt install git build-essential pkg-config cmake cmake-data libsdl2-dev libsdl2-gfx-dev
|
2018-10-28 15:08:50 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
**Optional packages:**
|
|
|
|
|
|
2018-10-28 18:46:41 +01:00
|
|
|
- [SDL2_image][] library
|
|
|
|
|
- [SDL2_ttf][] library
|
2019-02-04 00:06:04 +01:00
|
|
|
- [SDL2_net][] library
|
|
|
|
|
- [SDL2_mixer][] library
|
2018-10-28 15:08:50 +01:00
|
|
|
|
|
|
|
|
```sh
|
2019-02-07 19:11:42 +01:00
|
|
|
sudo apt install libsdl2-image-dev libsdl2-ttf-dev libsdl2-net-dev libsdl2-mixer-dev
|
2018-10-28 15:08:50 +01:00
|
|
|
```
|
|
|
|
|
|
2018-10-28 15:09:31 +01:00
|
|
|
## Build instructions
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
# Clone this repo
|
2022-11-25 16:41:48 +01:00
|
|
|
git clone https://gitlab.com/aminosbh/lettergame.git
|
|
|
|
|
cd lettergame
|
2018-10-28 15:09:31 +01:00
|
|
|
|
|
|
|
|
# Create a build folder
|
|
|
|
|
mkdir build
|
|
|
|
|
cd build
|
|
|
|
|
|
|
|
|
|
# Build
|
|
|
|
|
cmake ..
|
|
|
|
|
make
|
|
|
|
|
|
|
|
|
|
# Run
|
2022-11-25 16:41:48 +01:00
|
|
|
./lettergame
|
2018-10-28 15:09:31 +01:00
|
|
|
```
|
|
|
|
|
|
2019-02-07 19:11:42 +01:00
|
|
|
***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.
|
2018-10-28 15:09:31 +01:00
|
|
|
|
2018-10-28 18:50:35 +01:00
|
|
|
### Open the project with an IDE under Linux
|
|
|
|
|
|
2018-11-20 08:28:27 +01:00
|
|
|
See [IDE_USAGE.md](IDE_USAGE.md) for details.
|
2018-10-28 18:54:03 +01:00
|
|
|
|
2018-10-28 15:06:27 +01:00
|
|
|
## License
|
|
|
|
|
|
2018-11-08 21:36:47 +01:00
|
|
|
Author: Amine B. Hassouna [@aminosbh](https://gitlab.com/aminosbh)
|
|
|
|
|
|
2018-10-28 15:06:27 +01:00
|
|
|
This project is distributed under the terms of the MIT license
|
|
|
|
|
[<LICENSE>](LICENSE).
|
2018-10-27 21:31:08 +00:00
|
|
|
|
2018-10-28 18:46:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
[SDL]: https://www.libsdl.org
|
|
|
|
|
[CMake]: https://cmake.org
|
|
|
|
|
[Git]: https://git-scm.com
|
|
|
|
|
[SDL2_image]: https://www.libsdl.org/projects/SDL_image
|
|
|
|
|
[SDL2_ttf]: https://www.libsdl.org/projects/SDL_ttf
|
2019-02-04 00:06:04 +01:00
|
|
|
[SDL2_net]: https://www.libsdl.org/projects/SDL_net
|
|
|
|
|
[SDL2_mixer]: https://www.libsdl.org/projects/SDL_mixer
|
2018-10-28 18:46:41 +01:00
|
|
|
[SDL2_gfx]: http://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx
|