Can´t use folders in storyboard.gotoScene

Hi there!

I am doing a game that has a lot of scenes (levels in my case).

To go to another scene, I use storyboard.gotoScene(“levelX”), but I would like to put my levels in a folder called “levels”.

I tried this: storyboard.gotoScene(“levels/levelX”), but dind´t work.

How can I use folders in gotoScene?

Goodbye!

In lua, you don’t use the OS’s / path divider (or \ for windows), you use a dot.  Try:

storyboard.gotoScene(“levels.levelX”)

Thanks, this work for me. But why in display.newImage(“images/ball.png”) can I use the “/”?

The dot rule is only for loading lua files.  For all other files, you use the slash.

Solvved. Thanks :wink:

mark it as solved :slight_smile: so that others can use it as reference.

Cheers :smiley:

In lua, you don’t use the OS’s / path divider (or \ for windows), you use a dot.  Try:

storyboard.gotoScene(“levels.levelX”)

Thanks, this work for me. But why in display.newImage(“images/ball.png”) can I use the “/”?

The dot rule is only for loading lua files.  For all other files, you use the slash.

Solvved. Thanks :wink:

mark it as solved :slight_smile: so that others can use it as reference.

Cheers :smiley: