Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

However, we can probably create a little API that will help us achieve our goals in a fairly clean manner. Using it would look something like this...

Code Block
themeRDark
languagejavascript
linenumberstrue
include("path/to/APIs/Sequence.js");
 
// define a sequence, probably store in in an external .js file and include() it
Sequencer.define("introSequence", outputHandler, [
	"Sgt.Gibbs: Next objective is to the north. Then we'll cut eastward and rendevous with Team Two.", 50,
	"Sgt.Wilkes: -- Wilkes to Gibbs. You folks have got a horde of angry Scavengers headed your way from the north. --", 50,
	"Sgt.Gibbs: Thanks for the heads up, Sergeant. We'll be ready!"
]);
 
// start a sequence, eg. during an event
function eventGameInit() {
	// various init
	Sequencer(introSequence);
	// various other stuff
}

...