diff --git a/assets/sprites/atlases/atlas2.png b/assets/sprites/atlases/atlas2.png index 2e0fca8..fbc6272 100644 Binary files a/assets/sprites/atlases/atlas2.png and b/assets/sprites/atlases/atlas2.png differ diff --git a/assets/sprites/atlases/brain.tres b/assets/sprites/atlases/brain.tres new file mode 100644 index 0000000..d309e09 --- /dev/null +++ b/assets/sprites/atlases/brain.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bt0slphfqhhab"] + +[ext_resource type="Texture2D" uid="uid://c68mrfs4wb81x" path="res://assets/sprites/atlases/atlas2.png" id="1_3sdui"] + +[resource] +atlas = ExtResource("1_3sdui") +region = Rect2(0, 144, 170, 63) diff --git a/resources/animations/zombies/basic_zombie_tree.tres b/resources/animations/zombies/basic_zombie_tree.tres new file mode 100644 index 0000000..c8c07ab --- /dev/null +++ b/resources/animations/zombies/basic_zombie_tree.tres @@ -0,0 +1,39 @@ +[gd_resource type="AnimationNodeStateMachine" load_steps=9 format=3 uid="uid://dj0blope85bg7"] + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_h0rfo"] +animation = &"basic_zombie/eat" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nog33"] +animation = &"basic_zombie/idle" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_g2uel"] +animation = &"basic_zombie/walk" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vxhht"] +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r8rju"] +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_y2ivb"] +advance_mode = 2 +advance_expression = "get(\"isEating\") == true" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7d3k4"] +advance_mode = 2 +advance_expression = "get(\"isEating\") == true" + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_kk4wi"] +advance_mode = 2 +advance_expression = "get(\"isEating\") == false" + +[resource] +states/End/position = Vector2(977, 90) +states/basic_zombie_eat/node = SubResource("AnimationNodeAnimation_h0rfo") +states/basic_zombie_eat/position = Vector2(575, 185) +states/basic_zombie_idle/node = SubResource("AnimationNodeAnimation_nog33") +states/basic_zombie_idle/position = Vector2(366, 100) +states/basic_zombie_walk/node = SubResource("AnimationNodeAnimation_g2uel") +states/basic_zombie_walk/position = Vector2(575, 35) +transitions = ["Start", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_vxhht"), "basic_zombie_idle", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_r8rju"), "basic_zombie_idle", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_y2ivb"), "basic_zombie_walk", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_7d3k4"), "basic_zombie_eat", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_kk4wi")] +graph_offset = Vector2(13, 26) diff --git a/scenes/entities/Zombies/zombie.tscn b/scenes/entities/Zombies/zombie.tscn index 7322af9..776b4e2 100644 --- a/scenes/entities/Zombies/zombie.tscn +++ b/scenes/entities/Zombies/zombie.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=27 format=3 uid="uid://co11v3w8hbwgf"] +[gd_scene load_steps=19 format=3 uid="uid://co11v3w8hbwgf"] [ext_resource type="Script" uid="uid://dildme6epx8l4" path="res://scripts/components/zombies/RuntimeZombieData.cs" id="1_qq3f1"] [ext_resource type="Texture2D" uid="uid://bwdqbrnn7ygtr" path="res://assets/sprites/atlases/zombies/Зондби.png" id="2_4pdxh"] @@ -8,6 +8,7 @@ [ext_resource type="Script" uid="uid://7hdj2k14lfe4" path="res://scripts/components/zombies/ZombieMover.cs" id="4_u5syx"] [ext_resource type="AnimationLibrary" uid="uid://cuh2kyb21hmkm" path="res://resources/animations/zombies/basic_zombie.res" id="6_ckb7n"] [ext_resource type="Script" uid="uid://c3cfnrmnnuqms" path="res://addons/floatmodifiers/FloatModifiers.cs" id="7_b3p4o"] +[ext_resource type="AnimationNodeStateMachine" uid="uid://dj0blope85bg7" path="res://resources/animations/zombies/basic_zombie_tree.tres" id="8_ckb7n"] [ext_resource type="AudioStream" uid="uid://xoy5ct1t17k5" path="res://assets/audio/sfx/slap.mp3" id="8_di4dd"] [ext_resource type="Script" uid="uid://bsg4utgc0u0vo" path="res://scripts/components/zombies/AudioDamage.cs" id="9_oxd1e"] @@ -50,44 +51,6 @@ _data = { &"RESET": SubResource("Animation_qv5y7") } -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_h0rfo"] -animation = &"basic_zombie/eat" - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nog33"] -animation = &"basic_zombie/idle" - -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_g2uel"] -animation = &"basic_zombie/walk" - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vxhht"] -advance_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r8rju"] -advance_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_y2ivb"] -advance_mode = 2 -advance_expression = "get(\"isEating\") == true" - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7d3k4"] -advance_mode = 2 -advance_expression = "get(\"isEating\") == true" - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_kk4wi"] -advance_mode = 2 -advance_expression = "get(\"isEating\") == false" - -[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_qep5j"] -states/End/position = Vector2(1183, 100) -states/basic_zombie_eat/node = SubResource("AnimationNodeAnimation_h0rfo") -states/basic_zombie_eat/position = Vector2(575, 185) -states/basic_zombie_idle/node = SubResource("AnimationNodeAnimation_nog33") -states/basic_zombie_idle/position = Vector2(366, 100) -states/basic_zombie_walk/node = SubResource("AnimationNodeAnimation_g2uel") -states/basic_zombie_walk/position = Vector2(575, 35) -transitions = ["Start", "basic_zombie_idle", SubResource("AnimationNodeStateMachineTransition_vxhht"), "basic_zombie_idle", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_r8rju"), "basic_zombie_idle", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_y2ivb"), "basic_zombie_walk", "basic_zombie_eat", SubResource("AnimationNodeStateMachineTransition_7d3k4"), "basic_zombie_eat", "basic_zombie_walk", SubResource("AnimationNodeStateMachineTransition_kk4wi")] -graph_offset = Vector2(13, 26) - [sub_resource type="Resource" id="Resource_ckb7n"] resource_local_to_scene = true script = ExtResource("7_b3p4o") @@ -133,7 +96,7 @@ libraries = { } [node name="AnimationTree" type="AnimationTree" parent="."] -tree_root = SubResource("AnimationNodeStateMachine_qep5j") +tree_root = ExtResource("8_ckb7n") advance_expression_base_node = NodePath("../Eatbox") anim_player = NodePath("../AnimationPlayer") diff --git a/scenes/entities/plants/peashooter.tscn b/scenes/entities/plants/peashooter.tscn index d39dedf..0f84ec6 100644 --- a/scenes/entities/plants/peashooter.tscn +++ b/scenes/entities/plants/peashooter.tscn @@ -60,7 +60,6 @@ resource_local_to_scene = true size = Vector2(20, 44) [node name="Peashooter" instance=ExtResource("1_pyk3o")] -_maxHP = 30 [node name="Sprite2D" parent="." index="0"] texture = ExtResource("2_14qlx") diff --git a/scenes/level components/invun_plant.tscn b/scenes/level components/invun_plant.tscn new file mode 100644 index 0000000..8ce2892 --- /dev/null +++ b/scenes/level components/invun_plant.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=3 format=3 uid="uid://ddp53j2ebnpyl"] + +[ext_resource type="PackedScene" uid="uid://b1hjjbdwf1rtc" path="res://scenes/templates/plant_template.tscn" id="1_1vb12"] + +[sub_resource type="CircleShape2D" id="CircleShape2D_2e1tv"] +radius = 22.0227 + +[node name="InvunPlant" instance=ExtResource("1_1vb12")] +_maxHP = 12412 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox" index="0"] +shape = SubResource("CircleShape2D_2e1tv") diff --git a/scenes/prototype_survival.tscn b/scenes/prototype_survival.tscn index d7922b2..e2faa5a 100644 --- a/scenes/prototype_survival.tscn +++ b/scenes/prototype_survival.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=17 format=3 uid="uid://c1335fke4thpm"] +[gd_scene load_steps=30 format=3 uid="uid://c1335fke4thpm"] [ext_resource type="Script" uid="uid://bndu1h5kgcde8" path="res://scripts/components/level/RuntimeLevelData.cs" id="1_tnxdx"] [ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/background_summer.png" id="1_vafkg"] @@ -9,11 +9,161 @@ [ext_resource type="PackedScene" uid="uid://fm471x22n8kr" path="res://scenes/gui/pause_menu.tscn" id="7_3ghv7"] [ext_resource type="Script" uid="uid://cslqjdd5wq4rc" path="res://scripts/components/level/SunSpawner.cs" id="7_gnb05"] [ext_resource type="PackedScene" uid="uid://bpekho7leatr5" path="res://scenes/sun.tscn" id="8_8nyym"] +[ext_resource type="Texture2D" uid="uid://bt0slphfqhhab" path="res://assets/sprites/atlases/brain.tres" id="8_h1ksq"] [ext_resource type="Script" uid="uid://bsuw5lvnr3kol" path="res://scripts/components/level/zombe_spawners/ZombieSequencer.cs" id="9_8nyym"] +[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="9_jmik4"] [ext_resource type="PackedScene" uid="uid://jm7wm08d2mi7" path="res://scenes/level components/right_boundary_marker.tscn" id="9_q2l3d"] [ext_resource type="Script" uid="uid://nkb6i7lrkl8y" path="res://scripts/components/level/zombe_spawners/SurvivalZombieSpawner.cs" id="10_1kjp6"] +[ext_resource type="Script" uid="uid://btqwxelqxheh3" path="res://scripts/components/gui/RestartButton.cs" id="10_4il7a"] [ext_resource type="PackedScene" uid="uid://plc2gus4ppds" path="res://scenes/level components/left_boundary_marker.tscn" id="10_5h8lk"] +[ext_resource type="Script" uid="uid://dpdpv2oyxdna7" path="res://scripts/components/gui/ExitButton.cs" id="11_q1dn6"] [ext_resource type="Script" uid="uid://blpu7t8tf6277" path="res://scripts/components/particles/FallFloor.cs" id="13_5h8lk"] +[ext_resource type="Script" uid="uid://c0ov2bq5er0gh" path="res://scripts/components/plants/LoseZone.cs" id="16_r81g1"] +[ext_resource type="Script" uid="uid://812ldoyxd5n5" path="res://scripts/components/level/LoseCheckbox.cs" id="17_pb02i"] + +[sub_resource type="Animation" id="Animation_h1ksq"] +resource_name = "fade" +length = 4.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Fade:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Fade/Brainz:self_modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 1.6, 2.2), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Fade:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0.0333333), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("VBoxContainer:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0.0333333), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("VBoxContainer:modulate") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0, 2.96667, 4), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 0, +"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)] +} + +[sub_resource type="Animation" id="Animation_r81g1"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Fade:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Fade/Brainz:self_modulate") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Fade:visible") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("VBoxContainer:visible") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath("VBoxContainer:modulate") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_pb02i"] +_data = { +&"RESET": SubResource("Animation_r81g1"), +&"fade": SubResource("Animation_h1ksq") +} + +[sub_resource type="AtlasTexture" id="AtlasTexture_tsy2s"] +atlas = ExtResource("9_jmik4") +region = Rect2(255, 221, 118, 20) + +[sub_resource type="AtlasTexture" id="AtlasTexture_63iib"] +atlas = ExtResource("9_jmik4") +region = Rect2(194, 221, 61, 20) + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_pb02i"] +size = Vector2(244, 399) [sub_resource type="Curve" id="Curve_1kjp6"] _limits = [0.0, 5.0, 0.0, 2000.0] @@ -22,6 +172,9 @@ point_count = 6 [sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_3ghv7"] +[sub_resource type="RectangleShape2D" id="RectangleShape2D_r81g1"] +size = Vector2(282, 399) + [node name="PrototypeSurvival" type="Node2D"] [node name="Data" type="Node" parent="."] @@ -82,6 +235,71 @@ metadata/_edit_lock_ = true [node name="PauseMenu" parent="GUI" instance=ExtResource("7_3ghv7")] visible = false +[node name="GameOverScreen" type="CanvasLayer" parent="."] +process_mode = 3 +layer = 11 + +[node name="Fade" type="ColorRect" parent="GameOverScreen"] +visible = false +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) + +[node name="Brainz" type="TextureRect" parent="GameOverScreen/Fade"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = 141.0 +offset_top = 146.0 +offset_right = -143.0 +offset_bottom = -137.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("8_h1ksq") + +[node name="AnimationPlayer" type="AnimationPlayer" parent="GameOverScreen"] +libraries = { +&"": SubResource("AnimationLibrary_pb02i") +} + +[node name="VBoxContainer" type="VBoxContainer" parent="GameOverScreen"] +visible = false +offset_left = 230.0 +offset_top = 273.0 +offset_right = 372.0 +offset_bottom = 365.0 + +[node name="RestartButton" type="Button" parent="GameOverScreen/VBoxContainer"] +layout_mode = 2 +icon = SubResource("AtlasTexture_tsy2s") +icon_alignment = 1 +script = ExtResource("10_4il7a") + +[node name="ExitButton" type="Button" parent="GameOverScreen/VBoxContainer"] +layout_mode = 2 +icon = SubResource("AtlasTexture_63iib") +icon_alignment = 1 +script = ExtResource("11_q1dn6") + +[node name="GameOverZombie" type="CanvasLayer" parent="."] +process_mode = 3 +layer = 12 +follow_viewport_enabled = true + +[node name="LoseZone" type="Node2D" parent="GameOverZombie"] +script = ExtResource("16_r81g1") + +[node name="Hitbox" type="Area2D" parent="GameOverZombie/LoseZone"] +collision_layer = 2 + +[node name="CollisionShape2D" type="CollisionShape2D" parent="GameOverZombie/LoseZone/Hitbox"] +position = Vector2(122, 199.5) +shape = SubResource("RectangleShape2D_pb02i") + [node name="SunSpawner" type="Node" parent="."] script = ExtResource("7_gnb05") SunScene = ExtResource("8_8nyym") @@ -164,9 +382,15 @@ collision_mask = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="Lines/Floor5"] shape = SubResource("WorldBoundaryShape2D_3ghv7") -[node name="Marker2D" type="Marker2D" parent="."] -position = Vector2(191, 5) -gizmo_extents = 601.6 +[node name="Checkbox" type="Area2D" parent="." node_paths=PackedStringArray("gameOverLayer", "fadeAnimation")] +collision_mask = 24 +script = ExtResource("17_pb02i") +gameOverLayer = NodePath("../GameOverZombie") +fadeAnimation = NodePath("../GameOverScreen/AnimationPlayer") + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Checkbox"] +position = Vector2(141, 199.5) +shape = SubResource("RectangleShape2D_r81g1") [connection signal="timeout" from="SunSpawner/Timer" to="SunSpawner" method="Spawn"] [connection signal="timeout" from="ZombieSequencer/Timer" to="ZombieSequencer" method="FormSquad"] diff --git a/scripts/components/gui/ExitButton.cs b/scripts/components/gui/ExitButton.cs new file mode 100644 index 0000000..05c1351 --- /dev/null +++ b/scripts/components/gui/ExitButton.cs @@ -0,0 +1,10 @@ +using Godot; +using System; + +public partial class ExitButton : Button +{ + public override void _Pressed() + { + GetTree().Quit(); + } +} diff --git a/scripts/components/gui/ExitButton.cs.uid b/scripts/components/gui/ExitButton.cs.uid new file mode 100644 index 0000000..1b08775 --- /dev/null +++ b/scripts/components/gui/ExitButton.cs.uid @@ -0,0 +1 @@ +uid://dpdpv2oyxdna7 diff --git a/scripts/components/gui/PauseMenu.cs b/scripts/components/gui/PauseMenu.cs index 75fa61f..66baca1 100644 --- a/scripts/components/gui/PauseMenu.cs +++ b/scripts/components/gui/PauseMenu.cs @@ -21,8 +21,7 @@ public partial class PauseMenu : Control } public void Exit() { - GetNode("Audio").Play(); - GetNode("Audio").Finished += () => { GetTree().Quit(); }; + GetTree().Quit(); } public static void Pause() { diff --git a/scripts/components/gui/RestartButton.cs b/scripts/components/gui/RestartButton.cs new file mode 100644 index 0000000..53bc70e --- /dev/null +++ b/scripts/components/gui/RestartButton.cs @@ -0,0 +1,12 @@ +using Godot; +using System; + +public partial class RestartButton : Button +{ + public override void _Pressed() + { + GetTree().Paused = false; + GetTree().ReloadCurrentScene(); + } + +} diff --git a/scripts/components/gui/RestartButton.cs.uid b/scripts/components/gui/RestartButton.cs.uid new file mode 100644 index 0000000..062cc44 --- /dev/null +++ b/scripts/components/gui/RestartButton.cs.uid @@ -0,0 +1 @@ +uid://btqwxelqxheh3 diff --git a/scripts/components/level/LoseCheckbox.cs b/scripts/components/level/LoseCheckbox.cs new file mode 100644 index 0000000..2ff8516 --- /dev/null +++ b/scripts/components/level/LoseCheckbox.cs @@ -0,0 +1,31 @@ +using Godot; +using Newlon.Components.Zombies; + +namespace Newlon.Components.Level; + +public partial class LoseCheckbox : Area2D +{ + [Export] private CanvasLayer gameOverLayer; + [Export] private AnimationPlayer fadeAnimation; + public override void _Ready() + { + AreaEntered += OnAreaEntered; + } + + private void OnAreaEntered(Area2D area) + { + var parent = area.GetParent(); + if (parent != null && parent is RuntimeZombieData zombieData) + { + Engine.TimeScale = 1.0; + fadeAnimation.Play("fade"); + GetTree().Paused = true; + PhysicsServer2D.SetActive(true); + Callable.From(()=> + { + zombieData.Reparent(gameOverLayer); + }).CallDeferred(); + + } + } +} diff --git a/scripts/components/level/LoseCheckbox.cs.uid b/scripts/components/level/LoseCheckbox.cs.uid new file mode 100644 index 0000000..c9602d7 --- /dev/null +++ b/scripts/components/level/LoseCheckbox.cs.uid @@ -0,0 +1 @@ +uid://812ldoyxd5n5 diff --git a/scripts/components/plants/LoseZone.cs b/scripts/components/plants/LoseZone.cs new file mode 100644 index 0000000..53e71fa --- /dev/null +++ b/scripts/components/plants/LoseZone.cs @@ -0,0 +1,17 @@ +using Godot; + +namespace Newlon.Components.Plants; + +public partial class LoseZone : RuntimePlantData +{ + public override void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL) + { + + } + + public override void Kill() + { + + } + +} diff --git a/scripts/components/plants/LoseZone.cs.uid b/scripts/components/plants/LoseZone.cs.uid new file mode 100644 index 0000000..a185f15 --- /dev/null +++ b/scripts/components/plants/LoseZone.cs.uid @@ -0,0 +1 @@ +uid://c0ov2bq5er0gh diff --git a/scripts/components/plants/RuntimePlantData.cs b/scripts/components/plants/RuntimePlantData.cs index 0251fca..1bce80d 100644 --- a/scripts/components/plants/RuntimePlantData.cs +++ b/scripts/components/plants/RuntimePlantData.cs @@ -25,7 +25,7 @@ public partial class RuntimePlantData : Node2D, IEntity _hp = _maxHP; } - public void Heal(int amount, Node origin) + public virtual void Heal(int amount, Node origin) { _hp += amount; @@ -37,7 +37,7 @@ public partial class RuntimePlantData : Node2D, IEntity } } - public void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL) + public virtual void TakeDamage(int amount, Node origin, Utility.DamageTypes damageType = Utility.DamageTypes.PHYSICAL) { _hp -= amount; @@ -48,18 +48,18 @@ public partial class RuntimePlantData : Node2D, IEntity Kill(); } } - public void Kill() + public virtual void Kill() { PoolContainer.Instance.EntityField[Resource.Layer].Remove(GlobalPosition); QueueFree(); } - public void DisableBrain() + public virtual void DisableBrain() { GetNode("Behaviour").ProcessMode = ProcessModeEnum.Disabled; } - public void EnableBrain() + public virtual void EnableBrain() { GetNode("Behaviour").ProcessMode = ProcessModeEnum.Inherit; }