I’m developing a game where the player can collide with objects, a thing that leads to “Game Over”. Now, when the player collides with something, I want the screen to flicker for a split second, indicating the game is over, just like in Flappy Bird.
I’ve tried something like this:
public static void gameOverEffect(Group actorGroup) {
SequenceAction action = Actions.sequence(Actions.alpha(0), Actions.fadeOut(0.4f, Interpolation.fade));
actorGroup.addAction(action);
}
I have an HUDManager class that takes care of all the heads-up effects in the game(particles, flying text, etc) so for the argument Group in the above method, I provide an object of HUDManager class.
But when it is executed, it acts strangely - After a few seconds, the screen becomes total black.
Does someone has any idea how to implement this effect?