I have a question like this statement If I have a game with 3 screens in screen1 I make for the Play menu and load. when i click play it will point to screen 2 where in screen 2 there are levels 1-10 with the vertical system hidden and the choice when level1 is complete it will go to level 2 and so on. so my question is how when level 1, 2, 3 finish then the user wants to save his level and when the user plays again and presses the load button then he will go to level 4 or the last level he stores it, what kind of logic should I use?
beg for your help and enlightenment.
Elaborating on what @Deepanshu_Arya said, @Boy_Gembel you might want to store the current level in TinyDB. Pressing the load button should load the level number stored in the TinyDB tag. Simply increment the value after a level is complete.
can you give me an example of how to use tinyDb?
The following is a picture of my project, where do we consider level one with the following picture?
so when the user saves at level2 then when he clicks on level2 he wil
You use TinyDB simply by having the TinyDB component added. And each time you need to save something, you call the “store value” specifying a tag and the value to save.
When you need to access it, you use the “get value” specifying the same tag; this will return the value that was last stored.
You also need to specify a value for “value if tag not found”, so that your program can implement logic dealing with cases where this is the first time the user has ever played the game, and therefore does not have a score/level completed yet.
Just try it, you will see it is a lot simpler than you probably think.
I haven’t tested it myself with Kodular, but in Thunkable, making a list of component does not work in an initialization block. Over there, one need to initialize the block as an empty list, and then populate it through a logic block that actually executes (and .Initialize" is a perfectly valid choice to do this).
That said, the construction “set Vertical Arrangement.Visible of component [get global LevelArrangement]” appears faulty; global LevelArrangement is NOT a component, it is a LIST of component. Are you sure it will unroll without an explicit loop?
So you do need to unroll. What about the original setting of the list?
The fact is that you are doing it in emulator, which may have a preemptive loading of initialization that does not exist on actual Android devices.
Thank you for the response and assistance provided, for this problem has been resolved, and the logic that I use is, enter points at that level and use tinydb to save and I do it with only 1 vertical arrangement. apparently not as difficult as I imagined …
once again I thank you