gdquest-demos / godot-3-beginner-2d-platformer

Learn to create a 2d platform game with the Godot game engine. This is a beginner programming tutorial.
MIT License
364 stars 96 forks source link

Use simpler SceneTree.change_scene #23

Closed razcore-rad closed 5 years ago

razcore-rad commented 5 years ago

I agree with @henriiquecampos that it's much simpler to use get_tree().change_scene and I've fixed it in this PR. The issue before was that the user interface was only on the Game scene and using get_tree().change_scene would remove the interface.

But with the method of inheriting a level scene and extending it makes it so we can use get_tree().change_scene. The play button now points to Level-01.tscn and there's no need for the PlayerScreen & Game scenes as well as nor is the need for their respective scripts.

This simplifies level changing quite a bit.

closes #21