Help me ... Logic button

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.

thank you

You may store values in tiny db and call it to check if it’s empty or not everything a user click play, if it’s empty show level else proceed to level in the value

That sounds logic.

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.

3 Likes

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 wilADD

l automatically go to level 2

You should try something for yourself before asking for blocks.

1 Like

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.

1 Like


Try this

1 Like

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?

2 Likes

blocks (2)

Yes i just checked in emulator its work like this

1 Like

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.

1 Like

Download this Aia test.aia (3.3 KB)
Download this APK test.apk (4.8 MB)

there is 3 second timer to show that after screen intialize all 4 arr. are visible first after that it loops after 3 sec

You can’t judge me

Did you check that.

1 Like

You shouldn’t compare different builders to much. Thunkable Classic was left behind a long time ago and didn’t merge the “new” features from App Inventor like the one @ShaikhSajidAli demonstrated.

3 Likes

Hence the need to make a compendium of such differences.
In this case, it is a good thing, since if goes from more restrictive to less.
But are there any other things to be on the look out for?

1 Like

What is that supposed to mean?

No. It is 2:40 AM over here.

1 Like

I think that was a language/translation problem :sunglasses:

2 Likes

These are the release notes for Kodular Eagle

372/5000

Hi,

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 :smiley:

Happy Coding …

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.