Plants animation now supports timescale

This commit is contained in:
Rendo 2025-07-07 23:14:32 +05:00
commit e7a9860a54
18 changed files with 141 additions and 60 deletions

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=14 format=3 uid="uid://qq0cw8xtcoj3"]
[gd_scene load_steps=16 format=3 uid="uid://qq0cw8xtcoj3"]
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_5i0e6"]
[ext_resource type="Texture2D" uid="uid://dff73m8ahamaa" path="res://assets/sprites/atlases/plants/garlic.png" id="2_w2jbi"]
@ -27,6 +27,8 @@ _data = {
&"RESET": SubResource("Animation_k0cex")
}
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_2d3xk"]
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_mdv0r"]
animation = &"garlic/full_hp"
@ -46,12 +48,19 @@ blend_point_2/pos = 0.3
min_space = 0.0
blend_mode = 1
[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_2o7sr"]
graph_offset = Vector2(-397, 76)
nodes/TimeScale/node = SubResource("AnimationNodeTimeScale_2d3xk")
nodes/TimeScale/position = Vector2(100, 160)
nodes/Tree/node = SubResource("AnimationNodeBlendSpace1D_8mvpm")
nodes/Tree/position = Vector2(-160, 200)
node_connections = [&"TimeScale", 0, &"Tree", &"output", 0, &"TimeScale"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_thlvs"]
size = Vector2(32, 29)
[node name="Garlic" instance=ExtResource("1_5i0e6")]
MaxHP = 200.0
_effectImmunities = Array[Resource]([])
[node name="Sprite2D" parent="." index="0"]
texture = ExtResource("2_w2jbi")
@ -65,8 +74,9 @@ libraries = {
}
[node name="AnimationTree" parent="." index="2"]
tree_root = SubResource("AnimationNodeBlendSpace1D_8mvpm")
parameters/blend_position = 1.0
tree_root = SubResource("AnimationNodeBlendTree_2o7sr")
parameters/TimeScale/scale = 1.0
parameters/Tree/blend_position = 1.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"]
position = Vector2(1, 11.5)