diff --git a/assets/animations/zombies/basic.res b/assets/animations/zombies/basic.res index e02f886..80ec481 100644 Binary files a/assets/animations/zombies/basic.res and b/assets/animations/zombies/basic.res differ diff --git a/assets/animations/zombies/basic_zombie_anim.res b/assets/animations/zombies/basic_zombie_anim.res index 6ea7db3..7911eac 100644 Binary files a/assets/animations/zombies/basic_zombie_anim.res and b/assets/animations/zombies/basic_zombie_anim.res differ diff --git a/assets/plants/Aloe.tres b/assets/plants/Aloe.tres deleted file mode 100644 index d2229a7..0000000 --- a/assets/plants/Aloe.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bf7vjtufjc8kt"] - -[ext_resource type="Texture2D" uid="uid://d4btl7vqi4v0q" path="res://assets/sprites/plants/aloe.tres" id="1_t4137"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_vw2kg"] -[ext_resource type="PackedScene" uid="uid://bw1w8jp0yeypy" path="res://scenes/entities/plants/aloe.tscn" id="2_6a4ia"] - -[resource] -script = ExtResource("1_vw2kg") -Layer = 1 -DontRegister = false -NameKey = "aloe" -DescriptionKey = "aloe_desc" -Cost = 75.0 -Scene = ExtResource("2_6a4ia") -ReloadTime = 15.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_t4137") -Order = 6 diff --git a/assets/plants/Cucumber.tres b/assets/plants/Cucumber.tres deleted file mode 100644 index 3dca246..0000000 --- a/assets/plants/Cucumber.tres +++ /dev/null @@ -1,23 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=5 format=3 uid="uid://ciewunnfalrbb"] - -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_jrx81"] -[ext_resource type="Texture2D" uid="uid://bt76iudw2qgnv" path="res://assets/sprites/atlases/plants/cumbucer.png" id="1_tdg4d"] -[ext_resource type="PackedScene" uid="uid://cjoyh54cpjla7" path="res://scenes/entities/plants/cucumber.tscn" id="2_0mr6r"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_3gogt"] -atlas = ExtResource("1_tdg4d") -region = Rect2(2, 1, 41, 65) - -[resource] -script = ExtResource("1_jrx81") -Layer = 1 -DontRegister = false -NameKey = "cucumber" -DescriptionKey = "cucumber_desc" -Cost = 75.0 -Scene = ExtResource("2_0mr6r") -ReloadTime = 5.0 -ReloadProgress = 0.0 -Preview = SubResource("AtlasTexture_3gogt") -Order = 8 -metadata/_custom_type_script = "uid://cyenlko1knygw" diff --git a/assets/plants/Garlic.tres b/assets/plants/Garlic.tres deleted file mode 100644 index d821c21..0000000 --- a/assets/plants/Garlic.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://btkkaow4tyw55"] - -[ext_resource type="Texture2D" uid="uid://m8e84blnx7yu" path="res://assets/sprites/plants/garlic.tres" id="1_datic"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_e15gf"] -[ext_resource type="PackedScene" uid="uid://qq0cw8xtcoj3" path="res://scenes/entities/plants/garlic.tscn" id="2_81n0p"] - -[resource] -script = ExtResource("1_e15gf") -Layer = 1 -DontRegister = false -NameKey = "garlic" -DescriptionKey = "garlic_desc" -Cost = 50.0 -Scene = ExtResource("2_81n0p") -ReloadTime = 7.5 -ReloadProgress = 0.0 -Preview = ExtResource("1_datic") -Order = 7 diff --git a/assets/plants/Nerdus.tres b/assets/plants/Nerdus.tres deleted file mode 100644 index 90aeb8d..0000000 --- a/assets/plants/Nerdus.tres +++ /dev/null @@ -1,23 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=5 format=3 uid="uid://8edvnmwu4tyn"] - -[ext_resource type="Texture2D" uid="uid://b06e8xhdy77d1" path="res://assets/sprites/atlases/plants/nerdus.png" id="1_of51r"] -[ext_resource type="PackedScene" uid="uid://k5aj2slxar7w" path="res://scenes/entities/plants/nerdus.tscn" id="2_0i6qf"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_30qd0"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_ivp5w"] -atlas = ExtResource("1_of51r") -region = Rect2(477, 9, 60, 59) - -[resource] -script = ExtResource("3_30qd0") -Layer = 1 -DontRegister = false -NameKey = "nerdus" -DescriptionKey = "nerdus_desc" -Cost = 125.0 -Scene = ExtResource("2_0i6qf") -ReloadTime = 10.0 -ReloadProgress = 0.0 -Preview = SubResource("AtlasTexture_ivp5w") -Order = 10 -metadata/_custom_type_script = "uid://cyenlko1knygw" diff --git a/assets/plants/Peashooter.tres b/assets/plants/Peashooter.tres deleted file mode 100644 index cf3a204..0000000 --- a/assets/plants/Peashooter.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://c8rr1dc7mjr3d"] - -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_amvh8"] -[ext_resource type="Texture2D" uid="uid://ot1n4nval86w" path="res://assets/sprites/plants/peashooter.tres" id="1_rnq6r"] -[ext_resource type="PackedScene" uid="uid://dy41q1kxray5t" path="res://scenes/entities/plants/peashooter.tscn" id="1_rqf2x"] - -[resource] -script = ExtResource("1_amvh8") -Layer = 1 -DontRegister = false -NameKey = "peashooter" -DescriptionKey = "peashooter_desc" -Cost = 75.0 -Scene = ExtResource("1_rqf2x") -ReloadTime = 5.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_rnq6r") -Order = 0 diff --git a/assets/plants/PotatoMine.tres b/assets/plants/PotatoMine.tres deleted file mode 100644 index 825de86..0000000 --- a/assets/plants/PotatoMine.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bu25xgjd68gv8"] - -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_33j6b"] -[ext_resource type="Texture2D" uid="uid://bhmnt3x5aj1l8" path="res://assets/sprites/plants/potatomine.tres" id="1_xk2pg"] -[ext_resource type="PackedScene" uid="uid://b5x35v3w2u8dx" path="res://scenes/entities/plants/potato_mine.tscn" id="2_ig2ti"] - -[resource] -script = ExtResource("1_33j6b") -Layer = 1 -DontRegister = false -NameKey = "potatomine" -DescriptionKey = "potatomine_desc" -Cost = 25.0 -Scene = ExtResource("2_ig2ti") -ReloadTime = 25.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_xk2pg") -Order = 3 diff --git a/assets/plants/Repeater.tres b/assets/plants/Repeater.tres deleted file mode 100644 index 85f96ca..0000000 --- a/assets/plants/Repeater.tres +++ /dev/null @@ -1,35 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=10 format=3 uid="uid://b4r1687hg0rf5"] - -[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_6km43"] -[ext_resource type="Texture2D" uid="uid://dhf2opi0brx23" path="res://assets/sprites/gui/almanach/premium_field.tres" id="1_ormja"] -[ext_resource type="PackedScene" uid="uid://bb4ya5qx224ca" path="res://scenes/entities/plants/repeater.tscn" id="2_6km43"] -[ext_resource type="Texture2D" uid="uid://31jc2e7dijas" path="res://assets/sprites/gui/PremiumPlantCard.tres" id="2_8djti"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_e606l"] -[ext_resource type="Script" uid="uid://3m7xks3xq3hl" path="res://scripts/gui/seedpackets/CustomSeedpacketFrame.cs" id="3_qnhmj"] - -[sub_resource type="LabelSettings" id="LabelSettings_2f3e1"] - -[sub_resource type="Resource" id="Resource_87lkl"] -script = ExtResource("3_qnhmj") -frame = ExtResource("2_8djti") -font = SubResource("LabelSettings_2f3e1") -almanachField = ExtResource("1_ormja") -metadata/_custom_type_script = "uid://3m7xks3xq3hl" - -[sub_resource type="AtlasTexture" id="AtlasTexture_qnsfo"] -atlas = ExtResource("1_6km43") -region = Rect2(604, 241, 45, 51) - -[resource] -script = ExtResource("3_e606l") -Layer = 1 -DontRegister = false -NameKey = "repeater" -DescriptionKey = "repeater_desc" -Cost = 175.0 -Scene = ExtResource("2_6km43") -ReloadTime = 5.0 -ReloadProgress = 0.0 -Preview = SubResource("AtlasTexture_qnsfo") -CustomFrame = SubResource("Resource_87lkl") -Order = 12 diff --git a/assets/plants/Snipach.tres b/assets/plants/Snipach.tres deleted file mode 100644 index 501a276..0000000 --- a/assets/plants/Snipach.tres +++ /dev/null @@ -1,23 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=5 format=3 uid="uid://drb8nk0i3oyyl"] - -[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_1eecn"] -[ext_resource type="PackedScene" uid="uid://bmk41n57j7hgx" path="res://scenes/entities/plants/snipach.tscn" id="1_h5ln5"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_u5a4p"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_dgfdr"] -atlas = ExtResource("1_1eecn") -region = Rect2(525, 241, 79, 72) - -[resource] -script = ExtResource("1_u5a4p") -Layer = 1 -DontRegister = false -NameKey = "snipach" -DescriptionKey = "snipach_desc" -Cost = 400.0 -Scene = ExtResource("1_h5ln5") -ReloadTime = 7.5 -ReloadProgress = 0.0 -Preview = SubResource("AtlasTexture_dgfdr") -Order = 11 -metadata/_custom_type_script = "uid://cyenlko1knygw" diff --git a/assets/plants/Snowpea.tres b/assets/plants/Snowpea.tres deleted file mode 100644 index 13bc7d0..0000000 --- a/assets/plants/Snowpea.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://duflq3eexs6m"] - -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_0cpi0"] -[ext_resource type="Texture2D" uid="uid://cu7h8bot6jlug" path="res://assets/sprites/plants/snowpea.tres" id="1_7fyy2"] -[ext_resource type="PackedScene" uid="uid://b7innrovtmf5u" path="res://scenes/entities/plants/snowpea.tscn" id="2_k47h0"] - -[resource] -script = ExtResource("1_0cpi0") -Layer = 1 -DontRegister = false -NameKey = "snowpea" -DescriptionKey = "snowpea_desc" -Cost = 175.0 -Scene = ExtResource("2_k47h0") -ReloadTime = 5.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_7fyy2") -Order = 5 diff --git a/assets/plants/Spikeweed.tres b/assets/plants/Spikeweed.tres deleted file mode 100644 index 4502b23..0000000 --- a/assets/plants/Spikeweed.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://cas11tg6chiu4"] - -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_0bymo"] -[ext_resource type="Texture2D" uid="uid://baqfahxkcvfe1" path="res://assets/sprites/plants/Spikeweed.tres" id="1_2ol2i"] -[ext_resource type="PackedScene" uid="uid://bdhod5c6o53ha" path="res://scenes/entities/plants/spikeweed.tscn" id="2_iv8de"] - -[resource] -script = ExtResource("1_0bymo") -Layer = 1 -DontRegister = false -NameKey = "spikeweed" -DescriptionKey = "spikeweed_desc" -Cost = 100.0 -Scene = ExtResource("2_iv8de") -ReloadTime = 5.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_2ol2i") -Order = 4 diff --git a/assets/plants/Sunflower.tres b/assets/plants/Sunflower.tres deleted file mode 100644 index 9c2c30f..0000000 --- a/assets/plants/Sunflower.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://drm42f48urvc4"] - -[ext_resource type="Texture2D" uid="uid://iw75j816gbc" path="res://assets/sprites/plants/sunflower.tres" id="1_8rd5i"] -[ext_resource type="PackedScene" uid="uid://bg7lomiorxo2c" path="res://scenes/entities/plants/sunflower.tscn" id="2_gcyr5"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_vt4jc"] - -[resource] -script = ExtResource("3_vt4jc") -Layer = 1 -DontRegister = false -NameKey = "sunflower" -DescriptionKey = "sunflower_desc" -Cost = 50.0 -Scene = ExtResource("2_gcyr5") -ReloadTime = 5.0 -ReloadProgress = 1.0 -Preview = ExtResource("1_8rd5i") -Order = 1 diff --git a/assets/plants/Threepeater.tres b/assets/plants/Threepeater.tres deleted file mode 100644 index d6348e9..0000000 --- a/assets/plants/Threepeater.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bnhwg57euiyf5"] - -[ext_resource type="Texture2D" uid="uid://8se1nscal0em" path="res://assets/sprites/plants/threepeater.tres" id="1_hinp6"] -[ext_resource type="PackedScene" uid="uid://eegv1qihfv2q" path="res://scenes/entities/plants/threepeater.tscn" id="2_uqpu0"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="3_3lugi"] - -[resource] -script = ExtResource("3_3lugi") -Layer = 1 -DontRegister = false -NameKey = "threepeater" -DescriptionKey = "threepeater_desc" -Cost = 275.0 -Scene = ExtResource("2_uqpu0") -ReloadTime = 5.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_hinp6") -Order = 9 diff --git a/assets/plants/Wallnut.tres b/assets/plants/Wallnut.tres deleted file mode 100644 index dc3ab26..0000000 --- a/assets/plants/Wallnut.tres +++ /dev/null @@ -1,18 +0,0 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://c2e2yj7rgoswi"] - -[ext_resource type="Texture2D" uid="uid://g2oppl54efja" path="res://assets/sprites/plants/Wallnut.tres" id="1_2akap"] -[ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/entities/PlantResource.cs" id="1_27l0t"] -[ext_resource type="PackedScene" uid="uid://bq7imkpr2yqyr" path="res://scenes/entities/plants/wallnut.tscn" id="2_rkn3h"] - -[resource] -script = ExtResource("1_27l0t") -Layer = 1 -DontRegister = false -NameKey = "wallnut" -DescriptionKey = "wallnut_desc" -Cost = 50.0 -Scene = ExtResource("2_rkn3h") -ReloadTime = 20.0 -ReloadProgress = 0.0 -Preview = ExtResource("1_2akap") -Order = 2 diff --git a/assets/sprites/zombie.tres b/assets/sprites/zombie.tres index b1a93a6..e532cad 100644 --- a/assets/sprites/zombie.tres +++ b/assets/sprites/zombie.tres @@ -1,7 +1,7 @@ [gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bwwbkybryi6k0"] -[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_f3kba"] +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_g1iew"] [resource] -atlas = ExtResource("1_f3kba") +atlas = ExtResource("1_g1iew") region = Rect2(129, 104, 45, 88) diff --git a/project.godot b/project.godot index bf1e982..8d3ad66 100644 --- a/project.godot +++ b/project.godot @@ -181,6 +181,15 @@ cursor_right={ locale/translations=PackedStringArray("res://translations/plants.en.translation", "res://translations/plants.ru.translation", "res://translations/zombies.en.translation", "res://translations/zombies.ru.translation", "res://translations/gui.en.translation", "res://translations/gui.ru.translation", "res://translations/rewards.en.translation", "res://translations/rewards.ru.translation") +[layer_names] + +2d_physics/layer_1="Structures" +2d_physics/layer_2="Plants" +2d_physics/layer_3="Zombies" +2d_physics/layer_4="Projectiles" + [rendering] textures/canvas_textures/default_texture_filter=0 +renderer/rendering_method="gl_compatibility" +renderer/rendering_method.mobile="gl_compatibility" diff --git a/resources/plants/peashooter.tres b/resources/plants/peashooter.tres index abf2879..d448189 100644 --- a/resources/plants/peashooter.tres +++ b/resources/plants/peashooter.tres @@ -1,7 +1,8 @@ -[gd_resource type="Resource" script_class="SeedpacketResource" load_steps=3 format=3 uid="uid://bf8u3nwwn5e1d"] +[gd_resource type="Resource" script_class="SeedpacketResource" load_steps=4 format=3 uid="uid://bf8u3nwwn5e1d"] [ext_resource type="Texture2D" uid="uid://ot1n4nval86w" path="res://assets/sprites/plants/peashooter.tres" id="1_o0b0s"] [ext_resource type="Script" uid="uid://dtjdfji87kybn" path="res://scripts/resources/entity_resource.gd" id="2_jwk2v"] +[ext_resource type="PackedScene" uid="uid://bxs34adppsh5e" path="res://scenes/plants/peashooter.tscn" id="2_n78qv"] [resource] script = ExtResource("2_jwk2v") @@ -9,5 +10,6 @@ preview = ExtResource("1_o0b0s") cost = 75.0 recharge_time = 5.0 initial_recharge_percent = 1.0 +scene = ExtResource("2_n78qv") order = 0 metadata/_custom_type_script = "uid://dtjdfji87kybn" diff --git a/resources/zombies/basic.tres b/resources/zombies/basic.tres new file mode 100644 index 0000000..10a9b50 --- /dev/null +++ b/resources/zombies/basic.tres @@ -0,0 +1,15 @@ +[gd_resource type="Resource" script_class="SeedpacketResource" load_steps=4 format=3 uid="uid://cbooo6i1rifb7"] + +[ext_resource type="Texture2D" uid="uid://dunlsp8tx7a4w" path="res://assets/sprites/zombies/Зондби.png" id="1_c2mq3"] +[ext_resource type="Script" uid="uid://dtjdfji87kybn" path="res://scripts/resources/entity_resource.gd" id="1_k277m"] +[ext_resource type="PackedScene" uid="uid://dunih4xhnupy5" path="res://scenes/zombies/basic.tscn" id="2_l6de4"] + +[resource] +script = ExtResource("1_k277m") +preview = ExtResource("1_c2mq3") +cost = 1.0 +recharge_time = 5.0 +initial_recharge_percent = 1.0 +scene = ExtResource("2_l6de4") +order = 0 +metadata/_custom_type_script = "uid://dtjdfji87kybn" diff --git a/scenes/levels/standard_level.tscn b/scenes/levels/standard_level.tscn index 809492b..e4af382 100644 --- a/scenes/levels/standard_level.tscn +++ b/scenes/levels/standard_level.tscn @@ -25,13 +25,16 @@ position = Vector2(305, 76) script = ExtResource("1_4dbyi") metadata/_edit_lock_ = true -[node name="SeedpacketPlacer" type="CanvasGroup" parent="Game" node_paths=PackedStringArray("entity_container")] +[node name="SeedpacketPlacer" type="Node2D" parent="Game" node_paths=PackedStringArray("entity_container")] script = ExtResource("4_5r585") entity_container = NodePath("../../LayeredEntityContainer") [node name="Plants" type="Node2D" parent="Game"] unique_name_in_owner = true +[node name="Projectiles" type="Node2D" parent="Game"] +unique_name_in_owner = true + [node name="Background" type="CanvasLayer" parent="Game"] layer = -10 follow_viewport_enabled = true diff --git a/scenes/plants/peashooter.tscn b/scenes/plants/peashooter.tscn new file mode 100644 index 0000000..871c0e6 --- /dev/null +++ b/scenes/plants/peashooter.tscn @@ -0,0 +1,186 @@ +[gd_scene load_steps=23 format=3 uid="uid://bxs34adppsh5e"] + +[ext_resource type="Texture2D" uid="uid://cksryh4w5dbbx" path="res://assets/sprites/atlases/plants/peashooter.png" id="2_4l0yo"] +[ext_resource type="Script" uid="uid://bwdvaov8sse4k" path="res://scripts/entities/entity.gd" id="2_pk084"] +[ext_resource type="Script" uid="uid://be5rfbbl5xgeh" path="res://scripts/components/generic_collider.gd" id="3_2lnl7"] +[ext_resource type="Script" uid="uid://cbmavbe4xd0j2" path="res://scripts/speed_controlled/speed_controlled_animation_tree.gd" id="3_gkdjr"] +[ext_resource type="Script" uid="uid://cbudgx741oxtc" path="res://scripts/components/generic_hurtbox.gd" id="5_gkdjr"] +[ext_resource type="Script" uid="uid://cjulv0bt6deps" path="res://scripts/components/field_segment_shape.gd" id="6_tf8ra"] +[ext_resource type="Script" uid="uid://b0ka8lb5kl1fd" path="res://scripts/components/controllers/plants/peashooter_controller.gd" id="8_0ridr"] +[ext_resource type="Script" uid="uid://d17rkta3k73jx" path="res://scripts/components/plant_death_handler.gd" id="8_6jrfv"] + +[sub_resource type="Animation" id="Animation_tf8ra"] +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_gkdjr"] +resource_name = "idle" +length = 0.833342 +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.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666667, 0.75), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] +} + +[sub_resource type="Animation" id="Animation_4l0yo"] +resource_name = "shoot" +length = 0.666675 +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, 0.583333), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [10, 11, 12, 13, 14, 15, 16, 17] +} +tracks/1/type = "method" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Controller") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0.333333), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [], +"method": &"shoot" +}] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_0ridr"] +_data = { +&"RESET": SubResource("Animation_tf8ra"), +&"idle": SubResource("Animation_gkdjr"), +&"shoot": SubResource("Animation_4l0yo") +} + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0ridr"] +animation = &"idle" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_6jrfv"] +animation = &"shoot" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0l7qe"] +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3wvhk"] +advance_mode = 2 +advance_expression = "is_shooting()" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hlvcn"] +switch_mode = 2 +advance_mode = 2 +advance_expression = "is_shooting() == false" + +[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_1h4ri"] +states/idle/node = SubResource("AnimationNodeAnimation_0ridr") +states/idle/position = Vector2(415, 106) +states/shoot/node = SubResource("AnimationNodeAnimation_6jrfv") +states/shoot/position = Vector2(649, 107) +transitions = ["Start", "idle", SubResource("AnimationNodeStateMachineTransition_0l7qe"), "idle", "shoot", SubResource("AnimationNodeStateMachineTransition_3wvhk"), "shoot", "idle", SubResource("AnimationNodeStateMachineTransition_hlvcn")] + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_0l7qe"] + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_3wvhk"] +graph_offset = Vector2(-541.787, 73.4125) +nodes/main/node = SubResource("AnimationNodeStateMachine_1h4ri") +nodes/main/position = Vector2(-140, 160) +nodes/speed/node = SubResource("AnimationNodeTimeScale_0l7qe") +nodes/speed/position = Vector2(140, 140) +node_connections = [&"output", 0, &"speed", &"speed", 0, &"main"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_6jrfv"] +size = Vector2(26, 40) + +[sub_resource type="SegmentShape2D" id="SegmentShape2D_gkdjr"] +b = Vector2(0, 0) + +[node name="Peashooter" type="Node2D" groups=["Plants"]] +script = ExtResource("2_pk084") +max_hp = 30.0 + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_4l0yo") +hframes = 10 +vframes = 2 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_0ridr") +} + +[node name="AnimationTree" type="AnimationTree" parent="."] +tree_root = SubResource("AnimationNodeBlendTree_3wvhk") +advance_expression_base_node = NodePath("../Controller") +anim_player = NodePath("../AnimationPlayer") +parameters/speed/scale = 1.0 +script = ExtResource("3_gkdjr") + +[node name="GenericCollider" type="Area2D" parent="."] +collision_layer = 2 +collision_mask = 0 +monitoring = false +script = ExtResource("3_2lnl7") +metadata/_custom_type_script = "uid://be5rfbbl5xgeh" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="GenericCollider"] +position = Vector2(0, 6) +shape = SubResource("RectangleShape2D_6jrfv") + +[node name="GenericHurtbox" type="Area2D" parent="."] +position = Vector2(17, -4) +collision_layer = 0 +collision_mask = 4 +monitorable = false +script = ExtResource("5_gkdjr") +lookup_layers = 1 +metadata/_custom_type_script = "uid://cbudgx741oxtc" + +[node name="CollisionShape2D" type="CollisionShape2D" parent="GenericHurtbox"] +shape = SubResource("SegmentShape2D_gkdjr") +script = ExtResource("6_tf8ra") + +[node name="Controller" type="Node" parent="." node_paths=PackedStringArray("projectile_transform")] +script = ExtResource("8_0ridr") +projectile_transform = NodePath("../ShootMarker") + +[node name="Timer" type="Timer" parent="Controller"] +wait_time = 1.5 +one_shot = true + +[node name="ShootMarker" type="Marker2D" parent="."] +position = Vector2(17, -4) + +[node name="DeathHandler" type="Node" parent="."] +script = ExtResource("8_6jrfv") + +[connection signal="killed" from="." to="DeathHandler" method="_on_killed"] +[connection signal="collision_end" from="GenericHurtbox" to="Controller" method="_on_generic_hurtbox_collision_end"] +[connection signal="collision_start" from="GenericHurtbox" to="Controller" method="_on_generic_hurtbox_collision_start"] +[connection signal="timeout" from="Controller/Timer" to="Controller" method="_on_timer_timeout"] diff --git a/scenes/projectiles/pea.tscn b/scenes/projectiles/pea.tscn new file mode 100644 index 0000000..d647bc5 --- /dev/null +++ b/scenes/projectiles/pea.tscn @@ -0,0 +1,20 @@ +[gd_scene load_steps=4 format=3 uid="uid://ciqhjwh4sfe3u"] + +[ext_resource type="Script" uid="uid://fgdhvaq4dek2" path="res://scripts/projectiles/linear_projectile.gd" id="1_qt432"] +[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_inkwd"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_osqrk"] +radius = 6.0 + +[node name="Pea" type="Area2D"] +collision_layer = 8 +collision_mask = 4 +script = ExtResource("1_qt432") +speed = 300.0 +damage = 10.0 + +[node name="Sprite2D" type="Sprite2D" parent="."] +texture = ExtResource("2_inkwd") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource("CircleShape2D_osqrk") diff --git a/scenes/zombies/basic.tscn b/scenes/zombies/basic.tscn new file mode 100644 index 0000000..d81499b --- /dev/null +++ b/scenes/zombies/basic.tscn @@ -0,0 +1,1113 @@ +[gd_scene load_steps=53 format=3 uid="uid://dunih4xhnupy5"] + +[ext_resource type="Texture2D" uid="uid://dacgbwohpmeed" path="res://assets/sprites/zombies/basic.png" id="1_jrplh"] +[ext_resource type="AnimationLibrary" uid="uid://ceb3khu7rwgy8" path="res://assets/animations/zombies/basic.res" id="2_yccea"] +[ext_resource type="Script" uid="uid://cbmavbe4xd0j2" path="res://scripts/speed_controlled/speed_controlled_animation_tree.gd" id="3_qnnv5"] +[ext_resource type="Script" uid="uid://be5rfbbl5xgeh" path="res://scripts/components/generic_collider.gd" id="3_qoqrk"] +[ext_resource type="Script" uid="uid://bdacurei5fp02" path="res://scripts/components/mover.gd" id="3_yccea"] +[ext_resource type="Script" uid="uid://cbudgx741oxtc" path="res://scripts/components/generic_hurtbox.gd" id="4_20equ"] +[ext_resource type="Script" uid="uid://bwdvaov8sse4k" path="res://scripts/entities/entity.gd" id="4_moyxp"] +[ext_resource type="Script" uid="uid://bg88vb74hinkj" path="res://scripts/components/controllers/zombies/basic_controller.gd" id="5_mc88i"] +[ext_resource type="Script" uid="uid://dfnyam1pvkb73" path="res://scripts/components/zombie_death_handler.gd" id="9_ap2hg"] + +[sub_resource type="SkeletonModification2DCCDIK" id="SkeletonModification2DCCDIK_wn68q"] +tip_nodepath = NodePath("Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand") +ccdik_data_chain_length = 2 +joint_data/0/bone_index = 17 +joint_data/0/bone2d_node = NodePath("Butt/Body/LeftUpperArm/LeftLowerArm") +joint_data/0/rotate_from_joint = false +joint_data/0/enable_constraint = true +joint_data/0/constraint_angle_min = 0.0 +joint_data/0/constraint_angle_max = 90.0 +joint_data/0/constraint_angle_invert = false +joint_data/0/constraint_in_localspace = true +joint_data/0/editor_draw_gizmo = true +joint_data/1/bone_index = 16 +joint_data/1/bone2d_node = NodePath("Butt/Body/LeftUpperArm") +joint_data/1/rotate_from_joint = false +joint_data/1/enable_constraint = false +joint_data/1/editor_draw_gizmo = true +editor/draw_gizmo = false + +[sub_resource type="SkeletonModification2DCCDIK" id="SkeletonModification2DCCDIK_x5uj2"] +tip_nodepath = NodePath("Butt/Body/RightUpperArm/RightLowerArm/RightHand") +ccdik_data_chain_length = 2 +joint_data/0/bone_index = 8 +joint_data/0/bone2d_node = NodePath("Butt/Body/RightUpperArm") +joint_data/0/rotate_from_joint = false +joint_data/0/enable_constraint = false +joint_data/0/editor_draw_gizmo = true +joint_data/1/bone_index = 9 +joint_data/1/bone2d_node = NodePath("Butt/Body/RightUpperArm/RightLowerArm") +joint_data/1/rotate_from_joint = false +joint_data/1/enable_constraint = true +joint_data/1/constraint_angle_min = 0.0 +joint_data/1/constraint_angle_max = 90.0 +joint_data/1/constraint_angle_invert = false +joint_data/1/constraint_in_localspace = true +joint_data/1/editor_draw_gizmo = true +editor/draw_gizmo = false + +[sub_resource type="SkeletonModification2DCCDIK" id="SkeletonModification2DCCDIK_vcc72"] +tip_nodepath = NodePath("Butt/RightUpperLeg/RightLowerLeg/RightFoot") +ccdik_data_chain_length = 2 +joint_data/0/bone_index = 1 +joint_data/0/bone2d_node = NodePath("Butt/RightUpperLeg") +joint_data/0/rotate_from_joint = false +joint_data/0/enable_constraint = true +joint_data/0/constraint_angle_min = -90.0 +joint_data/0/constraint_angle_max = 90.0 +joint_data/0/constraint_angle_invert = true +joint_data/0/constraint_in_localspace = true +joint_data/0/editor_draw_gizmo = true +joint_data/1/bone_index = 2 +joint_data/1/bone2d_node = NodePath("Butt/RightUpperLeg/RightLowerLeg") +joint_data/1/rotate_from_joint = false +joint_data/1/enable_constraint = true +joint_data/1/constraint_angle_min = 0.0 +joint_data/1/constraint_angle_max = 160.0 +joint_data/1/constraint_angle_invert = false +joint_data/1/constraint_in_localspace = true +joint_data/1/editor_draw_gizmo = true +editor/draw_gizmo = false + +[sub_resource type="SkeletonModification2DCCDIK" id="SkeletonModification2DCCDIK_kto0i"] +tip_nodepath = NodePath("Butt/LeftUpperLeg/LeftLowerLeg/LeftFoot") +ccdik_data_chain_length = 2 +joint_data/0/bone_index = 4 +joint_data/0/bone2d_node = NodePath("Butt/LeftUpperLeg") +joint_data/0/rotate_from_joint = false +joint_data/0/enable_constraint = true +joint_data/0/constraint_angle_min = -90.0 +joint_data/0/constraint_angle_max = 90.0 +joint_data/0/constraint_angle_invert = true +joint_data/0/constraint_in_localspace = true +joint_data/0/editor_draw_gizmo = true +joint_data/1/bone_index = 5 +joint_data/1/bone2d_node = NodePath("Butt/LeftUpperLeg/LeftLowerLeg") +joint_data/1/rotate_from_joint = false +joint_data/1/enable_constraint = true +joint_data/1/constraint_angle_min = -90.0 +joint_data/1/constraint_angle_max = 0.0 +joint_data/1/constraint_angle_invert = true +joint_data/1/constraint_in_localspace = true +joint_data/1/editor_draw_gizmo = true +editor/draw_gizmo = false + +[sub_resource type="SkeletonModificationStack2D" id="SkeletonModificationStack2D_wn68q"] +modification_count = 4 +modifications/0 = SubResource("SkeletonModification2DCCDIK_wn68q") +modifications/1 = SubResource("SkeletonModification2DCCDIK_x5uj2") +modifications/2 = SubResource("SkeletonModification2DCCDIK_vcc72") +modifications/3 = SubResource("SkeletonModification2DCCDIK_kto0i") + +[sub_resource type="AtlasTexture" id="AtlasTexture_jvn5w"] +atlas = ExtResource("1_jrplh") +region = Rect2(15, 30, 20, 8) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vmdbp"] +atlas = ExtResource("1_jrplh") +region = Rect2(64, 44, 10, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x1oyw"] +atlas = ExtResource("1_jrplh") +region = Rect2(93, 50, 17, 9) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vjx3c"] +atlas = ExtResource("1_jrplh") +region = Rect2(79, 44, 10, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_f31xd"] +atlas = ExtResource("1_jrplh") +region = Rect2(47, 33, 8, 16) + +[sub_resource type="AtlasTexture" id="AtlasTexture_od8jf"] +atlas = ExtResource("1_jrplh") +region = Rect2(59, 33, 7, 10) + +[sub_resource type="AtlasTexture" id="AtlasTexture_p4711"] +atlas = ExtResource("1_jrplh") +region = Rect2(71, 30, 19, 13) + +[sub_resource type="AtlasTexture" id="AtlasTexture_1bk2b"] +atlas = ExtResource("1_jrplh") +region = Rect2(12, 43, 6, 18) + +[sub_resource type="AtlasTexture" id="AtlasTexture_y06yv"] +atlas = ExtResource("1_jrplh") +region = Rect2(36, 50, 9, 11) + +[sub_resource type="AtlasTexture" id="AtlasTexture_lu8go"] +atlas = ExtResource("1_jrplh") +region = Rect2(22, 45, 8, 15) + +[sub_resource type="AtlasTexture" id="AtlasTexture_cdq7v"] +atlas = ExtResource("1_jrplh") +region = Rect2(93, 8, 29, 39) + +[sub_resource type="AtlasTexture" id="AtlasTexture_e7wc3"] +atlas = ExtResource("1_jrplh") +region = Rect2(72, 2, 13, 26) + +[sub_resource type="AtlasTexture" id="AtlasTexture_wn68q"] +atlas = ExtResource("1_jrplh") +region = Rect2(36, 0, 32, 30) + +[sub_resource type="AtlasTexture" id="AtlasTexture_x5uj2"] +atlas = ExtResource("1_jrplh") +region = Rect2(15, 17, 17, 6) + +[sub_resource type="AtlasTexture" id="AtlasTexture_vcc72"] +atlas = ExtResource("1_jrplh") +region = Rect2(93, 3, 2, 3) + +[sub_resource type="AtlasTexture" id="AtlasTexture_kto0i"] +atlas = ExtResource("1_jrplh") +region = Rect2(105, 2, 3, 4) + +[sub_resource type="AtlasTexture" id="AtlasTexture_djocr"] +atlas = ExtResource("1_jrplh") +region = Rect2(2, 7, 6, 19) + +[sub_resource type="AtlasTexture" id="AtlasTexture_6y4ja"] +atlas = ExtResource("1_jrplh") +region = Rect2(13, 2, 9, 10) + +[sub_resource type="AtlasTexture" id="AtlasTexture_auqeq"] +atlas = ExtResource("1_jrplh") +region = Rect2(0, 32, 9, 15) + +[sub_resource type="Animation" id="Animation_x5uj2"] +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-2, 14)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm:rotation") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand:position") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-1, 13)] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand:rotation") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("Zombie/Butt/Body/LeftUpperArm:position") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-1, -20)] +} +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath("Zombie/Butt/Body/LeftUpperArm:rotation") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/6/type = "value" +tracks/6/imported = false +tracks/6/enabled = true +tracks/6/path = NodePath("Zombie/Butt/Body/Head/LeftEye:position") +tracks/6/interp = 1 +tracks/6/loop_wrap = true +tracks/6/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-4, -9)] +} +tracks/7/type = "value" +tracks/7/imported = false +tracks/7/enabled = true +tracks/7/path = NodePath("Zombie/Butt/Body/Head/LeftEye:rotation") +tracks/7/interp = 1 +tracks/7/loop_wrap = true +tracks/7/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/8/type = "value" +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/path = NodePath("Zombie/Butt/Body/Head/RightEye:position") +tracks/8/interp = 1 +tracks/8/loop_wrap = true +tracks/8/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-16, -8)] +} +tracks/9/type = "value" +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/path = NodePath("Zombie/Butt/Body/Head/RightEye:rotation") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/10/type = "value" +tracks/10/imported = false +tracks/10/enabled = true +tracks/10/path = NodePath("Zombie/Butt/Body/Head/Jaw:position") +tracks/10/interp = 1 +tracks/10/loop_wrap = true +tracks/10/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-3, 3)] +} +tracks/11/type = "value" +tracks/11/imported = false +tracks/11/enabled = true +tracks/11/path = NodePath("Zombie/Butt/Body/Head/Jaw:rotation") +tracks/11/interp = 1 +tracks/11/loop_wrap = true +tracks/11/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/12/type = "value" +tracks/12/imported = false +tracks/12/enabled = true +tracks/12/path = NodePath("Zombie/Butt/Body/Tie:position") +tracks/12/interp = 1 +tracks/12/loop_wrap = true +tracks/12/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-9, -21)] +} +tracks/13/type = "value" +tracks/13/imported = false +tracks/13/enabled = true +tracks/13/path = NodePath("Zombie/Butt/Body/Tie:rotation") +tracks/13/interp = 1 +tracks/13/loop_wrap = true +tracks/13/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/14/type = "value" +tracks/14/imported = false +tracks/14/enabled = true +tracks/14/path = NodePath("Zombie/Butt/Body/RightUpperArm/RightLowerArm/RightHand:position") +tracks/14/interp = 1 +tracks/14/loop_wrap = true +tracks/14/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-1, 13)] +} +tracks/15/type = "value" +tracks/15/imported = false +tracks/15/enabled = true +tracks/15/path = NodePath("Zombie/Butt/Body/RightUpperArm/RightLowerArm/RightHand:rotation") +tracks/15/interp = 1 +tracks/15/loop_wrap = true +tracks/15/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/16/type = "value" +tracks/16/imported = false +tracks/16/enabled = true +tracks/16/path = NodePath("Zombie/Butt/Body/RightUpperArm/RightLowerArm:position") +tracks/16/interp = 1 +tracks/16/loop_wrap = true +tracks/16/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-2, 15)] +} +tracks/17/type = "value" +tracks/17/imported = false +tracks/17/enabled = true +tracks/17/path = NodePath("Zombie/Butt/Body/RightUpperArm/RightLowerArm:rotation") +tracks/17/interp = 1 +tracks/17/loop_wrap = true +tracks/17/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/18/type = "value" +tracks/18/imported = false +tracks/18/enabled = true +tracks/18/path = NodePath("Zombie/Butt/Body/RightUpperArm:position") +tracks/18/interp = 1 +tracks/18/loop_wrap = true +tracks/18/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-14, -23)] +} +tracks/19/type = "value" +tracks/19/imported = false +tracks/19/enabled = true +tracks/19/path = NodePath("Zombie/Butt/Body/RightUpperArm:rotation") +tracks/19/interp = 1 +tracks/19/loop_wrap = true +tracks/19/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/20/type = "value" +tracks/20/imported = false +tracks/20/enabled = true +tracks/20/path = NodePath("Zombie/Butt/LeftUpperLeg/LeftLowerLeg/LeftFoot:position") +tracks/20/interp = 1 +tracks/20/loop_wrap = true +tracks/20/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(6, 10)] +} +tracks/21/type = "value" +tracks/21/imported = false +tracks/21/enabled = true +tracks/21/path = NodePath("Zombie/Butt/LeftUpperLeg/LeftLowerLeg/LeftFoot:rotation") +tracks/21/interp = 1 +tracks/21/loop_wrap = true +tracks/21/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/22/type = "value" +tracks/22/imported = false +tracks/22/enabled = true +tracks/22/path = NodePath("Zombie/Butt/LeftUpperLeg/LeftLowerLeg:position") +tracks/22/interp = 1 +tracks/22/loop_wrap = true +tracks/22/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-1, 13)] +} +tracks/23/type = "value" +tracks/23/imported = false +tracks/23/enabled = true +tracks/23/path = NodePath("Zombie/Butt/LeftUpperLeg/LeftLowerLeg:rotation") +tracks/23/interp = 1 +tracks/23/loop_wrap = true +tracks/23/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/24/type = "value" +tracks/24/imported = false +tracks/24/enabled = true +tracks/24/path = NodePath("Zombie/Butt/LeftUpperLeg:position") +tracks/24/interp = 1 +tracks/24/loop_wrap = true +tracks/24/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(6, 4)] +} +tracks/25/type = "value" +tracks/25/imported = false +tracks/25/enabled = true +tracks/25/path = NodePath("Zombie/Butt/LeftUpperLeg:rotation") +tracks/25/interp = 1 +tracks/25/loop_wrap = true +tracks/25/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/26/type = "value" +tracks/26/imported = false +tracks/26/enabled = true +tracks/26/path = NodePath("Zombie/Butt/RightUpperLeg/RightLowerLeg/RightFoot:position") +tracks/26/interp = 1 +tracks/26/loop_wrap = true +tracks/26/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-2, 14)] +} +tracks/27/type = "value" +tracks/27/imported = false +tracks/27/enabled = true +tracks/27/path = NodePath("Zombie/Butt/RightUpperLeg/RightLowerLeg/RightFoot:rotation") +tracks/27/interp = 1 +tracks/27/loop_wrap = true +tracks/27/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/28/type = "value" +tracks/28/imported = false +tracks/28/enabled = true +tracks/28/path = NodePath("Zombie/Butt/RightUpperLeg/RightLowerLeg:position") +tracks/28/interp = 1 +tracks/28/loop_wrap = true +tracks/28/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-2, 12)] +} +tracks/29/type = "value" +tracks/29/imported = false +tracks/29/enabled = true +tracks/29/path = NodePath("Zombie/Butt/RightUpperLeg/RightLowerLeg:rotation") +tracks/29/interp = 1 +tracks/29/loop_wrap = true +tracks/29/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/30/type = "value" +tracks/30/imported = false +tracks/30/enabled = true +tracks/30/path = NodePath("Zombie/Butt/RightUpperLeg:position") +tracks/30/interp = 1 +tracks/30/loop_wrap = true +tracks/30/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-6, 3)] +} +tracks/31/type = "value" +tracks/31/imported = false +tracks/31/enabled = true +tracks/31/path = NodePath("Zombie/Butt/RightUpperLeg:rotation") +tracks/31/interp = 1 +tracks/31/loop_wrap = true +tracks/31/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/32/type = "value" +tracks/32/imported = false +tracks/32/enabled = true +tracks/32/path = NodePath("Zombie/Butt:position") +tracks/32/interp = 1 +tracks/32/loop_wrap = true +tracks/32/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(5, -35)] +} +tracks/33/type = "value" +tracks/33/imported = false +tracks/33/enabled = true +tracks/33/path = NodePath("Zombie/Butt:rotation") +tracks/33/interp = 1 +tracks/33/loop_wrap = true +tracks/33/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/34/type = "value" +tracks/34/imported = false +tracks/34/enabled = true +tracks/34/path = NodePath("Zombie/Butt/Body:position") +tracks/34/interp = 1 +tracks/34/loop_wrap = true +tracks/34/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(1, -2)] +} +tracks/35/type = "value" +tracks/35/imported = false +tracks/35/enabled = true +tracks/35/path = NodePath("Zombie/Butt/Body:rotation") +tracks/35/interp = 1 +tracks/35/loop_wrap = true +tracks/35/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/36/type = "value" +tracks/36/imported = false +tracks/36/enabled = true +tracks/36/path = NodePath("Zombie:position") +tracks/36/interp = 1 +tracks/36/loop_wrap = true +tracks/36/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(0, 0)] +} +tracks/37/type = "value" +tracks/37/imported = false +tracks/37/enabled = true +tracks/37/path = NodePath("Zombie:rotation") +tracks/37/interp = 1 +tracks/37/loop_wrap = true +tracks/37/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/38/type = "value" +tracks/38/imported = false +tracks/38/enabled = true +tracks/38/path = NodePath("Zombie/Butt/Body/Head:position") +tracks/38/interp = 1 +tracks/38/loop_wrap = true +tracks/38/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-10, -25)] +} +tracks/39/type = "value" +tracks/39/imported = false +tracks/39/enabled = true +tracks/39/path = NodePath("Zombie/Butt/Body/Head:rotation") +tracks/39/interp = 1 +tracks/39/loop_wrap = true +tracks/39/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} +tracks/40/type = "value" +tracks/40/imported = false +tracks/40/enabled = true +tracks/40/path = NodePath("Zombie/Butt/Body/Head:visible") +tracks/40/interp = 1 +tracks/40/loop_wrap = true +tracks/40/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/41/type = "value" +tracks/41/imported = false +tracks/41/enabled = true +tracks/41/path = NodePath("Zombie/Butt/Body/Tie:scale") +tracks/41/interp = 1 +tracks/41/loop_wrap = true +tracks/41/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(1, 1)] +} +tracks/42/type = "value" +tracks/42/imported = false +tracks/42/enabled = true +tracks/42/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand:texture") +tracks/42/interp = 1 +tracks/42/loop_wrap = true +tracks/42/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [SubResource("AtlasTexture_6y4ja")] +} +tracks/43/type = "value" +tracks/43/imported = false +tracks/43/enabled = true +tracks/43/path = NodePath("Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand/Left_Hand:offset") +tracks/43/interp = 1 +tracks/43/loop_wrap = true +tracks/43/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Vector2(-4, -1)] +} +tracks/44/type = "value" +tracks/44/imported = false +tracks/44/enabled = true +tracks/44/path = NodePath("../../Mover:speed_control") +tracks/44/interp = 1 +tracks/44/loop_wrap = true +tracks/44/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_qnnv5"] +_data = { +&"RESET": SubResource("Animation_x5uj2") +} + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_20equ"] +size = Vector2(27, 44) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_ap2hg"] +size = Vector2(20, 44) + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_moyxp"] +animation = &"basic/death" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_qoqrk"] +animation = &"basic/eating" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_20equ"] +animation = &"basic/stand" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ap2hg"] +animation = &"basic/walk" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_b2rti"] +switch_mode = 2 +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_culaa"] +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mc88i"] +advance_mode = 2 +advance_expression = "eating" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_moyxp"] +xfade_time = 0.5 +advance_mode = 2 +advance_expression = "eating == false and walking" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_qoqrk"] +xfade_time = 0.5 +advance_mode = 2 +advance_expression = "eating and walking" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_20equ"] +advance_mode = 2 +advance_expression = "(eating or walking) == false" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ap2hg"] +advance_mode = 2 +advance_expression = "eating == false and walking" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2naru"] +advance_mode = 2 +advance_expression = "(eating or walking) == false" + +[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_mc88i"] +states/death/node = SubResource("AnimationNodeAnimation_moyxp") +states/death/position = Vector2(739, 100) +states/eating/node = SubResource("AnimationNodeAnimation_qoqrk") +states/eating/position = Vector2(407, 40) +states/idle/node = SubResource("AnimationNodeAnimation_20equ") +states/idle/position = Vector2(297, 100) +states/walk/node = SubResource("AnimationNodeAnimation_ap2hg") +states/walk/position = Vector2(407, 161) +transitions = ["death", "End", SubResource("AnimationNodeStateMachineTransition_b2rti"), "Start", "idle", SubResource("AnimationNodeStateMachineTransition_culaa"), "idle", "eating", SubResource("AnimationNodeStateMachineTransition_mc88i"), "eating", "walk", SubResource("AnimationNodeStateMachineTransition_moyxp"), "walk", "eating", SubResource("AnimationNodeStateMachineTransition_qoqrk"), "walk", "idle", SubResource("AnimationNodeStateMachineTransition_20equ"), "idle", "walk", SubResource("AnimationNodeStateMachineTransition_ap2hg"), "eating", "idle", SubResource("AnimationNodeStateMachineTransition_2naru")] +graph_offset = Vector2(28, -31) + +[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_moyxp"] + +[sub_resource type="AnimationNodeBlendTree" id="AnimationNodeBlendTree_qoqrk"] +nodes/main/node = SubResource("AnimationNodeStateMachine_mc88i") +nodes/main/position = Vector2(-140, 180) +nodes/output/position = Vector2(260, 140) +nodes/speed/node = SubResource("AnimationNodeTimeScale_moyxp") +nodes/speed/position = Vector2(100, 140) +node_connections = [&"output", 0, &"speed", &"speed", 0, &"main"] + +[node name="Basic" type="Node2D" groups=["Zombies"]] +script = ExtResource("4_moyxp") +max_hp = 100.0 +layer = &"base" + +[node name="Visual" type="CanvasGroup" parent="."] +position = Vector2(0, 30) + +[node name="basic_zombie_walk" type="Node2D" parent="Visual"] + +[node name="Zombie" type="Skeleton2D" parent="Visual/basic_zombie_walk"] +modification_stack = SubResource("SkeletonModificationStack2D_wn68q") + +[node name="Butt" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie"] +position = Vector2(5, -35) +scale = Vector2(0.999912, 0.999912) +rest = Transform2D(1, 0, 0, 1, 5, -35) +editor_settings/show_bone_gizmo = false + +[node name="Butt" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt"] +texture = SubResource("AtlasTexture_jvn5w") +centered = false +offset = Vector2(-10, -3) +metadata/_edit_lock_ = true + +[node name="RightUpperLeg" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt"] +position = Vector2(-6, 3) +scale = Vector2(0.99983, 0.99983) +rest = Transform2D(1, 0, 0, 1, -6, 3) +editor_settings/show_bone_gizmo = false + +[node name="Right_Upper_Leg" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/RightUpperLeg"] +texture = SubResource("AtlasTexture_vmdbp") +centered = false +offset = Vector2(-6, -2) +metadata/_edit_lock_ = true + +[node name="RightLowerLeg" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/RightUpperLeg"] +position = Vector2(-2, 12) +scale = Vector2(0.99983, 0.99983) +rest = Transform2D(1, 0, 0, 1, -2, 12) +editor_settings/show_bone_gizmo = false + +[node name="RightFoot" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg"] +position = Vector2(-2, 14) +scale = Vector2(0.99983, 0.99983) +rest = Transform2D(1, 0, 0, 1, -2, 14) +auto_calculate_length_and_angle = false +length = 12.0 +bone_angle = 0.0 +editor_settings/show_bone_gizmo = false + +[node name="Right_Foot" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg/RightFoot"] +texture = SubResource("AtlasTexture_x1oyw") +centered = false +offset = Vector2(-4, -3) +metadata/_edit_lock_ = true + +[node name="Right_Lower_Leg" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg"] +position = Vector2(-18, -2) +texture = SubResource("AtlasTexture_vjx3c") +centered = false +offset = Vector2(12, 1) +metadata/_edit_lock_ = true + +[node name="LeftUpperLeg" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt"] +position = Vector2(6, 4) +scale = Vector2(0.999827, 0.999827) +rest = Transform2D(1, 0, 0, 1, 6, 4) +editor_settings/show_bone_gizmo = false + +[node name="Left_Upper_Leg" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/LeftUpperLeg"] +texture = SubResource("AtlasTexture_f31xd") +centered = false +offset = Vector2(-4, -2) +metadata/_edit_lock_ = true + +[node name="LeftLowerLeg" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/LeftUpperLeg"] +position = Vector2(-1, 13) +scale = Vector2(0.999828, 0.999828) +rest = Transform2D(1, 0, 0, 1, -1, 13) +editor_settings/show_bone_gizmo = false + +[node name="Left_Lower_Leg" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg"] +texture = SubResource("AtlasTexture_od8jf") +centered = false +offset = Vector2(-1, 0) +metadata/_edit_lock_ = true + +[node name="LeftFoot" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg"] +position = Vector2(6, 10) +scale = Vector2(0.999826, 0.999826) +rest = Transform2D(1, 0, 0, 1, 6, 10) +auto_calculate_length_and_angle = false +length = 12.0 +bone_angle = 160.0 +editor_settings/show_bone_gizmo = false + +[node name="Left_Foot" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg/LeftFoot"] +texture = SubResource("AtlasTexture_p4711") +centered = false +offset = Vector2(-14, -3) +metadata/_edit_lock_ = true + +[node name="Body" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt"] +position = Vector2(1, -2) +scale = Vector2(0.999829, 0.999829) +rest = Transform2D(1, 0, 0, 1, 1, -2) +editor_settings/show_bone_gizmo = false + +[node name="RightUpperArm" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body"] +position = Vector2(-14, -23) +scale = Vector2(0.999831, 0.999831) +rest = Transform2D(1, 0, 0, 1, -14, -23) +editor_settings/show_bone_gizmo = false + +[node name="Right_Upper_Arm" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm"] +texture = SubResource("AtlasTexture_1bk2b") +centered = false +offset = Vector2(-4, -2) +metadata/_edit_lock_ = true + +[node name="RightLowerArm" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm"] +position = Vector2(-2, 15) +scale = Vector2(0.99982, 0.99982) +rest = Transform2D(1, 0, 0, 1, -2, 15) +editor_settings/show_bone_gizmo = false + +[node name="RightHand" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm"] +position = Vector2(-1, 13) +scale = Vector2(0.99983, 0.99983) +rest = Transform2D(1, 0, 0, 1, -1, 13) +auto_calculate_length_and_angle = false +length = 8.0 +bone_angle = 90.0 +editor_settings/show_bone_gizmo = false + +[node name="Right_Hand" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm/RightHand"] +texture = SubResource("AtlasTexture_y06yv") +centered = false +offset = Vector2(-4, -2) +metadata/_edit_lock_ = true + +[node name="Right_Lower_Arm" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm"] +texture = SubResource("AtlasTexture_lu8go") +centered = false +offset = Vector2(-5, -1) +metadata/_edit_lock_ = true + +[node name="Body" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body"] +rotation = 0.00163735 +texture = SubResource("AtlasTexture_cdq7v") +centered = false +offset = Vector2(-15, -27) +metadata/_edit_lock_ = true + +[node name="Tie" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body"] +position = Vector2(-9, -21) +skew = -9.59635e-05 +rest = Transform2D(1, 0, 0, 1, -9, -21) +auto_calculate_length_and_angle = false +length = 24.0 +bone_angle = 100.0 +editor_settings/show_bone_gizmo = false + +[node name="Tie" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Tie"] +texture = SubResource("AtlasTexture_e7wc3") +centered = false +offset = Vector2(-10, -1) +metadata/_edit_lock_ = true + +[node name="Head" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body"] +position = Vector2(-10, -25) +scale = Vector2(0.999829, 0.999829) +rest = Transform2D(1, 0, 0, 1, -10, -25) +editor_settings/show_bone_gizmo = false + +[node name="Head" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head"] +texture = SubResource("AtlasTexture_wn68q") +centered = false +offset = Vector2(-20, -24) +metadata/_edit_lock_ = true + +[node name="Jaw" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head"] +position = Vector2(-3, 3) +scale = Vector2(0.999832, 0.999832) +rest = Transform2D(1, 0, 0, 1, -3, 3) +auto_calculate_length_and_angle = false +length = 11.0 +bone_angle = 180.0 +editor_settings/show_bone_gizmo = false + +[node name="Jaw" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head/Jaw"] +texture = SubResource("AtlasTexture_x5uj2") +centered = false +offset = Vector2(-12, -2) +metadata/_edit_lock_ = true + +[node name="RightEye" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head"] +position = Vector2(-16, -8) +rest = Transform2D(1, 0, 0, 1, -16, -8) +auto_calculate_length_and_angle = false +length = 2.0 +bone_angle = 180.0 +editor_settings/show_bone_gizmo = false + +[node name="Right_Eye" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head/RightEye"] +texture = SubResource("AtlasTexture_vcc72") +centered = false +offset = Vector2(-2, -2) +metadata/_edit_lock_ = true + +[node name="LeftEye" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head"] +position = Vector2(-4, -9) +rest = Transform2D(1, 0, 0, 1, -4, -9) +auto_calculate_length_and_angle = false +length = 2.0 +bone_angle = 180.0 +editor_settings/show_bone_gizmo = false + +[node name="Left_Eye" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/Head/LeftEye"] +texture = SubResource("AtlasTexture_kto0i") +centered = false +offset = Vector2(-2, -2) +metadata/_edit_lock_ = true + +[node name="LeftUpperArm" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body"] +position = Vector2(-1, -20) +scale = Vector2(0.999827, 0.999827) +rest = Transform2D(1, 0, 0, 1, -1, -20) +editor_settings/show_bone_gizmo = false + +[node name="Left_Upper_Arm" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm"] +position = Vector2(-37, 10) +texture = SubResource("AtlasTexture_djocr") +centered = false +offset = Vector2(33, -12) +metadata/_edit_lock_ = true + +[node name="LeftLowerArm" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm"] +position = Vector2(-2, 14) +scale = Vector2(0.999825, 0.999825) +rest = Transform2D(1, 0, 0, 1, -2, 14) +editor_settings/show_bone_gizmo = false + +[node name="LeftHand" type="Bone2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"] +position = Vector2(-1, 13) +scale = Vector2(0.999828, 0.999828) +rest = Transform2D(1, 0, 0, 1, -1, 13) +auto_calculate_length_and_angle = false +length = 6.0 +bone_angle = 90.0 +editor_settings/show_bone_gizmo = false + +[node name="Left_Hand" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm/LeftHand"] +texture = SubResource("AtlasTexture_6y4ja") +centered = false +offset = Vector2(-4, -1) +metadata/_edit_lock_ = true + +[node name="Left_Lower_Arm" type="Sprite2D" parent="Visual/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm"] +texture = SubResource("AtlasTexture_auqeq") +centered = false +offset = Vector2(-5, 0) +metadata/_edit_lock_ = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Visual/basic_zombie_walk"] +libraries = { +&"": SubResource("AnimationLibrary_qnnv5"), +&"basic": ExtResource("2_yccea") +} + +[node name="Collider" type="Area2D" parent="."] +collision_layer = 4 +collision_mask = 0 +monitoring = false +script = ExtResource("3_qoqrk") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Collider"] +position = Vector2(1.5, 8) +shape = SubResource("RectangleShape2D_20equ") + +[node name="Hurtbox" type="Area2D" parent="."] +collision_layer = 0 +collision_mask = 2 +monitorable = false +script = ExtResource("4_20equ") +lookup_layers = 1 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hurtbox"] +position = Vector2(-10, 8) +shape = SubResource("RectangleShape2D_ap2hg") + +[node name="AnimationTree" type="AnimationTree" parent="."] +root_node = NodePath("../Visual/basic_zombie_walk") +tree_root = SubResource("AnimationNodeBlendTree_qoqrk") +advance_expression_base_node = NodePath("../Controller") +anim_player = NodePath("../Visual/basic_zombie_walk/AnimationPlayer") +parameters/speed/scale = 1.0 +script = ExtResource("3_qnnv5") + +[node name="Mover" type="Node" parent="."] +script = ExtResource("3_yccea") + +[node name="Controller" type="Node" parent="." node_paths=PackedStringArray("hurtbox")] +script = ExtResource("5_mc88i") +hurtbox = NodePath("../Hurtbox") +damage = 5.0 + +[node name="DeathHandler" type="Node" parent="."] +script = ExtResource("9_ap2hg") + +[connection signal="killed" from="." to="Controller" method="_on_entity_killed"] +[connection signal="animation_finished" from="AnimationTree" to="DeathHandler" method="_on_animation_tree_animation_finished"] diff --git a/scripts/components/controllers/plants/peashooter_controller.gd b/scripts/components/controllers/plants/peashooter_controller.gd new file mode 100644 index 0000000..5908b83 --- /dev/null +++ b/scripts/components/controllers/plants/peashooter_controller.gd @@ -0,0 +1,33 @@ +extends Node + +const projectile := preload("uid://ciqhjwh4sfe3u") + +@export var projectile_transform : Marker2D + +var detected : bool = false +var can_shoot : bool = true + +@onready var timer := $Timer +@onready var entity : Entity = get_parent() + +func is_shooting(): + return detected and can_shoot and entity.disabled == false + +func _on_generic_hurtbox_collision_start() -> void: + detected = true + +func _on_generic_hurtbox_collision_end() -> void: + detected = false + +func shoot(): + if can_shoot == false: + return + can_shoot = false + timer.start() + var proj = projectile.instantiate() + get_tree().current_scene.get_node("%Projectiles").add_child(proj) + proj.global_transform = projectile_transform.global_transform + proj.source = entity + +func _on_timer_timeout() -> void: + can_shoot = true diff --git a/scripts/components/controllers/plants/peashooter_controller.gd.uid b/scripts/components/controllers/plants/peashooter_controller.gd.uid new file mode 100644 index 0000000..5f6acbe --- /dev/null +++ b/scripts/components/controllers/plants/peashooter_controller.gd.uid @@ -0,0 +1 @@ +uid://b0ka8lb5kl1fd diff --git a/scripts/components/controllers/zombies/basic_controller.gd b/scripts/components/controllers/zombies/basic_controller.gd new file mode 100644 index 0000000..7bc0163 --- /dev/null +++ b/scripts/components/controllers/zombies/basic_controller.gd @@ -0,0 +1,29 @@ +extends Node + +var eating: + get: + return is_eating() +var walking: + get: + return is_walking() + +@export var hurtbox : GenericHurtbox +@export var damage : float +@onready var disablable := get_parent() + +var killed := false + +func _on_entity_killed(_context: RefCounted) -> void: + if killed: return + $"../AnimationTree"["parameters/main/playback"].travel("death") + killed = true + +func is_eating() -> bool: + return hurtbox.is_colliding() and disablable.disabled == false + +func is_walking() -> bool: + return disablable.disabled == false + +func bite() -> void: + if hurtbox.is_colliding() == false: return + hurtbox.get_colliding_entity().deal_damage(damage,get_parent()) diff --git a/scripts/components/controllers/zombies/basic_controller.gd.uid b/scripts/components/controllers/zombies/basic_controller.gd.uid new file mode 100644 index 0000000..a3c82d9 --- /dev/null +++ b/scripts/components/controllers/zombies/basic_controller.gd.uid @@ -0,0 +1 @@ +uid://bg88vb74hinkj diff --git a/scripts/components/field_segment_shape.gd b/scripts/components/field_segment_shape.gd new file mode 100644 index 0000000..ba8e43e --- /dev/null +++ b/scripts/components/field_segment_shape.gd @@ -0,0 +1,4 @@ +extends CollisionShape2D + +func _process(_delta: float) -> void: + shape.b = Vector2(FieldParams.field_rect.end.x-global_position.x+FieldParams.TILE.x,0) diff --git a/scripts/components/field_segment_shape.gd.uid b/scripts/components/field_segment_shape.gd.uid new file mode 100644 index 0000000..0242864 --- /dev/null +++ b/scripts/components/field_segment_shape.gd.uid @@ -0,0 +1 @@ +uid://cjulv0bt6deps diff --git a/scripts/components/generic_collider.gd b/scripts/components/generic_collider.gd new file mode 100644 index 0000000..804adcc --- /dev/null +++ b/scripts/components/generic_collider.gd @@ -0,0 +1,15 @@ +extends Area2D + +## Base class for generic colliders. + +class_name GenericCollider + +## Contact layer. Used to check +enum Layers +{ + NORMAL = 1, + LOW = 2, + HIGH = 4 +} + +@export var layer : Layers = Layers.NORMAL diff --git a/scripts/components/generic_collider.gd.uid b/scripts/components/generic_collider.gd.uid new file mode 100644 index 0000000..9f2d11a --- /dev/null +++ b/scripts/components/generic_collider.gd.uid @@ -0,0 +1 @@ +uid://be5rfbbl5xgeh diff --git a/scripts/components/generic_hurtbox.gd b/scripts/components/generic_hurtbox.gd new file mode 100644 index 0000000..7200353 --- /dev/null +++ b/scripts/components/generic_hurtbox.gd @@ -0,0 +1,45 @@ +extends Area2D + +class_name GenericHurtbox + +@export_flags("NORMAL:1","LOW:2","HIGH:4") var lookup_layers : int = 0 +var entities : Array[Entity] = [] + +signal entity_added(entity : Entity) +signal entity_removed(entity : Entity) +signal collision_start +signal collision_end + +func _ready() -> void: + area_entered.connect(on_area_entered) + area_exited.connect(on_area_exited) + +func on_area_entered(area: Area2D): + if area is GenericCollider: + if lookup_layers & area.layer != 0: + add_entity(area.get_parent()) + +func on_area_exited(area: Area2D): + if area is GenericCollider: + if lookup_layers & area.layer != 0: + remove_entity(area.get_parent()) + +func add_entity(entity : Entity): + entities.append(entity) + entity_added.emit(entity) + if entities.size() == 1: + collision_start.emit() + +func remove_entity(entity : Entity): + entities.erase(entity) + entity_removed.emit(entity) + if entities.size() == 0: + collision_end.emit() + +func get_colliding_entity() -> Entity: + if entities.size() == 0: + return null + return entities[0] + +func is_colliding() -> bool: + return entities.size() > 0 diff --git a/scripts/components/generic_hurtbox.gd.uid b/scripts/components/generic_hurtbox.gd.uid new file mode 100644 index 0000000..7f6f36b --- /dev/null +++ b/scripts/components/generic_hurtbox.gd.uid @@ -0,0 +1 @@ +uid://cbudgx741oxtc diff --git a/scripts/components/mover.gd b/scripts/components/mover.gd new file mode 100644 index 0000000..6d9d4ad --- /dev/null +++ b/scripts/components/mover.gd @@ -0,0 +1,10 @@ +extends Node + +@export_range(0,2,0.001,"or_greater","hide_slider","suffix:tiles/second") var speed : float = 0.2 +# Used by animation players to control zombie's movement +@export var speed_control : float = 0.0 + +@onready var parent : Node2D = get_parent() + +func _physics_process(delta: float) -> void: + parent.global_position += -parent.global_transform.x * speed_control * speed * delta * FieldParams.TILE.x diff --git a/scripts/components/mover.gd.uid b/scripts/components/mover.gd.uid new file mode 100644 index 0000000..59ed131 --- /dev/null +++ b/scripts/components/mover.gd.uid @@ -0,0 +1 @@ +uid://bdacurei5fp02 diff --git a/scripts/components/plant_death_handler.gd b/scripts/components/plant_death_handler.gd new file mode 100644 index 0000000..ff221fb --- /dev/null +++ b/scripts/components/plant_death_handler.gd @@ -0,0 +1,5 @@ +extends Node + + +func _on_killed(context: RefCounted) -> void: + get_parent().deconstruct() diff --git a/scripts/components/plant_death_handler.gd.uid b/scripts/components/plant_death_handler.gd.uid new file mode 100644 index 0000000..1b81a66 --- /dev/null +++ b/scripts/components/plant_death_handler.gd.uid @@ -0,0 +1 @@ +uid://d17rkta3k73jx diff --git a/scripts/components/zombie_death_handler.gd b/scripts/components/zombie_death_handler.gd new file mode 100644 index 0000000..8aa4325 --- /dev/null +++ b/scripts/components/zombie_death_handler.gd @@ -0,0 +1,5 @@ +extends Node + +func _on_animation_tree_animation_finished(anim_name: StringName) -> void: + if anim_name.split("/")[1] == "death": + get_parent().deconstruct() diff --git a/scripts/components/zombie_death_handler.gd.uid b/scripts/components/zombie_death_handler.gd.uid new file mode 100644 index 0000000..f9cb8a8 --- /dev/null +++ b/scripts/components/zombie_death_handler.gd.uid @@ -0,0 +1 @@ +uid://dfnyam1pvkb73 diff --git a/scripts/entities/entity.gd b/scripts/entities/entity.gd index 2121b9b..e381c48 100644 --- a/scripts/entities/entity.gd +++ b/scripts/entities/entity.gd @@ -8,8 +8,9 @@ class_name Entity ## Optional spawn layer for grid interactions @export var layer : StringName = "" ## Current amount of health points of an entity. Cannot be below 0 or [code]max_hp[/code] -var hp : float = max_hp - +@onready var hp : float = max_hp +## +var disabled : bool = false signal damaged ## Emitted when damage is taken @@ -20,6 +21,21 @@ signal healed(context : HealedContext) signal hp_changed(context : HPChangedContext) ## Emitted when kill is requested signal killed(context : KilledContext) +## +signal toggled(disabled : bool) + + +## +func disable(): + if disabled: return + disabled = true + toggled.emit(disabled) + +## +func enable(): + if disabled == false: return + disabled = false + toggled.emit(disabled) ## Properly deal damage to entity func deal_damage(amount : float, source : Entity): @@ -42,7 +58,6 @@ func deal_damage(amount : float, source : Entity): hp = 0 kill(source) - ## Properly heal entity func heal(amount : float, source : Entity): var context = HealedContext.new() @@ -61,7 +76,6 @@ func heal(amount : float, source : Entity): if hp > max_hp: hp = max_hp - ## Invoked when an entity is killed by damage. func kill(source : Entity): var context = KilledContext.new() @@ -72,9 +86,6 @@ func kill(source : Entity): LevelEventBus.entity_killed.emit(context) if not layer.is_empty(): LevelEventBus.layer_entity_killed.emit(context) - - deconstruct() - ## Method used to properly deconstruct entity func deconstruct(): diff --git a/scripts/level/seedpacket_placer.gd b/scripts/level/seedpacket_placer.gd index a934670..9a7af23 100644 --- a/scripts/level/seedpacket_placer.gd +++ b/scripts/level/seedpacket_placer.gd @@ -1,4 +1,4 @@ -extends CanvasGroup +extends Node2D @export var entity_container : LayeredEntityContainer var can_plant : bool = false @@ -24,13 +24,16 @@ func _input(event: InputEvent) -> void: if held_packet != null and can_plant and event.is_action_pressed("primary_action"): for child in get_children(): + child.enable() child.reparent(get_tree().current_scene.get_node("%Plants")) LevelEventBus.packet_placed.emit(held_packet) held_packet = null visible = false func on_seedpacket_selected(packet : SeedpacketResource) -> void: - add_child(packet.scene.instantiate()) + var instantiated = packet.scene.instantiate() + add_child(instantiated) + instantiated.disable() held_packet = packet visible = true diff --git a/scripts/projectiles/linear_projectile.gd b/scripts/projectiles/linear_projectile.gd new file mode 100644 index 0000000..96923d0 --- /dev/null +++ b/scripts/projectiles/linear_projectile.gd @@ -0,0 +1,18 @@ +extends Area2D + +var source : Entity + +@export var speed : float +@export var damage : float + +func _ready() -> void: + area_entered.connect(on_area_entered) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _physics_process(delta: float) -> void: + global_position += global_transform.x * speed * delta + +func on_area_entered(area : Area2D): + if area.get_parent() != null: + area.get_parent().deal_damage(damage, source) + queue_free() diff --git a/scripts/projectiles/linear_projectile.gd.uid b/scripts/projectiles/linear_projectile.gd.uid new file mode 100644 index 0000000..d945eb0 --- /dev/null +++ b/scripts/projectiles/linear_projectile.gd.uid @@ -0,0 +1 @@ +uid://fgdhvaq4dek2 diff --git a/scripts/speed_controlled/speed_controlled_animation_tree.gd b/scripts/speed_controlled/speed_controlled_animation_tree.gd new file mode 100644 index 0000000..f41c250 --- /dev/null +++ b/scripts/speed_controlled/speed_controlled_animation_tree.gd @@ -0,0 +1,5 @@ +extends AnimationTree + + +func on_speed_changed(speed : float): + set("parameters/speed/scale",speed) diff --git a/scripts/speed_controlled/speed_controlled_animation_tree.gd.uid b/scripts/speed_controlled/speed_controlled_animation_tree.gd.uid new file mode 100644 index 0000000..599e805 --- /dev/null +++ b/scripts/speed_controlled/speed_controlled_animation_tree.gd.uid @@ -0,0 +1 @@ +uid://cbmavbe4xd0j2 diff --git a/scripts/speed_controlled/speed_controlled_timer.gd b/scripts/speed_controlled/speed_controlled_timer.gd new file mode 100644 index 0000000..6783937 --- /dev/null +++ b/scripts/speed_controlled/speed_controlled_timer.gd @@ -0,0 +1,16 @@ +extends Timer + + +var old_speed : float + +func on_speed_changed(speed : float): + var ratio = speed / old_speed + var old_wait_time = wait_time + var old_time_left = time_left + + if old_time_left > 0: + start(old_time_left * ratio) + + wait_time = old_wait_time * ratio + + old_speed = speed diff --git a/scripts/speed_controlled/speed_controlled_timer.gd.uid b/scripts/speed_controlled/speed_controlled_timer.gd.uid new file mode 100644 index 0000000..d3abdf1 --- /dev/null +++ b/scripts/speed_controlled/speed_controlled_timer.gd.uid @@ -0,0 +1 @@ +uid://bk1twclmpvalk