Merge main and remove free_queue when dying
This commit is contained in:
commit
05ff226721
28 changed files with 6228 additions and 10 deletions
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=15 format=3 uid="uid://durhes43gex7a"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://durhes43gex7a"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://c7bfiw54rvaq2" path="res://scenes/player_melodie.tscn" id="1_cl1wt"]
|
||||
[ext_resource type="Script" path="res://scenes/room.gd" id="1_jh83c"]
|
||||
|
@ -9,6 +9,7 @@
|
|||
[ext_resource type="Texture2D" uid="uid://dhva3tivsvknl" path="res://ressources/images/mur_coin.svg" id="4_6a3f6"]
|
||||
[ext_resource type="PackedScene" uid="uid://di4chlep1t1or" path="res://parametres/menu_parametres.tscn" id="6_6ubhx"]
|
||||
[ext_resource type="PackedScene" uid="uid://bndtclt51nsih" path="res://scenes/interface.tscn" id="8_5s7tf"]
|
||||
[ext_resource type="PackedScene" uid="uid://ctgxrbcg2vu1p" path="res://scenes/ecran_mort.tscn" id="10_3ou8w"]
|
||||
[ext_resource type="PackedScene" uid="uid://cm5spgl8o4fam" path="res://scenes/enemies/robot.tscn" id="10_5qrsc"]
|
||||
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1c4te"]
|
||||
|
@ -136,6 +137,12 @@ texture = ExtResource("4_6a3f6")
|
|||
[node name="Slime" parent="." groups=["Enemies"] instance=ExtResource("3_04ip2")]
|
||||
position = Vector2(-448, 205)
|
||||
|
||||
[node name="Interface" parent="." instance=ExtResource("8_5s7tf")]
|
||||
offset_left = -640.0
|
||||
offset_top = -360.0
|
||||
offset_right = -640.0
|
||||
offset_bottom = -360.0
|
||||
|
||||
[node name="Menu_parametres" parent="." instance=ExtResource("6_6ubhx")]
|
||||
process_mode = 3
|
||||
visible = false
|
||||
|
@ -144,13 +151,16 @@ offset_top = -360.0
|
|||
offset_right = 640.0
|
||||
offset_bottom = 360.0
|
||||
|
||||
[node name="Interface" parent="." instance=ExtResource("8_5s7tf")]
|
||||
offset_left = -640.0
|
||||
offset_top = -360.0
|
||||
offset_right = -640.0
|
||||
offset_bottom = -360.0
|
||||
[node name="Ecran mort" parent="." instance=ExtResource("10_3ou8w")]
|
||||
process_mode = 3
|
||||
visible = false
|
||||
offset_left = -258.0
|
||||
offset_top = -383.0
|
||||
offset_right = -258.0
|
||||
offset_bottom = -383.0
|
||||
|
||||
[node name="Robot" parent="." groups=["Enemies"] instance=ExtResource("10_5qrsc")]
|
||||
position = Vector2(-428, 11)
|
||||
|
||||
[connection signal="finished" from="Musique" to="." method="_on_audio_stream_player_finished"]
|
||||
[connection signal="retour_menu" from="Ecran mort" to="." method="_on_ecran_mort_retour_menu"]
|
||||
|
|
16
scenes/ecran_mort.gd
Normal file
16
scenes/ecran_mort.gd
Normal file
|
@ -0,0 +1,16 @@
|
|||
extends Control
|
||||
|
||||
signal retour_menu ()
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
pass
|
||||
|
||||
|
||||
func _on_main_menu_button_pressed() -> void:
|
||||
retour_menu.emit()
|
81
scenes/ecran_mort.tscn
Normal file
81
scenes/ecran_mort.tscn
Normal file
|
@ -0,0 +1,81 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://ctgxrbcg2vu1p"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://j8hopa3c7fr3" path="res://ressources/images/icone_mort.svg" id="1_ekgu8"]
|
||||
[ext_resource type="Script" path="res://scenes/ecran_mort.gd" id="1_k44wh"]
|
||||
[ext_resource type="FontFile" uid="uid://dbe1teksyhymq" path="res://ressources/fonts/OpenDyslexic-Regular.otf" id="2_usedy"]
|
||||
[ext_resource type="Texture2D" uid="uid://dqfrqntx73do5" path="res://ressources/images/menu_jeu_button.svg" id="3_ecfx2"]
|
||||
[ext_resource type="Texture2D" uid="uid://kpss4kt07w8l" path="res://ressources/images/menu_jeu_button_survole.svg" id="4_jv24w"]
|
||||
|
||||
[node name="Control" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_k44wh")
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="HBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("1_ekgu8")
|
||||
expand_mode = 1
|
||||
|
||||
[node name="Mort" type="Label" parent="HBoxContainer/VBoxContainer/TextureRect"]
|
||||
modulate = Color(0.917647, 0.941176, 0.847059, 1)
|
||||
self_modulate = Color(0.917647, 0.941176, 0.847059, 1)
|
||||
offset_left = 89.0
|
||||
offset_top = 187.0
|
||||
offset_right = 414.0
|
||||
offset_bottom = 315.0
|
||||
theme_override_fonts/font = ExtResource("2_usedy")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Vous êtes
|
||||
mort"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="main_menu_button" type="TextureButton" parent="HBoxContainer/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(250, 250)
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("3_ecfx2")
|
||||
texture_pressed = ExtResource("4_jv24w")
|
||||
texture_hover = ExtResource("4_jv24w")
|
||||
texture_disabled = ExtResource("4_jv24w")
|
||||
texture_focused = ExtResource("4_jv24w")
|
||||
stretch_mode = 0
|
||||
|
||||
[node name="main_menu_label" type="Label" parent="HBoxContainer/VBoxContainer/main_menu_button"]
|
||||
modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 0
|
||||
offset_left = 89.0
|
||||
offset_top = 62.0
|
||||
offset_right = 414.0
|
||||
offset_bottom = 190.0
|
||||
theme_override_fonts/font = ExtResource("2_usedy")
|
||||
theme_override_font_sizes/font_size = 32
|
||||
text = "Menu Principal"
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
language = "fr_FR"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="HBoxContainer"]
|
||||
modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[connection signal="pressed" from="HBoxContainer/VBoxContainer/main_menu_button" to="." method="_on_main_menu_button_pressed"]
|
|
@ -12,6 +12,8 @@ extends Control
|
|||
|
||||
@onready var life : int = 10
|
||||
|
||||
signal mort ()
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass
|
||||
|
@ -22,7 +24,10 @@ func _process(delta: float) -> void:
|
|||
pass
|
||||
|
||||
func set_life(pv : int) -> void :
|
||||
for i in range(life, pv):
|
||||
var step = 1
|
||||
if pv > life :
|
||||
step = -1
|
||||
for i in range(life, pv, step):
|
||||
update_life(i)
|
||||
update_life(pv)
|
||||
|
||||
|
@ -30,7 +35,7 @@ func update_life (pv : int) -> void :
|
|||
match pv :
|
||||
0 :
|
||||
coeur1.hide()
|
||||
#Rajouter ici la gestion de la mort
|
||||
mort.emit()
|
||||
1 :
|
||||
coeur1.texture = load("res://ressources/images/half_heart.svg")
|
||||
2 :
|
||||
|
|
|
@ -2,11 +2,16 @@ extends Node2D
|
|||
|
||||
@onready var menu_parametres = $Menu_parametres
|
||||
@onready var interface = $Interface
|
||||
@onready var mort = $"Ecran mort"
|
||||
@onready var musique = $Musique
|
||||
|
||||
signal daddy ()
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
menu_parametres.exit_parametres.connect(on_exit_parametres)
|
||||
mort.retour_menu.connect(on_ecran_mort_retour_menu)
|
||||
interface.mort.connect(on_death)
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
@ -37,3 +42,11 @@ func set_musique(nom : String) -> void :
|
|||
musique.stream = load("res://ressources/sons/fight_theme.wav")
|
||||
_ :
|
||||
pass
|
||||
|
||||
|
||||
func on_ecran_mort_retour_menu() -> void:
|
||||
daddy.emit()
|
||||
queue_free()
|
||||
|
||||
func on_death() -> void :
|
||||
mort.visible = true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue