Or in a control object, define players = 4, and then each time a player dies, set that object's players -= 1; something like this:
obj_control's create event
any given player object's destroy event:
Code:
obj_control.players -= 1;
obj_controls end step event
Code:
if players = 1 then{
//game over stuff like going to the next room, show score, what have you
}
However, If you want to account for a different number of players depending on the game mode that was chosen (ie 2 player, 3 player, etc.), just make the button itself perform an action like this:
Mouse Pressed Event for obj_fourplayers
Mouse Pressed event for obj_threeplayers
And so on, and in the obj_control's create event, instead of setting players = 4, just do:
Code:
players = global.players;