How to save a unique username for each player

Hello, I need help with something. I need to know how in my app, there can be a unique saved username for each user, and they are addressed as that throughout the game. My game is a quiz game, and there is a text input where you enter your username. Let’s say a player enters their username as banana_bread. I want the player to be adressed as banana_bread throughout the game. For example, later on, the game might say, “banana_bread, what is your favorite color?” Any help or advice would be greatly appreciated!

Quick and easy way is make your player sign in using Firebase Authentication. That ensures that EMAIL addresses are unique. You could then display the email address without the domain ( inside the game. Or just display the first X number of letter of the email address without the domain, etc.

Going a bit further,you could use the Firebase realtime database to create a node for each email address, then create an alias property. This would protect the the email address from public exposure. The down side is you would need to ensure the uniqueness of each alias. To do this, when a user wants to choose an alias, you would need to do a for each loop on every other alias to make sure it wasn’t taken.

None of these solutions can be created using just a handlful of blocks, but hopefully this will generate some ideas for you.

Happy Thunking!

Thank you!!

Check this out


1 Like