Rally Rush
Loading...
Searching...
No Matches
end_screen.hpp
Go to the documentation of this file.
1#ifndef END_SCREEN_HPP
2#define END_SCREEN_HPP
3
4#include "godot_cpp/classes/canvas_layer.hpp"
5#include "godot_cpp/classes/packed_scene.hpp"
6namespace godot {
8class EndScreen : public CanvasLayer {
9 GDCLASS(EndScreen, CanvasLayer);
11 static void _bind_methods();
12public:
14 virtual void _ready() override;
15
17 void return_to_main();
19 void restart();
20
22 void set_main_menu_scene(Ref<PackedScene> scene);
24 Ref<PackedScene> get_main_menu_scene() const;
26 void set_game_scene(Ref<PackedScene> scene);
28 Ref<PackedScene> get_game_scene() const;
29private:
30 Ref<PackedScene> game_scene{};
31 Ref<PackedScene> main_menu_scene{};
32};
33}
34#endif // !END_SCREEN_HPP
The game-over screen, used both when the player has won and lost the game.
Definition end_screen.hpp:8
void return_to_main()
Listener for return to menu button "button_down" observer. Load the main menu scene.
Definition end_screen.cpp:22
Ref< PackedScene > main_menu_scene
Definition end_screen.hpp:31
void set_main_menu_scene(Ref< PackedScene > scene)
The scene to load when return to main menu is pressed.
Definition end_screen.cpp:31
static void _bind_methods()
Bind editor properties.
Definition end_screen.cpp:8
Ref< PackedScene > get_main_menu_scene() const
The scene to load when return to main menu is pressed.
Definition end_screen.cpp:35
Ref< PackedScene > game_scene
Definition end_screen.hpp:30
virtual void _ready() override
Fetch buttons from children and register observers.
Definition end_screen.cpp:14
GDCLASS(EndScreen, CanvasLayer)
void restart()
Listener for restart button "button_down" observer. Load the game scene.
Definition end_screen.cpp:26
Ref< PackedScene > get_game_scene() const
The scene to load when the restart game button is pressed.
Definition end_screen.cpp:43
void set_game_scene(Ref< PackedScene > scene)
The scene to load when the restart game button is pressed.
Definition end_screen.cpp:39
Definition beacon_powerup.cpp:6