Page 1 of 1

Procedural next level crushing!

Posted: Fri Aug 22, 2014 2:19 am
by tetsuken
Hello again!

Guys im ina problem with my next level, its crushing the game ... i tryed some stuff but the problem persists and since im not professional i decided o ask for help.

the problem is basic here:

Code: Select all

function love.update(dt)

	if nextlevel == true then
		createroom()
		nextlevel = false
	end
end
the game starts normal and create the room since nextlevel starts as true.

but when i reach the stair, that should make nextlevel = true then game crushes

Ty for any help

Re: Procedural next level crushing!

Posted: Fri Aug 22, 2014 5:08 am
by tetsuken
Ok guys i discovered what was wrong, i was not cleaning the matrix of the level before try create new rooms, and since the function check for collision before place de rooms that was no ending and crushing the game.

Now its ok, im able to change level since i go over the stair.
The next steps are :
1 - create a way to avoid a very rare case where the stair room dont conec to the proprer room making part of the dungeon unreachable.
2 - create pathfinder
3 - create enemies

I'm almost sure i can solve the step 1 with step 2, doing something like a check if is reachable from initial point to stair point and if not, load again the level, and this can handle the problem.

Ty for the help

Re: Procedural next level crushing!

Posted: Fri Aug 22, 2014 6:53 am
by Plu
A heads up for the next time you have a question; you have to post your actual .love file in the topic if you want us to help. There's nothing we could've done with just that little piece you posted.