add gameover

This commit is contained in:
Mylloon 2023-02-25 18:46:29 +01:00
parent 6c82aba143
commit 2945f2a3ef
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 35 additions and 16 deletions

View file

@ -0,0 +1,8 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://Assets/skin_assets/VCR_OSD_MONO_1.001.ttf" type="DynamicFontData" id=1]
[resource]
size = 34
outline_color = Color( 0.298039, 0.0745098, 0.0745098, 1 )
font_data = ExtResource( 1 )

View file

@ -11,12 +11,8 @@ const texture_released = preload("res://Assets/skin_assets/button_pressed.png")
# Called every frame. '_delta' is the elapsed time since the previous frame. # Called every frame. '_delta' is the elapsed time since the previous frame.
func _process(_delta): func _process(_delta):
if etat: if etat:
if villain.animation == villain_animations[1]: if villain.animation == villain_animations[-1]:
print("non") get_tree().change_scene("res://Scenes/gameover.tscn")
else:
print("oui")
else:
print("caché")
func _on_Button_pressed(): func _on_Button_pressed():

20
Scenes/gameover.tscn Executable file
View file

@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Assets/windows.png" type="Texture" id=1]
[ext_resource path="res://Assets/skin_assets/menu_font.tres" type="DynamicFont" id=2]
[node name="Node2D" type="Node2D"]
[node name="Windows" type="Sprite" parent="."]
position = Vector2( 512, 360 )
z_index = -2
texture = ExtResource( 1 )
[node name="Label" type="Label" parent="."]
margin_left = 393.0
margin_top = 329.0
margin_right = 693.0
margin_bottom = 359.0
custom_colors/font_color = Color( 0, 0, 0, 1 )
custom_fonts/font = ExtResource( 2 )
text = "RATIO GAME OVER"

View file

@ -1,17 +1,12 @@
[gd_scene load_steps=8 format=2] [gd_scene load_steps=7 format=2]
[ext_resource path="res://Assets/windows.png" type="Texture" id=1] [ext_resource path="res://Assets/windows.png" type="Texture" id=1]
[ext_resource path="res://Assets/skin_assets/VCR_OSD_MONO_1.001.ttf" type="DynamicFontData" id=2] [ext_resource path="res://Assets/skin_assets/menu_font.tres" type="DynamicFont" id=2]
[ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=3] [ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=3]
[ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=4] [ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=4]
[ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=5] [ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=5]
[ext_resource path="res://Scenes/Screen_Menu.gd" type="Script" id=6] [ext_resource path="res://Scenes/Screen_Menu.gd" type="Script" id=6]
[sub_resource type="DynamicFont" id=1]
size = 34
outline_color = Color( 0.298039, 0.0745098, 0.0745098, 1 )
font_data = ExtResource( 2 )
[node name="Node2D" type="Node2D"] [node name="Node2D" type="Node2D"]
[node name="Windows" type="Sprite" parent="."] [node name="Windows" type="Sprite" parent="."]
@ -38,7 +33,7 @@ alignment = 1
margin_right = 100.0 margin_right = 100.0
margin_bottom = 37.0 margin_bottom = 37.0
custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 )
custom_fonts/font = SubResource( 1 ) custom_fonts/font = ExtResource( 2 )
custom_styles/hover = ExtResource( 3 ) custom_styles/hover = ExtResource( 3 )
custom_styles/pressed = ExtResource( 5 ) custom_styles/pressed = ExtResource( 5 )
custom_styles/normal = ExtResource( 4 ) custom_styles/normal = ExtResource( 4 )
@ -49,7 +44,7 @@ margin_top = 63.0
margin_right = 100.0 margin_right = 100.0
margin_bottom = 100.0 margin_bottom = 100.0
custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 )
custom_fonts/font = SubResource( 1 ) custom_fonts/font = ExtResource( 2 )
custom_styles/hover = ExtResource( 3 ) custom_styles/hover = ExtResource( 3 )
custom_styles/pressed = ExtResource( 5 ) custom_styles/pressed = ExtResource( 5 )
custom_styles/normal = ExtResource( 4 ) custom_styles/normal = ExtResource( 4 )
@ -60,7 +55,7 @@ margin_top = 126.0
margin_right = 100.0 margin_right = 100.0
margin_bottom = 163.0 margin_bottom = 163.0
custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 ) custom_colors/font_color = Color( 0.34902, 0.313726, 0.313726, 1 )
custom_fonts/font = SubResource( 1 ) custom_fonts/font = ExtResource( 2 )
custom_styles/hover = ExtResource( 3 ) custom_styles/hover = ExtResource( 3 )
custom_styles/pressed = ExtResource( 5 ) custom_styles/pressed = ExtResource( 5 )
custom_styles/normal = ExtResource( 4 ) custom_styles/normal = ExtResource( 4 )