I need some suggetions

I am making a android game .And I wanna know how can I add a feature in my game where player will be asked some question and He/She Need to Type it by keyboard…well suppose I launched my game first time And A text appear and ask me to input my name …after I input my name it ask me to input my Mothers name…after that my game will run like a normal game…But it will not ask me again in future… I know about text input…but i dont know how to use that

1 Like

You can use the storage events to store the player name in web storage.
So the idea is, when your game runs the first time you can simply check if the name already exist in the storage, if yes then don’t need to ask again, you can skip to the game. If it doesn’t exist, you ask the name first and then start the game…

Condition:
At the beginning of the scene
“Name” exist in storage “PersonalInfo”

Action:
Change to scene “Game”

Condition:
At the beginning of the scene
“Name” is NOT exist in storage “PersonalInfo”

Action:
Change to scene “AskName”

Regarding how to read and write storage, you can find more info on the wiki:
http://wiki.compilgames.net/doku.php/gdevelop5/tutorials/storage-action-explained
Example is also included with GD.

2 Likes

@ddabrahim - when you say web storage, do you mean on the web server or is web storage just a type of cookie?

I mean browser web storage:

Ah, thanks for clarifying. I didn’t know browsers allowed that.

Thanks it was helpfull