60 lines
1.2 KiB
C++
60 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "break_utopia/macros.h"
|
|
#include "core/io/resource.h"
|
|
#include "scene/3d/physics/area_3d.h"
|
|
#include "scene/gui/control.h"
|
|
#include "scene/main/viewport.h"
|
|
#include "scene/resources/packed_scene.h"
|
|
|
|
class LevelResult : public Resource {
|
|
GDCLASS(LevelResult, Resource);
|
|
static void _bind_methods();
|
|
int style{ 0 };
|
|
int score{ 0 };
|
|
int destroyed{ 0 };
|
|
int total_objects{ 0 };
|
|
Ref<PackedScene> next_level{};
|
|
|
|
public:
|
|
GET_SET_FNS(int, style);
|
|
GET_SET_FNS(int, score);
|
|
GET_SET_FNS(int, destroyed);
|
|
GET_SET_FNS(int, total_objects);
|
|
GET_SET_FNS(Ref<PackedScene>, next_level);
|
|
void store_current_state();
|
|
};
|
|
|
|
class LevelEnd : public Area3D {
|
|
GDCLASS(LevelEnd, Area3D);
|
|
static void _bind_methods();
|
|
void body_entered(Node *body);
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
private:
|
|
Ref<PackedScene> intermission_screen{};
|
|
Ref<PackedScene> next_level{};
|
|
|
|
public:
|
|
GET_SET_FNS(Ref<PackedScene>, intermission_screen);
|
|
GET_SET_FNS(Ref<PackedScene>, next_level);
|
|
};
|
|
|
|
class IntermissionScreen : public Control {
|
|
GDCLASS(IntermissionScreen, Control);
|
|
static void _bind_methods();
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
|
|
public:
|
|
void next_level();
|
|
|
|
private:
|
|
Ref<LevelResult> result{};
|
|
|
|
public:
|
|
GET_SET_FNS(Ref<LevelResult>, result);
|
|
};
|