For example, when I reach the end of the level: The player character shall not be able to move, then the boss walks into the scene, then they have a little talk that you can advance with the A button and then the regular gameplay resumes.
Furthermore, when the boss is defeated, another short dialog appears. Then the player character walks off the screen automatically.
Is there any specific way to implement this in an easy way or is it a tedious bunch of manual if-checks that are processed every frame?
Code: Select all
if (status == NormalGameplay)
RegularStuff();
else if (status == beforeBoss)
{
if (boss.X > 200)
MovementBoss(Left);
else
{
if (currentDialog == NoDialog)
LoadNextDialog();
else if (ButtonPressed(ButtonA))
{
if (dialog == LastBossDialog)
status = normalGameplay;
else
LoadNextDialog();
}
}
}
else if (status == afterBoss)
{
/* More stuff about dialogs and automatic movements. */
}