Scenes/ Levels help needed

Hey,

I’m having a problem with scene creating. Basically, I’m using that scene-template.lua given in beginner space ship tutorial. Now, the problem is, I created Menu scene with a PLAY button that redirects you to the game.lua (level 1) and once you have finished level 1 it redirects you to another scene where you can choose to either go back to menu or go to next level and when you click on the next level it takes you to level2.lua and everything looks like it’s supposed to.

But, once you click on the game, it automatically says that you lost, even if you are supposed to win it says that you lost. And I haven’t even added the code that does it, to me it looks like it’s taking the code from level1.lua scene and it makes problems…

I hope you understand what I wanted to say,

Thanks!

Hi @mariomodern,

How does it indicate that you “lost” exactly? What happens on the screen? When you start level 2, are you resetting variables that Composer might be using to keep track of lives and other things?

Best regards,

Brent

For example, you have a button to click, if you click it correctly a new scene appears saying that you passed the level, if not then another scene appears saying that you failed the level. So lets say you passed level 1 and new screen has appeared saying that you have won, now you can either choose to go back to menu or go to the next level, level 2. Once you click to go to level 2, it’s the same principle - you have a button to click on, if you click it correctly you win and if not you lose. But, something got bugged and whatever you click, be it correctly or not it displays “YOU LOST”. Even if I don’t add that losing code to level2.lua it still displays “YOU LOST” no matter whether you click correctly or not.

As for variables, how can I do that? I’m using that scene-template.lua for all of my scenes, I just change background and speed but the rest stays the same.

Is there a way I can send you a private message here on the website and send you few files so you can check where is the problem. And, don’t worry about length I literally wrote few lines of code.

Hi @mariomodern,

Sorry for the delayed response. If you are still having issues with this, please just email me the files at: brent (at) coronalabs (dot) com.

Thanks!

Hi @mariomodern,

How does it indicate that you “lost” exactly? What happens on the screen? When you start level 2, are you resetting variables that Composer might be using to keep track of lives and other things?

Best regards,

Brent

For example, you have a button to click, if you click it correctly a new scene appears saying that you passed the level, if not then another scene appears saying that you failed the level. So lets say you passed level 1 and new screen has appeared saying that you have won, now you can either choose to go back to menu or go to the next level, level 2. Once you click to go to level 2, it’s the same principle - you have a button to click on, if you click it correctly you win and if not you lose. But, something got bugged and whatever you click, be it correctly or not it displays “YOU LOST”. Even if I don’t add that losing code to level2.lua it still displays “YOU LOST” no matter whether you click correctly or not.

As for variables, how can I do that? I’m using that scene-template.lua for all of my scenes, I just change background and speed but the rest stays the same.

Is there a way I can send you a private message here on the website and send you few files so you can check where is the problem. And, don’t worry about length I literally wrote few lines of code.

Hi @mariomodern,

Sorry for the delayed response. If you are still having issues with this, please just email me the files at: brent (at) coronalabs (dot) com.

Thanks!