Effect system and snowpea
This commit is contained in:
parent
9b89ae98a6
commit
e797918e23
18 changed files with 353 additions and 16 deletions
|
|
@ -17,10 +17,10 @@ shader_parameter/blend_color = Color(1, 1, 1, 1)
|
|||
shader_parameter/amount = null
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hxyad"]
|
||||
size = Vector2(24, 84)
|
||||
size = Vector2(2, 84)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r4ug6"]
|
||||
size = Vector2(20, 48)
|
||||
size = Vector2(16, 48)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_qv5y7"]
|
||||
length = 0.001
|
||||
|
|
@ -202,6 +202,7 @@ parameters/conditions/end_eat = false
|
|||
|
||||
[node name="Mover" type="Node" parent="."]
|
||||
script = ExtResource("4_u5syx")
|
||||
_speedMultiplier = 0.25
|
||||
|
||||
[node name="Behaviour" type="Node" parent="."]
|
||||
script = ExtResource("5_2pvkr")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
[ext_resource type="Script" path="res://scripts/components/plants/RuntimePlantData.cs" id="1_f4h5i"]
|
||||
[ext_resource type="AnimationLibrary" uid="uid://bv1dl1g4dmbho" path="res://resources/animations/plants/peashooter.res" id="2_vs0tj"]
|
||||
[ext_resource type="Script" path="res://scripts/components/plants/Shooter.cs" id="4_sbggp"]
|
||||
[ext_resource type="PackedScene" uid="uid://b2hrv0aqbui7u" path="res://scenes/entities/plants/pea.tscn" id="5_66an8"]
|
||||
[ext_resource type="PackedScene" uid="uid://b2hrv0aqbui7u" path="res://scenes/projectiles/pea.tscn" id="5_66an8"]
|
||||
[ext_resource type="Script" path="res://scripts/components/plants/PlantEyesightLimiter.cs" id="6_0812i"]
|
||||
[ext_resource type="Script" path="res://scripts/components/plants/behaviours/PeashooterBehaviour.cs" id="6_tdkoh"]
|
||||
[ext_resource type="Script" path="res://scripts/components/plants/Eyesight.cs" id="7_fdkt2"]
|
||||
|
|
|
|||
123
scenes/entities/plants/snowpea.tscn
Normal file
123
scenes/entities/plants/snowpea.tscn
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
[gd_scene load_steps=16 format=3 uid="uid://b7innrovtmf5u"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://be1kgukmiu0hs" path="res://scenes/entities/plants/peashooter.tscn" id="1_lp85e"]
|
||||
[ext_resource type="Texture2D" uid="uid://cu0651pvvkmvm" path="res://assets/sprites/atlases/plants/snow_pea.png" id="2_ytrm0"]
|
||||
[ext_resource type="AudioStream" uid="uid://dp6k7xiptn68n" path="res://assets/audio/sfx/pop.mp3" id="3_4fpbe"]
|
||||
[ext_resource type="AnimationLibrary" uid="uid://cke5wmmrvevbs" path="res://resources/animations/plants/snowpea.res" id="4_jvx5y"]
|
||||
[ext_resource type="PackedScene" uid="uid://domeukw4ucmyr" path="res://scenes/projectiles/snowpea_projectile.tscn" id="5_bv86m"]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_pephc"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite: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_ip1gy"]
|
||||
resource_name = "shoot_2"
|
||||
length = 0.666675
|
||||
step = 0.0833333
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Sprite: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),
|
||||
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
|
||||
"update": 1,
|
||||
"values": [5, 7, 9, 11, 13, 15]
|
||||
}
|
||||
tracks/1/type = "method"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Shooter")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0.25),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"values": [{
|
||||
"args": [],
|
||||
"method": &"Shoot"
|
||||
}]
|
||||
}
|
||||
tracks/2/type = "audio"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("AudioStreamPlayer2D")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
"clips": [{
|
||||
"end_offset": 0.0,
|
||||
"start_offset": 0.0,
|
||||
"stream": ExtResource("3_4fpbe")
|
||||
}],
|
||||
"times": PackedFloat32Array(0.25)
|
||||
}
|
||||
tracks/2/use_blend = true
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_djmlc"]
|
||||
_data = {
|
||||
"RESET": SubResource("Animation_pephc"),
|
||||
"shoot_2": SubResource("Animation_ip1gy")
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7tu1y"]
|
||||
animation = &"snowpea/idle"
|
||||
|
||||
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nhra5"]
|
||||
animation = &"snowpea/shoot"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_iyvb5"]
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_63spy"]
|
||||
switch_mode = 2
|
||||
advance_mode = 2
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yr2qp"]
|
||||
advance_mode = 2
|
||||
advance_condition = &"ready"
|
||||
|
||||
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_owox6"]
|
||||
states/Start/position = Vector2(192, 100)
|
||||
states/snowpea_idle/node = SubResource("AnimationNodeAnimation_7tu1y")
|
||||
states/snowpea_idle/position = Vector2(425, 100)
|
||||
states/snowpea_shoot/node = SubResource("AnimationNodeAnimation_nhra5")
|
||||
states/snowpea_shoot/position = Vector2(644, 96)
|
||||
transitions = ["Start", "snowpea_idle", SubResource("AnimationNodeStateMachineTransition_iyvb5"), "snowpea_shoot", "snowpea_idle", SubResource("AnimationNodeStateMachineTransition_63spy"), "snowpea_idle", "snowpea_shoot", SubResource("AnimationNodeStateMachineTransition_yr2qp")]
|
||||
|
||||
[sub_resource type="SegmentShape2D" id="SegmentShape2D_k2110"]
|
||||
resource_local_to_scene = true
|
||||
b = Vector2(5.865, 0)
|
||||
|
||||
[node name="Snowpea" instance=ExtResource("1_lp85e")]
|
||||
|
||||
[node name="Sprite" parent="." index="0"]
|
||||
texture = ExtResource("2_ytrm0")
|
||||
|
||||
[node name="AnimationPlayer" parent="." index="1"]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_djmlc"),
|
||||
"snowpea": ExtResource("4_jvx5y")
|
||||
}
|
||||
|
||||
[node name="AnimationTree" parent="." index="2"]
|
||||
tree_root = SubResource("AnimationNodeStateMachine_owox6")
|
||||
|
||||
[node name="Shooter" parent="." index="4"]
|
||||
_projectile = ExtResource("5_bv86m")
|
||||
|
||||
[node name="CollisionShape2D" parent="Eyesight" index="0"]
|
||||
shape = SubResource("SegmentShape2D_k2110")
|
||||
|
|
@ -22,6 +22,18 @@ tracks/0/keys = {
|
|||
"points": PackedFloat32Array(64, -0.25, 0, 0.5, 7.5, 402, -0.55, -95.5, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.75)
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [true]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_8he0w"]
|
||||
length = 0.001
|
||||
|
|
@ -36,6 +48,18 @@ tracks/0/keys = {
|
|||
"points": PackedFloat32Array(402, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0)
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 1,
|
||||
"values": [false]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_omiwq"]
|
||||
resource_name = "Show"
|
||||
|
|
@ -52,6 +76,18 @@ tracks/0/keys = {
|
|||
"points": PackedFloat32Array(402, -0.25, 0, 1, -336.5, 64, -1, 338.5, 0, 66.5, 64, -0.0571204, 1, 0.19288, 1.5),
|
||||
"times": PackedFloat32Array(0, 1, 1.5)
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath(".:disabled")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"times": PackedFloat32Array(0, 1.5),
|
||||
"transitions": PackedFloat32Array(1, 1),
|
||||
"update": 1,
|
||||
"values": [true, false]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_tguwa"]
|
||||
_data = {
|
||||
|
|
|
|||
30
scenes/projectiles/snowpea_projectile.tscn
Normal file
30
scenes/projectiles/snowpea_projectile.tscn
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://domeukw4ucmyr"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/components/LinearProjectile.cs" id="1_fkydi"]
|
||||
[ext_resource type="Resource" uid="uid://7uj0oe656jfx" path="res://resources/effects/SnowSlow.tres" id="2_txupr"]
|
||||
[ext_resource type="Texture2D" uid="uid://dn4l67snkx5mr" path="res://assets/sprites/plants/snowpea_projectile.tres" id="2_xt8td"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]
|
||||
radius = 6.0
|
||||
|
||||
[node name="Snowpea" type="Area2D"]
|
||||
collision_layer = 4
|
||||
collision_mask = 8
|
||||
script = ExtResource("1_fkydi")
|
||||
_speed = 3.0
|
||||
_damage = 10
|
||||
_impactEffect = ExtResource("2_txupr")
|
||||
|
||||
[node name="Sprite" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("2_xt8td")
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("CircleShape2D_ix1sk")
|
||||
|
||||
[node name="Timer" type="Timer" parent="."]
|
||||
wait_time = 15.0
|
||||
one_shot = true
|
||||
autostart = true
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="OnAreaEntered"]
|
||||
[connection signal="timeout" from="Timer" to="." method="queue_free"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue