Topic: Loading the next level

Hi,
I am trying to make a start menu for my car game, I made a separate level for it. How could I load the next level in lua?
I see the function loadLevel on the wiki, is this what i'm looking for?

if isKeyPressed("B") then
    changeCurrentCamera(Camera2)
    loadLevel("Car Game.level")
    end

That code doesn't seem to do anything other then change the camera, could anyone tell me how I could change to the main level?

Re: Loading the next level

Hi, I think the problem is your level name,
you should avoid using space (also special characters, accents...)

try naming the level "Car_Game.level"

Re: Loading the next level

Also, don't forget the path is relative to the project so :
loadLevel("levels/Car_Game.level")

Re: Loading the next level

This worked, thanks!

Re: Loading the next level

I wrote an example to the wiki

Re: Loading the next level

How can I make so that when I load a level, they will store my values from the previous one?

Re: Loading the next level

you can save or manage your variables using a c++ plugin.

Re: Loading the next level

feels like I have to learn c++ right? I have begun learning C#, is it as easy or harder?

Re: Loading the next level

the syntax is not very different, you won't feel very lost.