Exit appears after all enemies beaten

I have a game in my head but would like to know if it possible before I attempt to start building the game.
The concept is there are 4 enemies per level and you play as a young witch who shoots stars at the enemies who turn into gems but only remain in gem for for a few seconds the witch can pick up the gems which add to score and also remove the enemy.
But the thing is what variable do you use to tell the game that if last enemy is beaten to reveal the exit for the next level.

thank you for any help

So all the gems have to be collected before the next level should become available?

At the stat of the level/scene set a scene variable GemsRemaining to the number of enemies (this way you won’t have to change the events if you add or take away enemies from a level).

As a gem is collected, subtract 1 from the GemsRemaining variable. When GemsRemaining = 0, show the exit.