i just change the playername to the same screen , also this time I going to let them type name only if their score is on the 5 top score list. Can I ask where & how can I put the if then statement to check whether the score is on top 5 or not, if yes, then will open the "playerName" screen to ask the user name and store it to the clouddb
That would need to be after you finish a game and have a score.
Testing against the latest high score list would require having a copy of the high score list available locally.
You could save YOUR highest score in TinyDB, under tag MyHighestScore, and test against that before deciding to update it and start the process of updating the cloud high score table.
Let that process ask the cloud for the current high score table, and let it do the append,sort, trim to length, and replace operation.
You keep adding requirements, so more work is needed.
Multiple screens can't talk to each other.
TinyDB is easier than CloudDB for local storage, and you should be able to distinguish between the two and know where to use one and where to use the other.
All username and score information must be available before attempting to update it.
The screen Initialize event is a good place to ask for the latest high score list.
It should arrive before the user has a chance to enter his name and confirm.