فهرست منبع

Ajoute l'effet d'eclatement de la brique

DricomDragon 11 ماه پیش
والد
کامیت
b11af40084

+ 6 - 0
godot/composants/objets/brique/brique.gd

@@ -2,5 +2,11 @@ class_name Brique
 extends StaticBody2D
 
 
+const EclatementScene: PackedScene = preload("res://effets/eclatement_brique/eclatement_brique.tscn")
+
+
 func frapper(nb: int) -> void:
 	queue_free()
+	var effet_eclatement: Node2D = EclatementScene.instantiate()
+	effet_eclatement.position = self.position
+	add_sibling(effet_eclatement)

+ 10 - 0
godot/effets/eclatement_brique/eclatement_brique.gd

@@ -0,0 +1,10 @@
+extends AnimatedSprite2D
+
+
+func _ready() -> void:
+	play("eclate")
+	animation_finished.connect(_end)
+
+
+func _end() -> void:
+	queue_free()

+ 191 - 0
godot/effets/eclatement_brique/eclatement_brique.tscn

@@ -0,0 +1,191 @@
+[gd_scene load_steps=28 format=3 uid="uid://766ld28y11ur"]
+
+[ext_resource type="Texture2D" uid="uid://dl4u6xp80b3pl" path="res://effets/eclatement_brique/sprite.png" id="1_upd2n"]
+[ext_resource type="Script" path="res://effets/eclatement_brique/eclatement_brique.gd" id="2_xew3s"]
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_k8omh"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 0, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_axaps"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 44, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_r2k7b"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 88, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_1vipe"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 132, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_3b7g4"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 176, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_al584"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 220, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_4fl5y"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 264, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_u8am2"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 308, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_hfto7"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 352, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_fpyx8"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 396, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_o1mv6"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 440, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_1ni3y"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 484, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_6rhyi"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 528, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_p6ild"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 572, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_saikk"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 616, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_0gepx"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 660, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_bvtoy"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 704, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_idyqk"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 748, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_arijn"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 792, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_lcw4i"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 836, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_toy66"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 880, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_n5cob"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 924, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_rpyjl"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 968, 64, 44)
+
+[sub_resource type="AtlasTexture" id="AtlasTexture_s5tlm"]
+atlas = ExtResource("1_upd2n")
+region = Rect2(0, 1012, 64, 44)
+
+[sub_resource type="SpriteFrames" id="SpriteFrames_dmg24"]
+animations = [{
+"frames": [{
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_k8omh")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_axaps")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_r2k7b")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_1vipe")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_3b7g4")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_al584")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_4fl5y")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_u8am2")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_hfto7")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_fpyx8")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_o1mv6")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_1ni3y")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_6rhyi")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_p6ild")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_saikk")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_0gepx")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_bvtoy")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_idyqk")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_arijn")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_lcw4i")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_toy66")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_n5cob")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_rpyjl")
+}, {
+"duration": 1.0,
+"texture": SubResource("AtlasTexture_s5tlm")
+}],
+"loop": false,
+"name": &"eclate",
+"speed": 24.0
+}]
+
+[node name="EclatementBrique" type="Node2D"]
+
+[node name="Animation" type="AnimatedSprite2D" parent="."]
+position = Vector2(-15, -8)
+sprite_frames = SubResource("SpriteFrames_dmg24")
+animation = &"eclate"
+frame = 23
+frame_progress = 1.0
+centered = false
+script = ExtResource("2_xew3s")