Skip to content

GameDev Framework (GDF) is a C++ / SFML modular framework for 2D game development.

Notifications You must be signed in to change notification settings

theVoidZ/GameDev-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GameDev-Framework

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.

Built-in modules

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 .

Everything is a Component

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.

Building & Compiling

The framework is built cross platform c++, extending the following labraires

Requirements

  • C++14
  • SFML 2.3.2
  • Box2D 2.3.1
  • Qt 5.7.0 with GCC4.9

Compiling

  • Tested under Linux-Ubuntu 64bit GCC 5.4 In order to generate the .so file, run the makefile by
> make

Getting started

Here is a brief diagram showing your location within the framework. architecture

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.

Code samples

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

Video Example ( Time Reversal )

IMAGE ALT TEXT HERE

Contribution

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 )

Links

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

About

GameDev Framework (GDF) is a C++ / SFML modular framework for 2D game development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages