yvodlyn
Member
Hello everyone, I would like to simplify this code. What I want to do is change rooms randomly and the next room is not the same as the current room.
Here my code:
Here my code:
GML:
if (point_distance(o_player.x,o_player.y,o_portail.x,o_portail.y) < 8){
if (room == rm_player_1){
room_goto(choose(rm_player_2,rm_player_3,rm_player_4,rm_player_5,rm_player_6));
}
if (room == rm_player_2){
room_goto(choose(rm_player_1,rm_player_3,rm_player_4,rm_player_5,rm_player_6));
}
if (room == rm_player_3){
room_goto(choose(rm_player_1,rm_player_2,rm_player_4,rm_player_5,rm_player_6));
}
if (room == rm_player_4){
room_goto(choose(rm_player_1,rm_player_2,rm_player_3,rm_player_5,rm_player_6));
}
if (room == rm_player_5){
room_goto(choose(rm_player_1,rm_player_2,rm_player_3,rm_player_4,rm_player_6));
}
if (room == rm_player_6){
room_goto(choose(rm_player_1,rm_player_2,rm_player_3,rm_player_4,rm_player_5));
}
}