This small game engine, or if you look at it in more detail it's actually just a state machine, is the result of a thread in the SFML forum, where someone pointed to a tutorial on a state machine programmed in C++ and intended for the graphics Simple DirectMedia Library (SDL). I've taken the question as a challenge and transformed the source code to make use of the Simple and Fast Multimedia Library (SFML) instead. Meanwhile I've added quite a few changes to not only provide a more modern approach to C++ by using features from the new C++17 standard, as well as utilizing idioms likes RAII, but also to encapsulate classes a bit better.
This software is available under 2 licenses -- choose whichever you prefer.
For further details take a look at the LICENSE file.
- Public Domain
- MIT
A big thanks for the tutorial in the first place goes out to Anthony Lewis, make sure to checkout his development blog and his personal blog.
Thanks to kurayama for the suggestion on using a template based Build()
function rather than the Instance()
functions embedded in every state class.