From f62bc3cb0153b4c7703e74a959f7daf90d11a383 Mon Sep 17 00:00:00 2001 From: E213872U Date: Fri, 24 Jan 2025 21:20:52 +0100 Subject: [PATCH 1/5] =?UTF-8?q?Ajout=20du=20th=C3=A8me=20chill=20et=20modi?= =?UTF-8?q?fication=20du=20menu=20principal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- menu_principal/menu_principal_affichage.tscn | 23 ------------------- ressources/sons/idle_theme.wav.import | 24 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 23 deletions(-) create mode 100644 ressources/sons/idle_theme.wav.import diff --git a/menu_principal/menu_principal_affichage.tscn b/menu_principal/menu_principal_affichage.tscn index 347eb46..7f4b2e8 100644 --- a/menu_principal/menu_principal_affichage.tscn +++ b/menu_principal/menu_principal_affichage.tscn @@ -148,29 +148,6 @@ horizontal_alignment = 1 vertical_alignment = 1 language = "fr_FR" -[node name="credit_button" type="TextureButton" parent="Menu_principal/HBoxContainer/VBoxSideButton"] -custom_minimum_size = Vector2(0, 128) -layout_mode = 2 -texture_normal = ExtResource("3_o6osq") -texture_pressed = ExtResource("4_egxbj") -texture_hover = ExtResource("4_egxbj") -texture_focused = ExtResource("4_egxbj") -stretch_mode = 0 - -[node name="credit_label" type="Label" parent="Menu_principal/HBoxContainer/VBoxSideButton/credit_button"] -modulate = Color(0, 0, 0, 1) -layout_mode = 0 -offset_left = 25.0 -offset_top = 28.0 -offset_right = 175.0 -offset_bottom = 92.0 -theme_override_fonts/font = ExtResource("5_1lmm7") -theme_override_font_sizes/font_size = 25 -text = "Crédits" -horizontal_alignment = 1 -vertical_alignment = 1 -language = "fr_FR" - [node name="HSeparator2" type="HSeparator" parent="Menu_principal/HBoxContainer/VBoxSideButton"] modulate = Color(1, 1, 1, 0) self_modulate = Color(1, 1, 1, 0) diff --git a/ressources/sons/idle_theme.wav.import b/ressources/sons/idle_theme.wav.import new file mode 100644 index 0000000..d134209 --- /dev/null +++ b/ressources/sons/idle_theme.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://qyacm71epyhi" +path="res://.godot/imported/idle_theme.wav-7d853091879d7fbaec43f980f4ba9daf.sample" + +[deps] + +source_file="res://ressources/sons/idle_theme.wav" +dest_files=["res://.godot/imported/idle_theme.wav-7d853091879d7fbaec43f980f4ba9daf.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 From 713a03c6be112cfd6878cd87cc104cc4860a9dbe Mon Sep 17 00:00:00 2001 From: E213872U Date: Fri, 24 Jan 2025 22:23:51 +0100 Subject: [PATCH 2/5] LE CHANGEMENT DE TOUCHES REMARCHE ! LOUE SOIT LES SAINT PARAMETRES --- menu_principal/menu_principal_affichage.gd | 5 ++--- parametres/assign_menu/assigner_bouton.gd | 18 +++++++++++------- parametres/tab_parametres.tscn | 6 ++++-- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/menu_principal/menu_principal_affichage.gd b/menu_principal/menu_principal_affichage.gd index a53b924..627ed76 100644 --- a/menu_principal/menu_principal_affichage.gd +++ b/menu_principal/menu_principal_affichage.gd @@ -32,6 +32,7 @@ func _on_param_button_pressed(): func on_exit_parametres() -> void : menu_principal.visible = true menu_parametres.visible = false + menu_parametres.set_process(false) @@ -39,9 +40,7 @@ func _on_play_button_pressed(): get_tree().root.add_child(first_room) musique_fond.playing = false menu_principal.visible = false - -func _on_load_button_pressed(): - print("Charger une sauvegarde") + func _on_musique_fond_finished() -> void: diff --git a/parametres/assign_menu/assigner_bouton.gd b/parametres/assign_menu/assigner_bouton.gd index 99befae..dac3c20 100644 --- a/parametres/assign_menu/assigner_bouton.gd +++ b/parametres/assign_menu/assigner_bouton.gd @@ -5,7 +5,7 @@ extends Control @onready var button = $HBoxContainer/Button as Button @export var nom_action : String = "BOUGER_HAUT" -var nom_touche : String = OS.get_keycode_string(InputMap.action_get_events(nom_action)[0].physical_keycode) +@onready var nom_touche : String = OS.get_keycode_string(InputMap.action_get_events(nom_action)[0].physical_keycode) # Called when the node enters the scene tree for the first time. @@ -28,9 +28,9 @@ func set_texte_label() -> void : "BOUGER_BAS": label.text = "descendre" "BOUGER_DROITE": - label.text = "droite" + label.text = "aller à droite" "BOUGER_GAUCHE": - label.text = "gauche" + label.text = "aller à gauche" "PAUSE": label.text = "Pause" @@ -39,6 +39,7 @@ func set_texte_bouton() -> void: button.text = "%s" % nom_touche func definir_touche(touche)-> void: + var old = InputMap.action_get_events(nom_action)[0] var action_keycode=touche.physical_keycode @@ -46,11 +47,14 @@ func definir_touche(touche)-> void: InputMap.action_add_event(nom_action, touche) set_texte_bouton() + print(nom_action, "deviens ", nom_touche) for i in get_tree().get_nodes_in_group("changer_touches"): - if i.nom_action != self.nom_action : - if i.nom_touche==self.nom_touche : - i.definir_touche(old) + if i.nom_action != self.nom_action and i.nom_touche==self.nom_touche : + InputMap.action_erase_events(i.nom_action) + InputMap.action_add_event(i.nom_action, old) + i.set_texte_bouton() + print(i.nom_action, "deviens ", i.nom_touche, "car échange") func _on_button_pressed(): button.text = "Appuyez sur une touche..." @@ -63,5 +67,5 @@ func _unhandled_key_input(event): func _on_hidden(): - set_process_unhandled_key_input(true) + set_process_unhandled_key_input(false) set_texte_bouton() diff --git a/parametres/tab_parametres.tscn b/parametres/tab_parametres.tscn index e53df86..c8bf8c8 100644 --- a/parametres/tab_parametres.tscn +++ b/parametres/tab_parametres.tscn @@ -22,9 +22,11 @@ func _process(delta): func _on_commandes_tab_changed(tab): - if tab != 2 : - commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton.set_process_unhandled_key_input(false) + commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton6.set_process_unhandled_key_input(false) commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton2.set_process_unhandled_key_input(false) + commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton3.set_process_unhandled_key_input(false) + commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton4.set_process_unhandled_key_input(false) + commandes.MarginContainer.ScrollContainer.VBoxContainer.assigner_bouton5.set_process_unhandled_key_input(false) " [node name="Tab_Parametres" type="Control"] From cd6e43df1072952e54394c41127befc86701b40c Mon Sep 17 00:00:00 2001 From: Renarde-dev Date: Fri, 24 Jan 2025 22:27:49 +0100 Subject: [PATCH 3/5] Add wall and apropriate colider --- scenes/Room.tscn | 82 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 7 deletions(-) diff --git a/scenes/Room.tscn b/scenes/Room.tscn index 6d4c96d..50b44f5 100644 --- a/scenes/Room.tscn +++ b/scenes/Room.tscn @@ -1,30 +1,32 @@ -[gd_scene load_steps=8 format=3 uid="uid://durhes43gex7a"] +[gd_scene load_steps=10 format=3 uid="uid://durhes43gex7a"] [ext_resource type="PackedScene" uid="uid://c7bfiw54rvaq2" path="res://scenes/player_melodie.tscn" id="1_cl1wt"] [ext_resource type="Texture2D" uid="uid://ky4e7158gqf6" path="res://ressources/images/cgj_default_tile.svg" id="2_torsx"] [ext_resource type="PackedScene" uid="uid://cyvqa6g64cw37" path="res://scenes/enemies/slime.tscn" id="3_04ip2"] +[ext_resource type="Texture2D" uid="uid://bge3nllk1bq5r" path="res://ressources/images/mur.svg" id="3_oi2tl"] +[ext_resource type="Texture2D" uid="uid://dhva3tivsvknl" path="res://ressources/images/mur_coin.svg" id="4_6a3f6"] [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1c4te"] normal = Vector2(0, 1) -distance = -360.0 +distance = -328.0 [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_qq3vn"] -distance = -360.0 +distance = -314.0 [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_e1nqi"] normal = Vector2(-1, 0) -distance = -640.0 +distance = -592.0 [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_ia1hi"] normal = Vector2(1, 0) -distance = -640.0 +distance = -596.0 [node name="Room" type="Node2D"] [node name="TextureRect" type="TextureRect" parent="."] -offset_left = -640.0 +offset_left = -638.0 offset_top = -360.0 -offset_right = 640.0 +offset_right = 642.0 offset_bottom = 360.0 texture = ExtResource("2_torsx") stretch_mode = 1 @@ -39,15 +41,81 @@ collision_mask = 3 [node name="World Border Up" type="CollisionShape2D" parent="StaticBody2D"] shape = SubResource("WorldBoundaryShape2D_1c4te") +[node name="TextureRect" type="TextureRect" parent="StaticBody2D/World Border Up"] +offset_left = -640.0 +offset_top = -392.0 +offset_right = 640.0 +offset_bottom = -328.0 +texture = ExtResource("3_oi2tl") +stretch_mode = 1 + [node name="World Border Down" type="CollisionShape2D" parent="StaticBody2D"] shape = SubResource("WorldBoundaryShape2D_qq3vn") +[node name="TextureRect" type="TextureRect" parent="StaticBody2D/World Border Down"] +offset_left = 622.0 +offset_top = 379.0 +offset_right = 1902.0 +offset_bottom = 443.0 +rotation = 3.14159 +texture = ExtResource("3_oi2tl") +stretch_mode = 1 + [node name="World Border Right" type="CollisionShape2D" parent="StaticBody2D"] shape = SubResource("WorldBoundaryShape2D_e1nqi") +[node name="TextureRect" type="TextureRect" parent="StaticBody2D/World Border Right"] +offset_left = -659.0 +offset_top = 374.0 +offset_right = 61.0 +offset_bottom = 438.0 +rotation = -1.5708 +texture = ExtResource("3_oi2tl") +stretch_mode = 1 + [node name="World Border Left" type="CollisionShape2D" parent="StaticBody2D"] shape = SubResource("WorldBoundaryShape2D_ia1hi") +[node name="TextureRect" type="TextureRect" parent="StaticBody2D/World Border Left"] +offset_left = 658.0 +offset_top = -355.0 +offset_right = 1378.0 +offset_bottom = -291.0 +rotation = 1.5708 +texture = ExtResource("3_oi2tl") +stretch_mode = 1 + +[node name="TextureRect" type="TextureRect" parent="StaticBody2D"] +offset_left = -659.0 +offset_top = -392.0 +offset_right = -595.0 +offset_bottom = -328.0 +texture = ExtResource("4_6a3f6") + +[node name="TextureRect2" type="TextureRect" parent="StaticBody2D"] +offset_left = -659.0 +offset_top = 379.0 +offset_right = -595.0 +offset_bottom = 443.0 +rotation = -1.5708 +texture = ExtResource("4_6a3f6") + +[node name="TextureRect3" type="TextureRect" parent="StaticBody2D"] +offset_left = 658.0 +offset_top = 379.0 +offset_right = 722.0 +offset_bottom = 443.0 +rotation = 3.14159 +texture = ExtResource("4_6a3f6") + +[node name="TextureRect4" type="TextureRect" parent="StaticBody2D"] +offset_left = 658.0 +offset_top = -392.0 +offset_right = 722.0 +offset_bottom = -328.0 +rotation = 1.5708 +texture = ExtResource("4_6a3f6") + [node name="CanvasLayer" type="CanvasLayer" parent="."] [node name="Camera2D" type="Camera2D" parent="CanvasLayer"] From 1d59fdca740645d53ea09309a024b36aa8d86a06 Mon Sep 17 00:00:00 2001 From: Renarde-dev Date: Fri, 24 Jan 2025 22:40:11 +0100 Subject: [PATCH 4/5] Add new slime textures --- scenes/Room.tscn | 2 +- scenes/enemies/slime.tscn | 25 +++++++++++++------------ scripts/Instrument/balle.gd | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/scenes/Room.tscn b/scenes/Room.tscn index 50b44f5..4c62dba 100644 --- a/scenes/Room.tscn +++ b/scenes/Room.tscn @@ -32,7 +32,7 @@ texture = ExtResource("2_torsx") stretch_mode = 1 [node name="Player_Melodie" parent="." instance=ExtResource("1_cl1wt")] -scale = Vector2(4, 4) +scale = Vector2(3, 3) [node name="StaticBody2D" type="StaticBody2D" parent="." groups=["World_Border"]] collision_layer = 3 diff --git a/scenes/enemies/slime.tscn b/scenes/enemies/slime.tscn index 1ace833..0256059 100644 --- a/scenes/enemies/slime.tscn +++ b/scenes/enemies/slime.tscn @@ -1,18 +1,18 @@ [gd_scene load_steps=7 format=3 uid="uid://cyvqa6g64cw37"] [ext_resource type="Script" path="res://scenes/enemies/slime.gd" id="1_hnufy"] -[ext_resource type="Texture2D" uid="uid://ba14nw87lxef4" path="res://ressources/images/blob-1.png.png" id="1_n4mgf"] -[ext_resource type="Texture2D" uid="uid://cpge55gmdllmi" path="res://ressources/images/blob-2-4.png.png" id="2_w8gqg"] -[ext_resource type="Texture2D" uid="uid://bst1iwqgqmcvl" path="res://ressources/images/blob-3.png.png" id="3_pwpfc"] +[ext_resource type="Texture2D" uid="uid://c85d5krtd4nks" path="res://ressources/images/blob-1.png" id="2_f4wf2"] +[ext_resource type="Texture2D" uid="uid://c0b6d7551nbcm" path="res://ressources/images/blob-2-4.png" id="3_dyq42"] +[ext_resource type="Texture2D" uid="uid://2gqy3xv26df1" path="res://ressources/images/blob-3.png" id="4_wwwjt"] [sub_resource type="SpriteFrames" id="SpriteFrames_qfla8"] animations = [{ "frames": [{ "duration": 1.0, -"texture": ExtResource("1_n4mgf") +"texture": ExtResource("2_f4wf2") }, { "duration": 1.0, -"texture": ExtResource("2_w8gqg") +"texture": ExtResource("3_dyq42") }], "loop": false, "name": &"idle", @@ -20,16 +20,19 @@ animations = [{ }, { "frames": [{ "duration": 1.0, -"texture": ExtResource("1_n4mgf") +"texture": ExtResource("2_f4wf2") }, { "duration": 1.0, -"texture": ExtResource("2_w8gqg") +"texture": ExtResource("3_dyq42") }, { "duration": 1.0, -"texture": ExtResource("3_pwpfc") +"texture": ExtResource("4_wwwjt") }, { "duration": 1.0, -"texture": ExtResource("2_w8gqg") +"texture": ExtResource("3_dyq42") +}, { +"duration": 1.0, +"texture": ExtResource("2_f4wf2") }], "loop": true, "name": &"walk_down", @@ -45,11 +48,9 @@ collision_mask = 3 script = ExtResource("1_hnufy") [node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] -position = Vector2(-3, 12) +scale = Vector2(0.2, 0.2) sprite_frames = SubResource("SpriteFrames_qfla8") animation = &"idle" -frame = 1 -frame_progress = 1.0 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource("CircleShape2D_bokrm") diff --git a/scripts/Instrument/balle.gd b/scripts/Instrument/balle.gd index 0bbc40c..b0dbad0 100644 --- a/scripts/Instrument/balle.gd +++ b/scripts/Instrument/balle.gd @@ -1,6 +1,6 @@ extends Area2D -@export var speed: float = 300 # Définir la vitesse de la balle +@export var speed: float = 500 # Définir la vitesse de la balle @export var raycast: RayCast2D # Direction initiale du mouvement From 1da26cb9ac719b00935d34e0d5aa8bfd953b24f2 Mon Sep 17 00:00:00 2001 From: E213872U Date: Fri, 24 Jan 2025 22:52:53 +0100 Subject: [PATCH 5/5] KONO DIO DA !!!!!!! --- scenes/Room.tscn | 13 ++++++++++++- scenes/room.gd | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 scenes/room.gd diff --git a/scenes/Room.tscn b/scenes/Room.tscn index 50b44f5..1e53541 100644 --- a/scenes/Room.tscn +++ b/scenes/Room.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=10 format=3 uid="uid://durhes43gex7a"] +[gd_scene load_steps=12 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"] [ext_resource type="Texture2D" uid="uid://ky4e7158gqf6" path="res://ressources/images/cgj_default_tile.svg" id="2_torsx"] [ext_resource type="PackedScene" uid="uid://cyvqa6g64cw37" path="res://scenes/enemies/slime.tscn" id="3_04ip2"] [ext_resource type="Texture2D" uid="uid://bge3nllk1bq5r" path="res://ressources/images/mur.svg" id="3_oi2tl"] [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"] [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_1c4te"] normal = Vector2(0, 1) @@ -22,6 +24,7 @@ normal = Vector2(1, 0) distance = -596.0 [node name="Room" type="Node2D"] +script = ExtResource("1_jh83c") [node name="TextureRect" type="TextureRect" parent="."] offset_left = -638.0 @@ -122,3 +125,11 @@ texture = ExtResource("4_6a3f6") [node name="Slime" parent="." groups=["Enemies"] instance=ExtResource("3_04ip2")] position = Vector2(-448, 205) + +[node name="Menu_parametres" parent="." instance=ExtResource("6_6ubhx")] +process_mode = 3 +visible = false +offset_left = -640.0 +offset_top = -360.0 +offset_right = 640.0 +offset_bottom = 360.0 diff --git a/scenes/room.gd b/scenes/room.gd new file mode 100644 index 0000000..5fbafdf --- /dev/null +++ b/scenes/room.gd @@ -0,0 +1,24 @@ +extends Node2D + +@onready var menu_parametres = $Menu_parametres + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + menu_parametres.exit_parametres.connect(on_exit_parametres) + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta: float) -> void: + if Input.is_action_just_pressed("PAUSE") : + on_param_button_pressed() + + +func on_param_button_pressed(): + get_tree().paused = true + menu_parametres.set_process(true) + menu_parametres.visible = true + +func on_exit_parametres() -> void : + get_tree().paused = false + menu_parametres.visible = false + menu_parametres.set_process(false)