Exploding barrels

This commit is contained in:
MaddoScientisto 2024-06-09 00:34:36 +02:00
commit 71eeb3f1d1
12 changed files with 132 additions and 20 deletions

View file

@ -1,5 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://bj28qiai2x2ar"]
[gd_scene load_steps=6 format=3 uid="uid://bj28qiai2x2ar"]
[ext_resource type="Script" path="res://Scenes/Barrel.cs" id="1_avwdx"]
[ext_resource type="Texture2D" uid="uid://d2f16ke8c7vwx" path="res://Sprites/Barrel.png" id="1_e66t6"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2ewfl"]
@ -9,9 +10,13 @@ size = Vector2(11, 14)
atlas = ExtResource("1_e66t6")
region = Rect2(0, 0, 16, 16)
[node name="Barrel" type="Area2D"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ss2y0"]
size = Vector2(11, 14)
[node name="Barrel" type="Area2D" groups=["Destroyable"]]
collision_layer = 64
collision_mask = 10
script = ExtResource("1_avwdx")
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
@ -21,3 +26,13 @@ shape = SubResource("RectangleShape2D_2ewfl")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = SubResource("AtlasTexture_v7gy8")
[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")