• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Better Room Refresh

CloseRange

Member
So in my game I have 2 rooms so far: A Menu room and a Play room.

my game uses random generation to create unique rooms for the player making it so i only have to place on object in the room to make it playable.

The problem is that I have made it so that once you reach the end of the room you'll reach a ladder that you can click on and instead of going to a third room it will delete every object in the room (besides the inventory player and controller objects) and remake the room so it appears to be a new "floor" of the game.

I also use this same method when the player dies only instead of deleting everything i just use the function room_restart(); the problem is that when I do that it freezes for about 5-10 seconds then says im out of memory and crashes. I've also tried just going back to the menu but instead of saying no memory it just freezes forever. the only way It works well is if i do Game Restart but I don't want to have to resort to that because I later along the line i might have other rooms appear before the menu room that i don't want to reappear.

Any suggestions on a fix would be great thanks in advance :D
-CloseRange
 

NightFrost

Member
Yeah, sounds like a classic case of an infinite loop. You can home in on it by making your code spit out debug messages at suspect positions; if you can see it in the compile window, your code successfully reached that part; if not, something before the command is causing the hangup.
 
Top