This is a short audio/video intro to be used in GP'25 games.
To build this code alongside your game, copy the files GP25IntroMode.hpp and GP25IntroMode.cpp to your project and add them to your Maekfile.js.
The GP25IntroMode is a mode that makes itself non-current and runs a callback function either (a) when a key is pressed or (b) when the intro sequence finishes.
To use it with your game, replace the code that sets up your first mode with code that creates a GP25IntroMode with a callback function that sets up your first mode:
//in main.cpp:
#include "GP25IntroMode.hpp"
//...
int main(int argc, char **argv) {
//...
//old code:
//Mode::set_current( std::make_shared< YourFirstMode >() );
//replace with:
Mode::set_current( std::make_shared< GP25IntroMode >( [](){
Mode::set_current(std::make_shared< YourFirstMode >());
} );
//...
}
If you build this repository, the finished "game" has a few extra flags which might be useful for testing:
--mutemutes the sound of the intro--loop-introcauses the intro to run in an infinite loop--benchmarktimes the intro and then quits
This intro was built with NEST.
