mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-16 10:43:46 +00:00
Destroyable chests
This commit is contained in:
parent
f1f542efc4
commit
80e0eda977
14 changed files with 253 additions and 27 deletions
|
|
@ -1,8 +1,15 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://clyyl3jgpfoo7"]
|
||||
[gd_scene load_steps=8 format=3 uid="uid://clyyl3jgpfoo7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cpx2fxtumgmud" path="res://Scenes/Barrel.cs" id="1_gn5xq"]
|
||||
[ext_resource type="Script" uid="uid://ddsqqfx1usc3j" path="res://Scripts/Resources/DamageResistance.cs" id="2_n641h"]
|
||||
[ext_resource type="Texture2D" uid="uid://d2f16ke8c7vwx" path="res://Sprites/Barrel.png" id="3_c3t2t"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_c3bn4"]
|
||||
script = ExtResource("2_n641h")
|
||||
DamageType = 4
|
||||
Attribute = 3
|
||||
metadata/_custom_type_script = "uid://ddsqqfx1usc3j"
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2ewfl"]
|
||||
size = Vector2(11, 14)
|
||||
|
||||
|
|
@ -13,13 +20,14 @@ region = Rect2(16, 0, 16, 16)
|
|||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ss2y0"]
|
||||
size = Vector2(11, 14)
|
||||
|
||||
[node name="Barrel" type="Area2D" groups=["Destroyable"]]
|
||||
[node name="BrokenBarrel" type="Area2D" groups=["Destroyable"]]
|
||||
collision_layer = 64
|
||||
collision_mask = 10
|
||||
script = ExtResource("1_gn5xq")
|
||||
Health = 2.0
|
||||
ExplosionRadius = 0.0
|
||||
ExplosionDamage = 0.0
|
||||
DamageResistances = [SubResource("Resource_c3bn4")]
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
|
|
|
|||
53
Scenes/Props/Chest_Broken.tscn
Normal file
53
Scenes/Props/Chest_Broken.tscn
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
[gd_scene load_steps=7 format=3 uid="uid://b57ep58h4bs3l"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cpx2fxtumgmud" path="res://Scenes/Barrel.cs" id="1_v36o1"]
|
||||
[ext_resource type="Texture2D" uid="uid://qeh4ai8h6sw5" path="res://Sprites/Chest.png" id="2_v36o1"]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2ewfl"]
|
||||
size = Vector2(11, 14)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_v36o1"]
|
||||
atlas = ExtResource("2_v36o1")
|
||||
region = Rect2(32, 0, 16, 16)
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_ejqcg"]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_v36o1")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ss2y0"]
|
||||
size = Vector2(11, 14)
|
||||
|
||||
[node name="Broken Chest" type="Area2D" groups=["Destroyable"]]
|
||||
collision_layer = 64
|
||||
collision_mask = 10
|
||||
script = ExtResource("1_v36o1")
|
||||
Indestructible = true
|
||||
Health = 2.0
|
||||
ExplosionRadius = 0.0
|
||||
ExplosionDamage = 0.0
|
||||
metadata/_edit_group_ = true
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2(0.5, -1)
|
||||
shape = SubResource("RectangleShape2D_2ewfl")
|
||||
|
||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||
sprite_frames = SubResource("SpriteFrames_ejqcg")
|
||||
|
||||
[node name="RigidBody2D" type="RigidBody2D" parent="."]
|
||||
collision_layer = 64
|
||||
collision_mask = 10
|
||||
gravity_scale = 0.0
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBody2D"]
|
||||
visible = false
|
||||
position = Vector2(0.5, -1)
|
||||
shape = SubResource("RectangleShape2D_ss2y0")
|
||||
Loading…
Add table
Add a link
Reference in a new issue