Is it possible to make save files from a list veiw

I'm making a game where you take care of a duck, and I want to make it so that when you return to the menu, you can select one of your ducks and it will load that duck with the same stats as when you left it. The 3 variables I need to save are name, hunger, and anger.
Here is the code for the menu screen and play screen
Menu:


Play Screen:

You are reusing the same text value as a tag for each duck's attributes. They should be stored under their names as tags.

Either learn how to store a dictionary under each duck name with your two attributes, or keep multiple TinyDbs with different NameSpaces, one Namespace per attribute (hunger/anger/other stat...) and use the duck name as the tag in each TinyDb.

ok i will try that

How do I get the name after I pick it on the list view

If you loaded the ListView Elements from the list of duck names, then the Selection will be the chosen duck name.

I have made save files and a clear button that's supposed to get rid of all currently stored data, but for some reason, if you enter a duck name that was supposed to be cleared it keeps the same anger and hinger as before
Menu:


Play Screen:

duckGame.aia (843.2 KB)

Are you referring to


in Screen1 ?

When you terminate a duck, you also have to clear its tags in the subsidiary TinyDB NameSpaces. Otherwise they will still be there . (In SQL talk, there is no enforcement of relational integrity in TinyDB2 NameSpaces.)

By the way, I would assign default attributes for new ducks at their point of creation.
That would allow me to use the TagList of either subsidiary NameSpace as my list of duck names (assuming I do good cleanup when I remove a duck.)

You have many global variables that could be replaced with value function calls. It would reduce the chance for disputes over where the truth lies, between global variables and TinyDB values.

See the end of this chapter of the free online book, for value procedures and procedure parameters. It would reduce your block count and redundancy level.

http://www.appinventor.org/bookChapters/chapter21.pdf

Here is how to attain single version of the truth in your app, using procedures:
Screen1:


Menu:

duckGame (1).aia (843.2 KB)

(I have a weakness for ducks.)

P.S. I did not address screen opening and closing.