Dragonfly Game Engine

Text Based Game Engine created using C++ and SFML

Dragonfly Header
  • Title: Dragonfly Game Engine
  • Duration: 4 Weeks
  • Roles: Engine Programmer
  • Version Control: Git

Overview: Dragonfly Engine is a text based Engine built using C++ and SFML. Created as part of my Technical Game Development course at WPI. It focused on creating an Game Engine following the design used to created the original Dragonfly Game Engine created by Mark Claypool.

Source Code

About Dragonfly Engine

Dragonfly Engine is a text-based Game Engine built using C++ and SFML. Dragonfly Engine was built as a process for understanding the workings and the pipeline of Game Engines. Using SFML Dragonfly is not only able to draw ASCII based graphics but also get User input, load and play music or sound. The Engine's Main functionality are managed by 6 Managers:

  • Game Manager:- Handle Game Loop (Start and Stop), Handle other Managers, Lock Frame Rate
  • Log Manager:- Write to Log File (Flush)
  • World Manager:- Handle updating game world, Insert and delete objects from world, Draw objects each frame looking for movement, check for collision.
  • Resource Manager:- Load and unload resources used by the game such as sprites, sound and music.
  • Display Manager:- Draw the ASCII character onto screen using SFML taking into account the viewport size and the respective world view within said viewport.
  • Input Manager:- Get Keyboard, Mouse inputs using SFML and throw respective events.

Other than this, Dragonfly can also handle collision using Box collision technique, throw events to be caught and handled by the appropriate objects, Animation of sprites, Objects.

Inner Workings of the Engine

  • Manager Class that is inherited by all Managers mentioned above.
  • Three types of collision (Solidness), HARD, SOFT and SPECTRAL. Each record collision but handle it differently, with HARD stopping the moving object, SOFT just recording and throwing collision event and SPECTRAL with no changes.
  • Object Class, they contain the object details, Position, Movement, Sprite, Solidness
  • Vector Class, Container that stores Position
  • ObjectLists, Containers that store lists of Objects and an iterator for it
  • Events, holds Different types of events like Keyboard,Collision,Mouse, Out of bounds.
  • ViewObjects, Child of Object class that can be used for HUD elements.