Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: <SWOOSH> Header-only mini library for activities and segues  (Read 12341 times)

0 Members and 2 Guests are viewing this topic.

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
<SWOOSH> Header-only mini library for activities and segues
« on: October 28, 2018, 09:22:53 pm »
Updated 10/12/2020 to reflect latest 1.2.4 API

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 The 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.

See the full video https://streamable.com/qb023.



The example project comes with 20+ header-only custom segue effects you can copy and paste directly into your project and it'll just work.



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 types::segue;
controller.push<segue<SlideInLeft>::to<AppSettingsScene>>();
 

Popping is the same way.

controller.pop();
controller.pop<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.rewind<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:
Source Code



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)
  • function void setOrigin(sprite, fx, fy)

See the rest here:
https://github.com/TheMaverickProgrammer/Swoosh/wiki/Namespaces



May this be as useful to you as it is meant to be!
« Last Edit: January 02, 2021, 07:47:28 pm by foo »

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: <SWOOSH> Header-only mini library for activities and segues
« Reply #1 on: November 11, 2018, 08:56:08 am »
Update includes more segues you can use directly into your apps with a single include statement.

Activities can support their own views.

namespace swoosh:: now has ActionList and action item types to add even more control and polish to your apps.

Read more here

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
Update v1.2
« Reply #2 on: March 17, 2019, 11:31:54 pm »
v1.2 is released

Includes new segues (over 25 segue effects), custom sf::View support per each activity, custom background color for each activity, and lots of other tweaks.

Most importantly, this update has separated the shader effects used in segues into their own header: Shaders.h

Now you can use the following shaders in your SFML projects and apply them directly to sprites. No need to write your own GLSL code!

1. FastGausianBlur --> blur effect you can raise intensity + grain depth
2. Checkerboard    --> remove parts of sprite block by block. Increase kernel size for a dissolve effect.
3. CircleMask          --> Cut off everything outside of the circle you can define the amount
4. RetroBlit             --> Remove colors layer by layer for a retro effect
5. CrossZoom         --> Makes your sprite glow and pop out of the screen
6. Morph                 --> Morph your sprite from one to the other
7. PageTurn            --> Make your sprite turn fold like it's turning a page
8. Pixelate              --> pixelate your sprite
9. RadialCCW         --> cut off sprite with a radial effect. useful for visuals like health.

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: <SWOOSH> Header-only mini library for activities and segues
« Reply #3 on: July 29, 2020, 08:27:16 pm »
I am making a web series on youtube using SFML + Swoosh lib to make a game from scratch! Please help vote here for the game genre YOU would like to see recreated.  ;)

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: <SWOOSH> Header-only mini library for activities and segues
« Reply #4 on: August 19, 2020, 01:26:10 am »
The poll was close at a neck-and-neck tie with RPG and RTS Action game and RPG finally won! See the final poll: here

I will be making a youtube mini series on writing a polished and flashy RPG game with SFML + Swoosh. I'll post whenever the video series is ready.

In the meantime, follow SwooshLib on twitter here for sooner updates and early sneak peaks!

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: <SWOOSH> Header-only mini library for activities and segues
« Reply #5 on: October 11, 2020, 06:33:55 am »
Major updates in v1.2.4 just released today
Some API changes are made to support better mobile and low-end GPU hardware support. See the readme.

Added new "Dream" transition effect to the supplied src/segue/ folder in the project. Add it to your project by adding
#include <Swoosh/Segues/Dream.h>
.

Plug-n-play baby!  ;D

https://streamable.com/cw5pev

PWGuy

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: <SWOOSH> Header-only mini library for activities and segues
« Reply #6 on: December 25, 2020, 12:06:51 am »
I have been working on a NES Zelda 1 re-make for awhile now (lots of breaks since we had another child!).  And this is probably perfect for me!  Not sure when I’ll get to the point of using it since I focused on intro / player name entry first but I’ll try to implement in my proof of concept soon!

foo

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: <SWOOSH> Header-only mini library for activities and segues
« Reply #7 on: January 02, 2021, 07:45:56 pm »
I have been working on a NES Zelda 1 re-make for awhile now (lots of breaks since we had another child!).  And this is probably perfect for me!  Not sure when I’ll get to the point of using it since I focused on intro / player name entry first but I’ll try to implement in my proof of concept soon!

Congrats with the newborn! Yes, swoosh is capable of doing the camera panning effect (if each area is its own level/scene).

I've been meaning to put together a Zelda clone/example for swoosh for a while now to demonstrate some of the "best practices" when using the library- but 2020 was crazy!

Best wishes

 

anything