Spikeweed

This commit is contained in:
Фёдор Веселов 2024-09-25 15:14:00 +05:00
commit b543631c86
5 changed files with 151 additions and 1 deletions

View file

@ -1,7 +1,81 @@
[gd_scene load_steps=4 format=3 uid="uid://bdhod5c6o53ha"]
[gd_scene load_steps=10 format=3 uid="uid://bdhod5c6o53ha"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/entities/plants/plant_template.tscn" id="1_vmbvr"]
[ext_resource type="Texture2D" uid="uid://coafh3mjharxo" path="res://assets/sprites/atlases/plants/spikeweed.png" id="2_ffrjr"]
[ext_resource type="Script" path="res://scripts/components/plants/AreaAttack.cs" id="3_hqtbm"]
[ext_resource type="Script" path="res://scripts/components/plants/behaviours/SpikeweedBehaviour.cs" id="3_uhpn7"]
[sub_resource type="Animation" id="Animation_7bhr0"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="Animation" id="Animation_swkxy"]
resource_name = "attack"
length = 0.666675
loop_mode = 1
step = 0.0833333
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.166667, 0.333333, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1),
"update": 1,
"values": [3, 5, 7, 9]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Hitbox")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.166667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"Attack"
}]
}
[sub_resource type="Animation" id="Animation_h2f35"]
resource_name = "idle"
length = 2.50001
loop_mode = 1
step = 0.0833333
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.166667, 0.333333, 0.5, 0.666667, 0.833333, 1, 2, 2.16667, 2.33333),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 2, 4, 6, 8, 10, 12, 14, 16, 18]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_m4h7k"]
_data = {
"RESET": SubResource("Animation_7bhr0"),
"attack": SubResource("Animation_swkxy"),
"idle": SubResource("Animation_h2f35")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_1di76"]
size = Vector2(49, 38)
@ -13,6 +87,25 @@ texture = ExtResource("2_ffrjr")
hframes = 2
vframes = 10
[node name="AnimationPlayer" parent="." index="1"]
libraries = {
"": SubResource("AnimationLibrary_m4h7k")
}
autoplay = "idle"
[node name="Hitbox" parent="." index="2"]
collision_layer = 4
collision_mask = 8
script = ExtResource("3_hqtbm")
_damage = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2(0.5, 9)
shape = SubResource("RectangleShape2D_1di76")
[node name="Behaviour" type="Node" parent="." index="3" node_paths=PackedStringArray("_player")]
script = ExtResource("3_uhpn7")
_player = NodePath("../AnimationPlayer")
[connection signal="area_entered" from="Hitbox" to="Behaviour" method="OnHitboxEntered"]
[connection signal="area_exited" from="Hitbox" to="Behaviour" method="OnHitboxExited"]