Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » cutscenes

This thread is locked; no one can reply to it. rss feed Print
cutscenes
Vieira
Member #16,926
December 2018

Hello, I would like to know how to introduce videos to my curscenes within the Allegro. This is possible?
Say, choose specific locations of the game where the character arrives and start the cut ???

Neil Roy
Member #2,229
April 2002
avatar

Certainly. If you can play a video in Allegro, than you can show it anytime you wish.

How and when is up to you. Maybe when you create a level, you can add certain flags to it. If it was say, a tile map, certain tiles could make marked to show a video if the players moves over them. For example, lets say you have a 2D map with a bridge the player must cross, but if they cross a troll appears from under the bridge in a video you prepared. The map itself consists of 2D tiles, so you could mark one of those tiles as a trigger for the video clip. In your game you would have a tile struct which would have a flag which could indicate if that tile is a trigger, then another one which indicates the trigger type, like a video. Then another variable which contains which video to play, maybe a filename etc.

---
“I love you too.” - last words of Wanda Roy

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Adding all that information to your Tile struct is really unnecessary, unless it applies to EVERY tile.

All you need is a state machine, which can be as simple as a switch statement.

switch (state) {
   case NORMAL:
      DrawGame();
      break;
   case CUTSCENE1:
      DrawGame();
      ShowVideo(CUTSCENE1);
      if (Finished(CUTSCENE1)) {state = NORMAL;}
      break;
   case FINISH:
      break;
   default:
      break;
};

Go to: