Basis Scene Tree for a complete game (Platformer)


So my first Project should be a Platformer with 4-7
Levels and little Shop to purchase permanent Updates like double jump . And maybe a overworld. I already build some basic structures like player, first Level, Main Menu. Game Manager.
So my question. I saw in a YouTube tutorial" Copy Paste your Main Root, clean it and tada you have a blank canvas for level 2" Does this really work? Because I also copy the game Manager and player.
If the Gamemanger should keep track of Coins to buy things
later in the Shop. How should my Root/ Tree look like ?
I thought of something like this

• Main Node (Game)
→ • Game Manager
→ • Player
->-> • Sprite; Collisionshape etc.
→ • Shop
→ • Main Menu
→ • Level
→ -> Level 1
→ -> → •Tilemap, platforms, Score etc.
→ -> Level 2
->->-> •Tilemap, Coins, Score,Music etc.

All the different Nodes, that make a level like Tilemap Coins, Platforms etc. packed in one Level. Level 1,Level 2 etc. packed in Levels

But if I do that, didn’t I miss the player(scene) in each Level?
And if I place a player in each level, can the Player carry skills across levels(that are bought in Shop) ?

Or must I have a Game Manager and Player in every level to keep getting
Updates across the levels

Is more of a basic Question about how Godots system works. if you know a good Video please send it too.

I think for this specific issue, you should look into this piece in the documentation

Saving games in this context doesn’t ONLY refer to saving a game state to a file on the machine, but also collecting and storing data from multiple nodes / sources during gameplay, and referencing that as the game goes on. The documentation does a much better job at explaining how it all works, but I definitely recommend checking it out!

1 Like

for the levels, you will actually need to implement switching scene that load, instantiate level, add child it to a Levels node in main root tree. but when you switch to a level, remove child then queue free any nodes that’s inside the Levels node, this to ensure only 1 level active at a time.
if let’s say you reparent the Player to level_1, then you will need to reparent back the Player to Main Node before queue_free the level_1, then switch to level_2 and reparent the Player back to level_2.

this video explain how to switch scene with doors. if you gonna build platformer, then you will need these doors. this one should be helpful:

1 Like