Bläddra i källkod

:tada: Fait un niveau ou les briques descendent

DricomDragon 9 månader sedan
förälder
incheckning
bc6ca593c5

+ 14 - 2
godot/composants/interface/choix_niveau/choix_niveau.tscn

@@ -1,4 +1,4 @@
-[gd_scene load_steps=15 format=3 uid="uid://cnbv6y2ikfysg"]
+[gd_scene load_steps=17 format=3 uid="uid://cnbv6y2ikfysg"]
 
 [ext_resource type="Script" path="res://composants/interface/choix_niveau/systeme_solaire.gd" id="1_1jmyy"]
 [ext_resource type="Script" path="res://composants/interface/choix_niveau/choix_niveau.gd" id="1_nhye5"]
@@ -13,7 +13,9 @@
 [ext_resource type="PackedScene" uid="uid://cyyb8weydthjc" path="res://exec/niveaux/carre_simple.tscn" id="10_m6fgg"]
 [ext_resource type="PackedScene" uid="uid://dh15j87pa6rul" path="res://exec/niveaux/jdll2024.tscn" id="12_5dpbk"]
 [ext_resource type="Texture2D" uid="uid://gnbv1jnada2r" path="res://composants/interface/planete/images/21.png" id="13_s2a0u"]
-[ext_resource type="PackedScene" uid="uid://bke8ggl6keafb" path="res://exec/niveaux/triangles.tscn" id="14_gw0xo"]
+[ext_resource type="PackedScene" path="res://exec/niveaux/triangles.tscn" id="14_gw0xo"]
+[ext_resource type="Texture2D" uid="uid://beudk7g46syiu" path="res://composants/interface/planete/images/22.png" id="15_6imjs"]
+[ext_resource type="PackedScene" uid="uid://b2578e5i8ubvg" path="res://exec/niveaux/falling_dart.tscn" id="16_qdyvs"]
 
 [node name="ChoixNiveau" type="Node"]
 script = ExtResource("1_nhye5")
@@ -80,6 +82,16 @@ texture_normal = ExtResource("13_s2a0u")
 script = ExtResource("5_hm38a")
 niveau = ExtResource("14_gw0xo")
 
+[node name="PlaneteGravite" type="TextureButton" parent="DefilementNiveaux/SystemeSolaire"]
+layout_mode = 0
+offset_left = 120.0
+offset_top = 464.0
+offset_right = 343.0
+offset_bottom = 608.0
+texture_normal = ExtResource("15_6imjs")
+script = ExtResource("5_hm38a")
+niveau = ExtResource("16_qdyvs")
+
 [node name="BarreMenu" type="Panel" parent="."]
 anchors_preset = 10
 anchor_right = 1.0

+ 11 - 0
godot/composants/mouvements/descente_lente.gd

@@ -0,0 +1,11 @@
+extends Mouvement
+class_name DescenteLente
+## Pour descendre doucement un objet a vitesse constante
+
+
+const vitesse_verticale: float = 5.0 # px / sec
+
+
+## Descente tranquille
+static func bouger(noeud: Node2D, delta: float) -> void:
+	noeud.position.y += vitesse_verticale * delta

+ 7 - 0
godot/composants/mouvements/mouvement_base.gd

@@ -0,0 +1,7 @@
+class_name Mouvement
+## Decrit un mouvement 2D
+
+
+## Fonction a surcharger selon le mouvement
+static func bouger(noeud: Node2D, delta: float) -> void:
+	pass # a surcharger

+ 10 - 0
godot/composants/objets/brique/conteneur_briques.gd

@@ -4,6 +4,9 @@ extends Node2D
 
 signal plus_de_briques
 
+## Doit etre un script de type Mouvement
+@export var mouvement: Script
+
 @onready var nombre_enfants: int = get_children().size()
 
 
@@ -18,6 +21,13 @@ func _ready() -> void:
 			contenant.plus_de_briques.connect(_quand_enfant_detruit)
 
 
+func _physics_process(delta: float) -> void:
+	if mouvement == null:
+		return
+
+	mouvement.bouger(self, delta)
+
+
 func _quand_enfant_detruit() -> void:
 	nombre_enfants -= 1
 	if nombre_enfants <= 0:

+ 121 - 0
godot/exec/niveaux/falling_dart.tscn

@@ -0,0 +1,121 @@
+[gd_scene load_steps=12 format=3 uid="uid://b2578e5i8ubvg"]
+
+[ext_resource type="Texture2D" uid="uid://bkofjydij1plu" path="res://exec/niveaux/fonds/ground03.png" id="1_vbsyh"]
+[ext_resource type="PackedScene" uid="uid://cpo1b44exbbyf" path="res://composants/objets/raquette/raquette.tscn" id="2_7tgxw"]
+[ext_resource type="PackedScene" uid="uid://cux4pm68s7pr8" path="res://composants/objets/lanceur/lanceur.tscn" id="3_03gbi"]
+[ext_resource type="Script" path="res://composants/objets/brique/conteneur_briques.gd" id="4_d6rir"]
+[ext_resource type="PackedScene" uid="uid://brd8yid3l7wgm" path="res://composants/objets/brique/brique.tscn" id="5_7a1ew"]
+[ext_resource type="Script" path="res://composants/mouvements/descente_lente.gd" id="5_bjyla"]
+[ext_resource type="PackedScene" uid="uid://b28d5a4be36qa" path="res://composants/objets/arene/arene.tscn" id="6_ehlvm"]
+[ext_resource type="PackedScene" uid="uid://mj0r0qodppdk" path="res://composants/interface/perdu/perdu.tscn" id="7_llkas"]
+[ext_resource type="PackedScene" uid="uid://byxtc8f6n5o3" path="res://composants/interface/gagne/gagne.tscn" id="8_6oiwq"]
+[ext_resource type="PackedScene" uid="uid://ds3j5rjhys4xf" path="res://composants/interface/stock/stock.tscn" id="9_2ypka"]
+[ext_resource type="AudioStream" uid="uid://1p4lhi3rprps" path="res://ressources/musiques/atelier_godot_level_main_loop.ogg" id="10_6ro2t"]
+
+[node name="FallingDart" type="Node2D"]
+
+[node name="Fond" type="TextureRect" parent="."]
+offset_right = 40.0
+offset_bottom = 40.0
+texture = ExtResource("1_vbsyh")
+
+[node name="Raquette" parent="." instance=ExtResource("2_7tgxw")]
+position = Vector2(210, 400)
+
+[node name="Lanceur" parent="." instance=ExtResource("3_03gbi")]
+position = Vector2(210, 176)
+
+[node name="Briques" type="Node2D" parent="."]
+script = ExtResource("4_d6rir")
+mouvement = ExtResource("5_bjyla")
+
+[node name="Brique1" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(150, 112)
+pouvoir_type = 2
+
+[node name="Brique2" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(180, 112)
+
+[node name="Brique3" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(210, 112)
+
+[node name="Brique4" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(240, 112)
+
+[node name="Brique5" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(120, 128)
+
+[node name="Brique6" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(150, 128)
+
+[node name="Brique7" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(180, 128)
+
+[node name="Brique8" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(210, 128)
+pouvoir_type = 3
+
+[node name="Brique9" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(240, 128)
+
+[node name="Brique10" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(270, 128)
+
+[node name="Brique11" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(150, 144)
+pouvoir_type = 2
+
+[node name="Brique12" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(180, 144)
+
+[node name="Brique13" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(210, 144)
+
+[node name="Brique14" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(240, 144)
+
+[node name="Brique15" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(270, 112)
+pouvoir_type = 2
+
+[node name="Brique16" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(300, 128)
+
+[node name="Brique17" parent="Briques" instance=ExtResource("5_7a1ew")]
+position = Vector2(270, 144)
+pouvoir_type = 2
+
+[node name="Arene" parent="." instance=ExtResource("6_ehlvm")]
+metadata/_edit_lock_ = true
+
+[node name="Message" type="PanelContainer" parent="."]
+visible = false
+offset_left = 20.0
+offset_top = 20.0
+offset_right = 400.0
+offset_bottom = 400.0
+
+[node name="Perdu" parent="Message" instance=ExtResource("7_llkas")]
+visible = false
+layout_mode = 2
+
+[node name="Gagne" parent="Message" instance=ExtResource("8_6oiwq")]
+visible = false
+layout_mode = 2
+
+[node name="Stock" parent="." instance=ExtResource("9_2ypka")]
+offset_bottom = 420.0
+
+[node name="Musique" type="AudioStreamPlayer" parent="."]
+process_mode = 3
+stream = ExtResource("10_6ro2t")
+autoplay = true
+bus = &"Musique"
+
+[connection signal="nb_balles_change" from="Lanceur" to="Stock" method="_quand_nombre_balles_change"]
+[connection signal="partie_perdue" from="Lanceur" to="Message" method="show"]
+[connection signal="partie_perdue" from="Lanceur" to="Message/Perdu" method="show"]
+[connection signal="plus_de_briques" from="Briques" to="Lanceur" method="queue_free"]
+[connection signal="plus_de_briques" from="Briques" to="Message" method="show"]
+[connection signal="plus_de_briques" from="Briques" to="Message/Gagne" method="show"]
+[connection signal="balle_detruite" from="Arene" to="Lanceur" method="_quand_balle_detruite"]