Procedural next level crushing!

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
tetsuken
Prole
Posts: 13
Joined: Sat May 25, 2013 10:42 pm

Procedural next level crushing!

Post 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
tetsuken
Prole
Posts: 13
Joined: Sat May 25, 2013 10:42 pm

Re: Procedural next level crushing!

Post 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
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Procedural next level crushing!

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest