This is a free and open-source game based on the source code provided by the book SFML Game Development By Example (ISBN 9781785287343).
This repository is a fork from sschellhoff who provided the original book's source code in a runnable version.
Here is a video demo
demo.webm
Install SFML from your package manager. Also, make sure you have cmake
and g++
.
For Debian based distros:
$ sudo apt install libsfml-dev cmake build-essential
For Arch-based distros:
$ pacman -Syu cmake sfml base-devel
Build from source
$ git clone https://github.com/mataktelis11/Simple-SFML-2D-Game.git
$ cd Simple-SFML-2D-Game
$ mkdir build && cd build
$ cmake ..
$ cmake --build .
This will generate an executable file called ScrollOfTheUndead in the current dir.
Make sure that CMake, git, SFML and mingw are in your path. If this is your first time compiling an SFML project on Windows you can check out this helpful guide.
Open cmd or gitbash and type the following commands to build from source
$ git clone https://github.com/mataktelis11/Simple-SFML-2D-Game.git
$ cd Simple-SFML-2D-Game
$ mkdir build
$ cd build
$ cmake -G "MinGW Makefiles" ..
$ mingw32-make
An .exe file should now exist in the build
folder called ScrollOfTheUndead.exe.
This is game is an improvement of the book's Chapter 7. More specifically the following additions have been made:
- Added a healthbar for the player.
- Added a new spritesheet for the player.
- Added music and sounds (not with the book's sound manager but with a much less sophisticated implementation)
Added a new tileset (16 * 16)Added an new Tile Set (32x32).- Added a Python script that generates .map files from .csv files made with Tiled (This makes it easier to create a map)
- Added CMakeLists.txt a based on this amazing guide.
- Minor other changes...
This project started because I wanted to create a video game from scratch. Thankfully the book does a good job providing and explaining a template that can be a good start as my very first game. I strongly recommend you check out this book if you want to see what game development really is.
I chose Chapter 7 as I feel it is a good middle ground for everyone how have read the book. Do not expect this to be the most amazing game ever.
Before checking out the source code I strongly recommend to read the book first (especially if you are relatively new to C++ like me). There is also documentation (in Greek) provided in the docs folder.
- Textures:
- Necromancer sprites: https://creativekind.itch.io/necromancer-free - Author: CreativeKind
- Enemy sprites: https://luizmelo.itch.io/monsters-creatures-fantasy - Author: LuizMelo
- Tileset 16x16 (not used currently): https://poloviiinkin.itch.io/textures - Author: Poloviiinkin
- Tileset 32x32 (this is the one used by the game): https://opengameart.org/content/dungeon-crawl-32x32-tiles - Author: Chris Hamons
- Heart sprites: https://nicolemariet.itch.io/pixel-heart-animation-32x32-16x16-freebie - Author: NicoleMarieT
- HUD Sprite: https://dandann1.itch.io/hud-buttons - - Author: DanDann1
- Music:
- Sound effects:
- from https://pixabay.com
- Knife slice - Author: NeoSpica
- Bone Crack - Author: Universfield
- attack cannibal beast - Author: jvmyka@gmail.com
- transition explosion - Author: Cristian Changing
- shield guard - Author: nekoninja
- Interface - Author: Universfield
- Failfare - Author: Wagna
- coin 2 - Author: soundnimja
- from https://opengameart.org
- Sound effects Pack 2 - Author: phoenix1291
- Level up sound effects - Author: bart
- from https://pixabay.com
- Backgrounds:
- https://ansimuz.itch.io/mountain-dusk-parallax-background - Author: ansimuz
- Fonts:
- All fonts in the game's Resources are from https://www.dafont.com/
- Logo made with placeit.net
Huge shout out to all those amazing creators!
I do NOT own the mentioned book, and this project is not made to be sold in any way.
GPL-3.0 license - Check the LICENSE.md file.