Menu

#8 standalone rooms sometimes created

2.1
open
rogue clone (8)
5
2008-06-14
2006-07-24
Gary_W
No

In level.c, make_level( ), sometimes a room will be
created that does not connect to any other room. If
you get placed in here, you are finished!

My fix is to put the level creation code in a loop,
with a test to make sure all room are connected at the
end. If not, redo the level. There is probably a more
elegant fix, but it happens rare enough that this isn't
a big deal.

create the rooms
connect rooms
if (!ROOM.is_all_connected())
clear_level();
continue;
else
fill_out_level();

Gary

Discussion

  • Michael Lehotay

    Michael Lehotay - 2008-06-14
    • assigned_to: nobody --> mlehotay
     
  • Nobody/Anonymous

    Logged In: NO

    do a floodfill algorithm on all non-rocks to make sure that all of the non-rock squares are connected. Generally this will be easier since you have a 2d array of character values to search (instead of searching the data structures of the application )

    steve ued.

     

Log in to post a comment.

MongoDB Logo MongoDB