New Game And Continue

Discussion in 'How Can I...?' started by yk1980s, Apr 25, 2020.

  1. yk1980s

    yk1980s Boxer

    Joined:
    Mar 11, 2020
    Messages:
    1
    Likes Received:
    0
    I have only one world, and scenes as levels.

    First question: why is that when i deploy my app to test on my mobile, if i run the game and complete a couple of levels, then exit the app, run it again, i am back to the last level i played. I think that this is an option i should be control my self, not a boxed automated - not sure if i can call it a feature - thing.

    Second question: lets say that i have to deal with it, then how to implement the concept of a New Game and Continue. While the default is always 'Continue', then you would struggle with the New Game option. I tried searching, and what i could find was to implement something like a Level-Selector. The idea worked, but at the cost of having a New-Game, Continue and a Restart button at the menu. Why? because if you apply the logic of the level selector before a world is loaded, then you wouldn't have any scenes loaded, and i kept getting an error that 'this.scene() is null'. I tried to simulate loading a world or to come up with any idea out of the box, but either struggled in finding a good API reference example, or nothing worked for me.

    What i tried?
    • This code usually code without the if statement that checks for the scene, but since there is no world loaded, the i get an error and my logic isn't executed. I read about sending and receiving events, but the issue is that i couldn't simulate calling a 2D-World and load it to start. There was no reference of such a thing.
    • Also, i tried emitting signals, but didn't know what to do with them
    upload_2020-4-25_11-8-57.png
     

Share This Page