There had to be a way to manage cool screen transitions as easy as possible in C++ without too much difficulty.
There wasn't until now Swoosh, the mini library that immediately adds 100x polish to your game.
Fork the project at https://github.com/TheMaverickProgrammer/Swoosh.
LICENSED under zlib/libpng License
.
Swoosh is easy to integrate and makes your game look pro. Just checkout the super simple game example that ships with it. The library is header only and open source.
See the full video https://streamable.com/qb023.
The example project comes with 4 header-only custom segue effects you can copy and paste directly into your project and it'll just work. That simple. That powerful.
Using segues is as easy as calling push or pop and providing the intent. The intent is a specialized nested class designed to be human readable. Just see for yourself:
ActivityController controller;
controller.push<MainMenuScene>();
...
// User selects settings
using intent::segue;
controller.push<segue<SlideInLeft>::to<AppSettingsScene>>();
Popping is the same way.
controller.queuePop();
controller.queuePop<segue<SlideIn>>();
And if you're making a legend of zelda clone and the player teleports out of a series of deep dungeons back to overworld... there's a function for that too
bool found = controller.queueRewind<segue<SlideIn>::to<LOZOverworld>>();
if(!found) {
// Perhaps we're already in overworld. Certain teleport items cannot be used!
}
Take a peak at the full source code for the demo project:
https://github.com/TheMaverickProgrammer/Swoosh/tree/master/ExampleDemo/Swoosh
Swoosh comes with other useful utilities specifically but not limited to games.
- function bool doesCollide(a, b)
- function double angleTo(subject, target)
- function vector2 direction(target, dest)
And more...
See the rest here:
https://github.com/TheMaverickProgrammer/Swoosh/wiki/Namespaces