feature/Coin #32
47
godot/GUI/GameOver.tscn
Normal file
47
godot/GUI/GameOver.tscn
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
[gd_scene load_steps=7 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://assets/fonts/ttf/PixelOperator8.ttf" type="DynamicFontData" id=1]
|
||||||
|
[ext_resource path="res://assets/fonts/ttf/PixelOperatorHB8.ttf" type="DynamicFontData" id=2]
|
||||||
|
[ext_resource path="res://GUI/botonreiniciar.gdns" type="Script" id=3]
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=1]
|
||||||
|
size = 50
|
||||||
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=2]
|
||||||
|
font_data = ExtResource( 2 )
|
||||||
|
|
||||||
|
[sub_resource type="StyleBoxFlat" id=3]
|
||||||
|
bg_color = Color( 0.0705882, 0.917647, 0, 1 )
|
||||||
|
|
||||||
|
[node name="GameOver" type="Control"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="."]
|
||||||
|
margin_right = 512.0
|
||||||
|
margin_bottom = 288.0
|
||||||
|
rect_min_size = Vector2( 512, 288 )
|
||||||
|
rect_rotation = -0.338293
|
||||||
|
color = Color( 0, 0, 0, 1 )
|
||||||
|
|
||||||
|
[node name="Label" type="Label" parent="."]
|
||||||
|
margin_left = 66.0
|
||||||
|
margin_top = 17.0
|
||||||
|
margin_right = 456.0
|
||||||
|
margin_bottom = 71.0
|
||||||
|
custom_fonts/font = SubResource( 1 )
|
||||||
|
text = "GAME OVER"
|
||||||
|
align = 1
|
||||||
|
|
||||||
|
[node name="botonreiniciar" type="Button" parent="."]
|
||||||
|
margin_left = 194.0
|
||||||
|
margin_top = 150.0
|
||||||
|
margin_right = 338.0
|
||||||
|
margin_bottom = 180.0
|
||||||
|
custom_fonts/font = SubResource( 2 )
|
||||||
|
custom_styles/hover = SubResource( 3 )
|
||||||
|
text = "REINICIAR"
|
||||||
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
|
[connection signal="pressed" from="botonreiniciar" to="botonreiniciar" method="_on_botonreiniciar_pressed"]
|
8
godot/GUI/botonreiniciar.gdns
Normal file
8
godot/GUI/botonreiniciar.gdns
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[gd_resource type="NativeScript" load_steps=2 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://gdnative/alai.tres" type="GDNativeLibrary" id=1]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
resource_name = "GameOverScreen"
|
||||||
|
class_name = "GameOverScreen"
|
||||||
|
library = ExtResource( 1 )
|
26
src/gui/game_over/GameOverScreen.cpp
Normal file
26
src/gui/game_over/GameOverScreen.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include "gui/game_over/GameOverScreen.h"
|
||||||
|
#include <Node.hpp>
|
||||||
|
using namespace godot;
|
||||||
|
|
||||||
|
void GameOverScreen::_register_methods()
|
||||||
|
{
|
||||||
|
register_method("_on_botonreiniciar_pressed", &GameOverScreen::_on_botonreiniciar_pressed);
|
||||||
|
}
|
||||||
|
|
||||||
|
GameOverScreen::GameOverScreen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
GameOverScreen::~GameOverScreen()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameOverScreen::_init()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
void GameOverScreen::_on_botonreiniciar_pressed()
|
||||||
|
{
|
||||||
|
get_tree().change_scene("res://monitor/GUI.tscn");
|
||||||
|
|
||||||
|
}
|
58
src/gui/game_over/GameOverScreen.h
Normal file
58
src/gui/game_over/GameOverScreen.h
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#ifndef ALAI_GAME_OVER_SCREEN
|
||||||
|
#define ALAI_GAME_OVER_SCREEN
|
||||||
|
|
||||||
|
|
||||||
|
#include <Godot.hpp>
|
||||||
|
#include <Node.hpp>
|
||||||
|
#include <Control.hpp>
|
||||||
|
|
||||||
|
namespace godot
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @brief This class controls what happens when the Coin is in the collected .
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class GameOverScreen : public Control
|
||||||
|
{
|
||||||
|
GODOT_CLASS(GameOverScreen, Control)
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* @brief This method registers classes with Godot.
|
||||||
|
*
|
||||||
|
* @details This method registers methods, properties, and signals with the Godot engine.
|
||||||
|
*/
|
||||||
|
static void _register_methods();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Construct a new GameOverScreen object.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
GameOverScreen();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Destroy the GameOverScreen object.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
~GameOverScreen();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the class from Godot.
|
||||||
|
*
|
||||||
|
* @details This method is called just once when the Godot engine connects to the instance of the class.
|
||||||
|
*/
|
||||||
|
void _init();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called when the collected of the coin is entered.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void _on_botonreiniciar_pressed();
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user