Animations improved
This commit is contained in:
parent
c89d93cf24
commit
ad18793543
35 changed files with 430 additions and 465 deletions
|
|
@ -1,91 +1,55 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://b5x35v3w2u8dx"]
|
||||
[gd_scene load_steps=20 format=3 uid="uid://b5x35v3w2u8dx"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_dj7ul"]
|
||||
[ext_resource type="Texture2D" uid="uid://c77o6ba0mw7a3" path="res://assets/sprites/atlases/plants/potato_mine.png" id="2_sneas"]
|
||||
[ext_resource type="Script" path="res://scripts/components/plants/ExplosionComponent.cs" id="3_2hd5y"]
|
||||
[ext_resource type="AnimationLibrary" uid="uid://bjlbdvr6f0r7e" path="res://resources/animations/plants/potato_mine.res" id="3_7tqmj"]
|
||||
[ext_resource type="Script" path="res://scripts/components/plants/behaviours/PotatomineBehaviour.cs" id="4_twx65"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_lpsw3"]
|
||||
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": [1]
|
||||
}
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6uutc"]
|
||||
animation = &"potato_mine/explode"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_n8bxp"]
|
||||
resource_name = "idle_primed"
|
||||
length = 2.00001
|
||||
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.333333, 0.666667, 1, 1.33333, 1.66667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [0, 3, 6, 9, 12, 15]
|
||||
}
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_qdgub"]
|
||||
animation = &"potato_mine/idle_primed"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_vmabh"]
|
||||
resource_name = "idle_unprimed"
|
||||
length = 4.00001
|
||||
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, 3.75, 3.91667),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [1, 7, 1]
|
||||
}
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_cohta"]
|
||||
animation = &"potato_mine/idle_unprimed"
|
||||
|
||||
[sub_resource type="Animation" id="Animation_ekg7n"]
|
||||
resource_name = "prime"
|
||||
length = 0.583342
|
||||
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.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [2, 5, 8, 11, 14, 17, 20]
|
||||
}
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_j42h1"]
|
||||
animation = &"potato_mine/prime"
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_4kofx"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_lpsw3"),
|
||||
"idle_primed": SubResource("Animation_n8bxp"),
|
||||
"idle_unprimed": SubResource("Animation_vmabh"),
|
||||
"prime": SubResource("Animation_ekg7n")
|
||||
}
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ttnxb"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qfqko"]
|
||||
size = Vector2(15, 27)
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8nvnf"]
|
||||
advance_mode = 2
|
||||
advance_condition = &"primed"
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ti2g4"]
|
||||
size = Vector2(34, 19)
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_q0arb"]
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_dikhn"]
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_lqd1d"]
|
||||
advance_mode = 2
|
||||
advance_condition = &"explode"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_nfn7b"]
|
||||
states/End/position = Vector2(1104, 75.168)
|
||||
states/Start/position = Vector2(46, 130)
|
||||
states/potato_mine_explode/node = SubResource("AnimationNodeAnimation_6uutc")
|
||||
states/potato_mine_explode/position = Vector2(934.656, 75.168)
|
||||
states/potato_mine_idle_primed/node = SubResource("AnimationNodeAnimation_qdgub")
|
||||
states/potato_mine_idle_primed/position = Vector2(703.656, 75.168)
|
||||
states/potato_mine_idle_unprimed/node = SubResource("AnimationNodeAnimation_cohta")
|
||||
states/potato_mine_idle_unprimed/position = Vector2(271.656, 75.168)
|
||||
states/potato_mine_prime/node = SubResource("AnimationNodeAnimation_j42h1")
|
||||
states/potato_mine_prime/position = Vector2(490.656, 75.168)
|
||||
transitions = ["Start", "potato_mine_idle_unprimed", SubResource("AnimationNodeStateMachineTransition_ttnxb"), "potato_mine_idle_unprimed", "potato_mine_prime", SubResource("AnimationNodeStateMachineTransition_8nvnf"), "potato_mine_explode", "End", SubResource("AnimationNodeStateMachineTransition_q0arb"), "potato_mine_prime", "potato_mine_idle_primed", SubResource("AnimationNodeStateMachineTransition_dikhn"), "potato_mine_idle_primed", "potato_mine_explode", SubResource("AnimationNodeStateMachineTransition_lqd1d")]
|
||||
graph_offset = Vector2(-16.3438, -67.832)
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_v0g5b"]
|
||||
radius = 19.0263
|
||||
|
|
@ -93,29 +57,30 @@ radius = 19.0263
|
|||
[sub_resource type="CircleShape2D" id="CircleShape2D_wvns6"]
|
||||
radius = 19.0263
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qfqko"]
|
||||
size = Vector2(15, 27)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ti2g4"]
|
||||
size = Vector2(34, 19)
|
||||
|
||||
[node name="Potato mine" instance=ExtResource("1_dj7ul")]
|
||||
_maxHP = 100
|
||||
|
||||
[node name="Sprite2D" parent="." index="0"]
|
||||
texture = ExtResource("2_sneas")
|
||||
hframes = 3
|
||||
vframes = 7
|
||||
frame = 1
|
||||
hframes = 7
|
||||
vframes = 4
|
||||
|
||||
[node name="AnimationPlayer" parent="." index="1"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_4kofx")
|
||||
"potato_mine": ExtResource("3_7tqmj")
|
||||
}
|
||||
autoplay = "idle_unprimed"
|
||||
|
||||
[node name="Unprimed" type="CollisionShape2D" parent="Hitbox" index="0"]
|
||||
position = Vector2(-0.5, 14.5)
|
||||
shape = SubResource("RectangleShape2D_qfqko")
|
||||
|
||||
[node name="Primed" type="CollisionShape2D" parent="Hitbox" index="1"]
|
||||
position = Vector2(0, 16.5)
|
||||
shape = SubResource("RectangleShape2D_ti2g4")
|
||||
disabled = true
|
||||
[node name="AnimationTree" parent="." index="2"]
|
||||
tree_root = SubResource("AnimationNodeStateMachine_nfn7b")
|
||||
parameters/conditions/explode = false
|
||||
parameters/conditions/primed = false
|
||||
|
||||
[node name="Detectionbox" type="Area2D" parent="." index="3"]
|
||||
collision_layer = 0
|
||||
|
|
@ -140,17 +105,20 @@ wait_time = 15.0
|
|||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[node name="Behaviour" type="Node" parent="." index="6" node_paths=PackedStringArray("_player", "_hitbox", "_unprimedShape", "_primedShape")]
|
||||
[node name="Behaviour" type="Node" parent="." index="6" node_paths=PackedStringArray("_hitbox", "_unprimedShape", "_primedShape")]
|
||||
script = ExtResource("4_twx65")
|
||||
_player = NodePath("../AnimationPlayer")
|
||||
_hitbox = NodePath("../Hitbox")
|
||||
_unprimedShape = NodePath("../Hitbox/Unprimed")
|
||||
_primedShape = NodePath("../Hitbox/Primed")
|
||||
|
||||
[node name="ExplosionTimer" type="Timer" parent="Behaviour" index="0"]
|
||||
wait_time = 0.333
|
||||
one_shot = true
|
||||
[node name="Unprimed" type="CollisionShape2D" parent="Hitbox" index="0"]
|
||||
position = Vector2(-0.5, 14.5)
|
||||
shape = SubResource("RectangleShape2D_qfqko")
|
||||
|
||||
[node name="Primed" type="CollisionShape2D" parent="Hitbox" index="1"]
|
||||
position = Vector2(0, 16.5)
|
||||
shape = SubResource("RectangleShape2D_ti2g4")
|
||||
disabled = true
|
||||
|
||||
[connection signal="area_entered" from="Detectionbox" to="Behaviour" method="OnAreaEntered"]
|
||||
[connection signal="timeout" from="PrimeTimer" to="Behaviour" method="Prime"]
|
||||
[connection signal="timeout" from="Behaviour/ExplosionTimer" to="ExplosionBox" method="Explode"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue