瀏覽代碼

:fire: Enleve les vies multiples des briques

DricomDragon 10 月之前
父節點
當前提交
c359041fb1
共有 3 個文件被更改,包括 12 次插入91 次删除
  1. 12 12
      godot/composants/objets/brique/brique.gd
  2. 0 32
      godot/exec/niveaux/carre_simple.tscn
  3. 0 47
      godot/exec/niveaux/jdll2024.tscn

+ 12 - 12
godot/composants/objets/brique/brique.gd

@@ -7,11 +7,11 @@ signal eclatee
 
 const EclatementScene: PackedScene = preload("res://effets/eclatement_brique/eclatement_effet.tscn")
 const CapsuleScene: PackedScene = preload("res://composants/objets/capsule/capsule.tscn")
-const NOMBRE_DE_VIES_MAX: int = 4
+#const NOMBRE_DE_VIES_MAX: int = 4
 
 ## Le nombre de coups necessaires pour detruire la brique.
-@export_range(1, NOMBRE_DE_VIES_MAX) var nombre_de_vies: int = 1:
-	set = set_nombre_de_vies
+#@export_range(1, NOMBRE_DE_VIES_MAX) var nombre_de_vies: int = 1:
+	#set = set_nombre_de_vies
 @export var pouvoir_type: Pouvoir.Type = Pouvoir.Type.AUCUN:
 	set = set_pouvoir_type
 
@@ -26,15 +26,15 @@ func _ready() -> void:
 
 
 func frapper(nb_degats: int) -> void:
-	nombre_de_vies -= nb_degats
-	if nombre_de_vies <= 0:
-		_mourir()
+	# plusieurs points de vie : perdre de la vie, et peut-être mourir
+	_mourir()
 
 
 func _montrer_nombre_vies() -> void:
-	var nouvelle_couleur: Color = Color.WHITE * (NOMBRE_DE_VIES_MAX - nombre_de_vies) / (NOMBRE_DE_VIES_MAX - 1)
-	nouvelle_couleur.a = 1.0 # rendre opaque
-	set_modulate(nouvelle_couleur)
+	pass # vies briques : supprimer cette ligne et décommenter ci-dessous
+	#var nouvelle_couleur: Color = Color.WHITE * (NOMBRE_DE_VIES_MAX - nombre_de_vies) / (NOMBRE_DE_VIES_MAX - 1)
+	#nouvelle_couleur.a = 1.0 # rendre opaque
+	#set_modulate(nouvelle_couleur)
 
 
 func _montrer_type_pouvoir() -> void:
@@ -83,9 +83,9 @@ func _liberer_capsule() -> void:
 	add_sibling(capsule)
 
 
-func set_nombre_de_vies(nb: int) -> void:
-	nombre_de_vies = nb
-	_montrer_nombre_vies()
+#func set_nombre_de_vies(nb: int) -> void:
+	#nombre_de_vies = nb
+	#_montrer_nombre_vies()
 
 
 func set_pouvoir_type(nouveau_type: Pouvoir.Type) -> void:

+ 0 - 32
godot/exec/niveaux/carre_simple.tscn

@@ -29,22 +29,18 @@ script = ExtResource("3_dsde7")
 
 [node name="Brique1" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
-nombre_de_vies = 2
 
 [node name="Brique2" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(30, 0)
-nombre_de_vies = 2
 
 [node name="Brique3" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(60, 0)
-nombre_de_vies = 2
 
 [node name="Brique4" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(90, 0)
-nombre_de_vies = 2
 
 [node name="Brique5" parent="Briques" instance=ExtResource("2_j0emn")]
 position = Vector2(120, 0)
@@ -73,82 +69,54 @@ pouvoir_type = 1
 [node name="Brique11" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(300, 0)
-nombre_de_vies = 2
 
 [node name="Brique12" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(330, 0)
-nombre_de_vies = 2
 
 [node name="Brique13" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(360, 0)
-nombre_de_vies = 2
 
 [node name="Brique14" parent="Briques" instance=ExtResource("2_j0emn")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(390, 0)
-nombre_de_vies = 2
 
 [node name="Brique15" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(120, 96)
-nombre_de_vies = 4
 
 [node name="Brique16" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(150, 96)
-nombre_de_vies = 4
 
 [node name="Brique17" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(180, 96)
-nombre_de_vies = 4
 
 [node name="Brique18" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(210, 96)
-nombre_de_vies = 4
 
 [node name="Brique19" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(240, 96)
-nombre_de_vies = 4
 
 [node name="Brique20" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(270, 96)
-nombre_de_vies = 4
 
 [node name="Brique35" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(120, 112)
-nombre_de_vies = 4
 
 [node name="Brique36" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(150, 112)
-nombre_de_vies = 4
 
 [node name="Brique37" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(180, 112)
-nombre_de_vies = 4
 
 [node name="Brique38" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(210, 112)
-nombre_de_vies = 4
 
 [node name="Brique39" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(240, 112)
-nombre_de_vies = 4
 
 [node name="Brique40" parent="Briques" instance=ExtResource("2_j0emn")]
-modulate = Color(0, 0, 0, 1)
 position = Vector2(270, 112)
-nombre_de_vies = 4
 
 [node name="Arene" parent="." instance=ExtResource("4_imfht")]
 metadata/_edit_lock_ = true

+ 0 - 47
godot/exec/niveaux/jdll2024.tscn

@@ -68,27 +68,22 @@ position = Vector2(210, 32)
 [node name="Brique16" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(30, 48)
-nombre_de_vies = 3
 
 [node name="Brique17" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(60, 48)
-nombre_de_vies = 3
 
 [node name="Brique18" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(90, 48)
-nombre_de_vies = 3
 
 [node name="Brique19" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(120, 48)
-nombre_de_vies = 3
 
 [node name="Brique20" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(150, 48)
-nombre_de_vies = 3
 
 [node name="Brique21" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(180, 48)
@@ -96,7 +91,6 @@ position = Vector2(180, 48)
 [node name="Brique22" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(240, 48)
-nombre_de_vies = 3
 
 [node name="Brique23" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(270, 48)
@@ -107,7 +101,6 @@ position = Vector2(300, 48)
 [node name="Brique25" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(330, 48)
-nombre_de_vies = 3
 
 [node name="Brique26" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(360, 48)
@@ -121,7 +114,6 @@ position = Vector2(30, 64)
 [node name="Brique31" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(60, 64)
-nombre_de_vies = 3
 
 [node name="Brique32" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(90, 64)
@@ -129,7 +121,6 @@ position = Vector2(90, 64)
 [node name="Brique33" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(120, 64)
-nombre_de_vies = 3
 
 [node name="Brique34" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(150, 64)
@@ -137,12 +128,10 @@ position = Vector2(150, 64)
 [node name="Brique35" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(180, 64)
-nombre_de_vies = 3
 
 [node name="Brique36" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(240, 64)
-nombre_de_vies = 3
 
 [node name="Brique37" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(270, 64)
@@ -153,7 +142,6 @@ position = Vector2(300, 64)
 [node name="Brique39" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(330, 64)
-nombre_de_vies = 3
 
 [node name="Brique40" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(360, 64)
@@ -167,7 +155,6 @@ position = Vector2(30, 80)
 [node name="Brique45" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(60, 80)
-nombre_de_vies = 3
 
 [node name="Brique46" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(90, 80)
@@ -175,7 +162,6 @@ position = Vector2(90, 80)
 [node name="Brique47" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(120, 80)
-nombre_de_vies = 3
 
 [node name="Brique48" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(150, 80)
@@ -183,12 +169,10 @@ position = Vector2(150, 80)
 [node name="Brique49" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(180, 80)
-nombre_de_vies = 3
 
 [node name="Brique50" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(240, 80)
-nombre_de_vies = 3
 
 [node name="Brique51" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(270, 80)
@@ -199,7 +183,6 @@ position = Vector2(300, 80)
 [node name="Brique53" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(330, 80)
-nombre_de_vies = 3
 
 [node name="Brique54" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(360, 80)
@@ -213,7 +196,6 @@ position = Vector2(30, 96)
 [node name="Brique59" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(60, 96)
-nombre_de_vies = 3
 
 [node name="Brique60" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(90, 96)
@@ -221,7 +203,6 @@ position = Vector2(90, 96)
 [node name="Brique61" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(120, 96)
-nombre_de_vies = 3
 
 [node name="Brique62" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(150, 96)
@@ -229,12 +210,10 @@ position = Vector2(150, 96)
 [node name="Brique63" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(180, 96)
-nombre_de_vies = 3
 
 [node name="Brique64" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(240, 96)
-nombre_de_vies = 3
 
 [node name="Brique65" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(270, 96)
@@ -245,7 +224,6 @@ position = Vector2(300, 96)
 [node name="Brique67" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(330, 96)
-nombre_de_vies = 3
 
 [node name="Brique68" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(360, 96)
@@ -259,7 +237,6 @@ position = Vector2(30, 112)
 [node name="Brique73" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(60, 112)
-nombre_de_vies = 3
 
 [node name="Brique74" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(90, 112)
@@ -267,7 +244,6 @@ position = Vector2(90, 112)
 [node name="Brique75" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(120, 112)
-nombre_de_vies = 3
 
 [node name="Brique76" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(150, 112)
@@ -275,12 +251,10 @@ position = Vector2(150, 112)
 [node name="Brique77" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(180, 112)
-nombre_de_vies = 3
 
 [node name="Brique78" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(240, 112)
-nombre_de_vies = 3
 
 [node name="Brique79" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(270, 112)
@@ -291,7 +265,6 @@ position = Vector2(300, 112)
 [node name="Brique81" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(330, 112)
-nombre_de_vies = 3
 
 [node name="Brique82" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(360, 112)
@@ -302,12 +275,10 @@ position = Vector2(210, 112)
 [node name="Brique86" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(30, 128)
-nombre_de_vies = 3
 
 [node name="Brique87" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(60, 128)
-nombre_de_vies = 3
 
 [node name="Brique88" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(90, 128)
@@ -315,12 +286,10 @@ position = Vector2(90, 128)
 [node name="Brique89" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(120, 128)
-nombre_de_vies = 3
 
 [node name="Brique90" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(150, 128)
-nombre_de_vies = 3
 
 [node name="Brique91" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(180, 128)
@@ -328,12 +297,10 @@ position = Vector2(180, 128)
 [node name="Brique92" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(240, 128)
-nombre_de_vies = 3
 
 [node name="Brique93" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(270, 128)
-nombre_de_vies = 3
 
 [node name="Brique94" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(300, 128)
@@ -341,12 +308,10 @@ position = Vector2(300, 128)
 [node name="Brique95" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(330, 128)
-nombre_de_vies = 3
 
 [node name="Brique96" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.333333, 0.333333, 0.333333, 1)
 position = Vector2(360, 128)
-nombre_de_vies = 3
 
 [node name="Brique97" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(210, 128)
@@ -392,7 +357,6 @@ position = Vector2(210, 144)
 [node name="Brique112" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(30, 160)
-nombre_de_vies = 2
 
 [node name="Brique124" parent="Briques" instance=ExtResource("4_upd8n")]
 position = Vector2(150, 272)
@@ -421,57 +385,46 @@ pouvoir_type = 1
 [node name="Brique113" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(60, 160)
-nombre_de_vies = 2
 
 [node name="Brique114" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(90, 160)
-nombre_de_vies = 2
 
 [node name="Brique115" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(120, 160)
-nombre_de_vies = 2
 
 [node name="Brique116" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(150, 160)
-nombre_de_vies = 2
 
 [node name="Brique117" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(180, 160)
-nombre_de_vies = 2
 
 [node name="Brique118" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(240, 160)
-nombre_de_vies = 2
 
 [node name="Brique119" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(270, 160)
-nombre_de_vies = 2
 
 [node name="Brique120" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(300, 160)
-nombre_de_vies = 2
 
 [node name="Brique121" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(330, 160)
-nombre_de_vies = 2
 
 [node name="Brique122" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(360, 160)
-nombre_de_vies = 2
 
 [node name="Brique123" parent="Briques" instance=ExtResource("4_upd8n")]
 modulate = Color(0.666667, 0.666667, 0.666667, 1)
 position = Vector2(210, 160)
-nombre_de_vies = 2
 
 [node name="Arene" parent="." instance=ExtResource("5_j3mb3")]
 metadata/_edit_lock_ = true