GameDev Framework (GDF) is a C++ / SFML modular framework for 2D game development.
It provides a small kernel to be used as a core-engine for any kind of application, due to its high flexibility achieved using GameObject/Component architecture, it can integrate any type of user-modules ( Components ), without changing the kernel code at all.
In any case the GameLogic does not fit to your application-logic, it can be overridden (See. GameInfo class ) in order to implement your own game-logic. i.e: Your own way of Intializing, Updating and Drawing stuffs. However, the architecture is preserved.
The framework does provide some (dedicated/specific) built-in modules to be directly used. ( a Module is a set of several Components ), such as:
- Rendering : SpriteRenderer, TextRenderer, ShapeRenderer ...
- Animation: State machine based Animation system, Multi-layered Animator. c.f Unity3d's Animator
- Audio: Audio, Music, AudioListener, Filters ...
- Resource management
- Cameras
- Time management
- Physics: Rigidbodies, colliders, joints ...
- etc .
User-created components must inherit from Component class in order to be fully functioning. In consequence, depending on the type of the created component, we made the Component class in a way that allows it to be most versatile possible.
The framework is built cross platform c++, extending the following labraires
- C++14
- SFML 2.3.2
Box2D 2.3.1- Qt 5.7.0 with GCC4.9
- Tested under Linux-Ubuntu 64bit GCC 5.4 In order to generate the .so file, run the makefile by
> make
Here is a brief diagram showing your location within the framework.
To get started, you must create you own game-logic and scenes, you can override both GameInfo & Scene class and redefine all pure methods.
- Note that each new (different) Scene you create, it must be done in a new class.
Just after that, you can start building you first component by overriding the Component class.
- c.f See example in kernel branch repo.
Creating new GameObject
gdf::kernel::GameObject* go = gdf::kernel::GameObject::instantiate<0>("g0");
// instantiate<0> is static and must specify the scene target: 0 is a reference to a scene.
Adding a Component to a GameObject
Rigidbody2D* rb2d = go->addComponent<Rigidbody2D>()
// rb2d->set ...
go->addComponent<Chrono>()
Destroying an Object
gdf::kernel::GameObject::destroy( go );
// Automatically destroy all component within it
The framework is designed to be fully open-source and community repo,
You are welcome to:
- Suggest Code improvements ( as i'm writing very basic things right now to get a global architecture, then i'll refine every class )
- Suggest modifications about the kernel or an existing module.
- Suggest your own modules. even if there is an already existing one, There is no better code. but one can fit better than the other, depending on the problem+
- Platform portability, ( as it is currently tested only under Ubuntu 16.04. ) But since Qt & SFML & Box2D are multi-platform, there should not be a problem.(not tested on other platforms )
Currently there is no available website or forum.
You can follow a topic on sfml forum which explain more things about the framework. GDF-Topic in SFML Forum