0 votes

Hello All,

I am a newbie to game development and Godot. I wanted to understand the best approach to give a game player the ability to choose the character. As an example, before the actual platformer game starts, the user will get to see 3 characters and a user chooses 1 of them. Once the character is chosen, the user will move to play the game using that chosen character.

Thank you in advance and looking forward to being part of the Godot community :)

in Engine by (12 points)

1 Answer

0 votes

This calls for the same sollution as setting difficulty level, choosing stage and so on. Generally You need to design your scene tree structure in a way, that there is some menaging or data-keeping structure above the actual platformer and everything else. In project runtime You will find yourself changing scenes, returning to menus, showing victory/gameover screens and so on. Because of this it is impossible to keep all the data in platformer itself, higher scope variables will be needed. You can use Autoload for this, or customly made node, that will be root of your scene.
How it works will be : choose character in menu -> go to character selection menu-> clicked character data is passed from selection menu to Autoload/root-> start the game ->when level loads it reads character data from Autoload/root -> done

by (8,101 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.