KyleRansford
Member
I'm making a mobile game where I'll be adding more levels in future updates and I've been trying to figure out how to make it where if the player completes all the levels in the game and there are no levels left, they go to a specific Room instead of the "room_goto_next()".
This code is not real, but this is what I have in mind:
if instance_number(obj) == 0 {
room_goto_next();
} else if room_goto_next() "doesn't exist" {
room_goto(r_end_of_levels_screen);
}
basically, if the player get's though a level and IF there is another level go to it. But, if there is no more levels, go to the room that shows a screen saying that they have reached the end of the levels and to check back for more levels being added in a future update.
I've also tried code like, if room_exists(room) or if room_exists(room_goto_next()).
I know how I could do this by specifying the next room in each room, but it would get tiring manually adding the room variables when eventually I reach over 100 levels.
This code is not real, but this is what I have in mind:
if instance_number(obj) == 0 {
room_goto_next();
} else if room_goto_next() "doesn't exist" {
room_goto(r_end_of_levels_screen);
}
basically, if the player get's though a level and IF there is another level go to it. But, if there is no more levels, go to the room that shows a screen saying that they have reached the end of the levels and to check back for more levels being added in a future update.
I've also tried code like, if room_exists(room) or if room_exists(room_goto_next()).
I know how I could do this by specifying the next room in each room, but it would get tiring manually adding the room variables when eventually I reach over 100 levels.
Last edited: