Screen Flow
Scenes in Godot Engine
The way scenes work in Godot Engine is ingenious, basically, everything can be a scene. An object can be a scene, a sprite, a physical body, GUI, screens... So when you want to change from one scene to another you need to ask the main loop, the Scene Tree, to change the root scene (the one that triggers all the events that should be processed in the game). By using:
get_tree().change_scene(String scene_path)
we can change between levels on the game, screens and even between menus (e.g. from the main menu to the options).
By using signals , which are basically a visual application for the observer pattern, we can tell an object to send a message to another, the listener. We can then attach this message to a method in the listener which will then execute this method triggered by the message it received.
Moon Cheeser Screens
The game itself doesn't have a complex screen flow it is as it follows:
But this was enough to a lazy designer to think on a scalable solution for that.
So I designed a simple class which extends the built-in scene changing functionalities by allowing signals to pass scene paths as arguments when they trigger.
By doing this when designing and implementing the scene flow I just have to emit a signal to the root node, which inherits an abstract screen class, with the new scene's path. That's how it works:
That's my report for this week, hope you enjoyed <3
Get Moon Cheeser
Moon Cheeser
Is it possible that somewhere in the space there's a moon made out of cheese?
Status | Released |
Authors | Pigdev, Henrique Campos |
Genre | Action |
Tags | assets, Casual, Cute, flat-shading, godot-engine, infinite-runner, one-button, Singleplayer, Space, Vector |
Languages | English |
Accessibility | High-contrast, Interactive tutorial, Textless, One button |
More posts
- Manual is out!Nov 21, 2020
- Blue Moon update!Nov 02, 2020
- I miss manuals :(Oct 09, 2020
- Small fixes and additionsApr 05, 2019
- Moon Cheeser v2.0.0!!Apr 03, 2019
- SwingPivot: Procedural Swing AnimationMar 22, 2019
- Particles are back and better in v2.0.0Feb 28, 2019
- Making reusable AssetsFeb 27, 2019
- Refactoring on the Core Loop! Better Code Coming Soon!Feb 13, 2019
- Port to Godot 3.1Sep 18, 2018
Leave a comment
Log in with itch.io to leave a comment.