Initial commit

This commit is contained in:
Фёдор Веселов 2024-09-08 00:45:50 +05:00
commit c266d22f58
85 changed files with 1649 additions and 0 deletions

51
scenes/debug_lvl.tscn Normal file
View file

@ -0,0 +1,51 @@
[gd_scene load_steps=7 format=3 uid="uid://crxsvv7drckpw"]
[ext_resource type="Script" path="res://scripts/components/level/RuntimeLevelData.cs" id="1_i3bf5"]
[ext_resource type="Texture2D" uid="uid://b0tb2hjum40aw" path="res://assets/sprites/summertime_saga.png" id="2_vmxhy"]
[ext_resource type="PackedScene" uid="uid://cg8713v6c5w15" path="res://scenes/pools.tscn" id="3_jv7x4"]
[ext_resource type="PackedScene" uid="uid://be1kgukmiu0hs" path="res://scenes/entities/plants/peashooter.tscn" id="4_esyy7"]
[ext_resource type="PackedScene" uid="uid://co11v3w8hbwgf" path="res://scenes/entities/Zombies/zombie.tscn" id="5_5jekn"]
[ext_resource type="PackedScene" uid="uid://cfnmspei3k4p7" path="res://scenes/gui/runtime_gui.tscn" id="6_0baou"]
[node name="debug_lvl" type="Node2D"]
[node name="SummertimeSaga" type="Sprite2D" parent="."]
position = Vector2(500, 200)
texture = ExtResource("2_vmxhy")
metadata/_edit_lock_ = true
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(481, 200)
metadata/_edit_lock_ = true
[node name="RuntimeLevelData" type="Node" parent="."]
script = ExtResource("1_i3bf5")
[node name="Pools" parent="." instance=ExtResource("3_jv7x4")]
[node name="Peashooter" parent="." instance=ExtResource("4_esyy7")]
position = Vector2(379, 105)
_line = 4
[node name="Peashooter2" parent="." instance=ExtResource("4_esyy7")]
position = Vector2(431, 162)
_line = 3
[node name="Peashooter3" parent="." instance=ExtResource("4_esyy7")]
position = Vector2(480, 224)
_line = 2
[node name="Peashooter4" parent="." instance=ExtResource("4_esyy7")]
position = Vector2(531, 283)
_line = 1
[node name="Peashooter5" parent="." instance=ExtResource("4_esyy7")]
position = Vector2(581, 345)
[node name="Zombie" parent="." instance=ExtResource("5_5jekn")]
position = Vector2(686, 191)
_line = 3
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="RuntimeGUI" parent="CanvasLayer" instance=ExtResource("6_0baou")]

View file

@ -0,0 +1,32 @@
[gd_scene load_steps=5 format=3 uid="uid://co11v3w8hbwgf"]
[ext_resource type="Script" path="res://scripts/components/zombies/RuntimeZombieData.cs" id="1_qq3f1"]
[ext_resource type="Texture2D" uid="uid://bwwbkybryi6k0" path="res://assets/sprites/zombie.tres" id="2_4pdxh"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_hxyad"]
size = Vector2(24, 84)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r4ug6"]
size = Vector2(20, 48)
[node name="Zombie" type="Node2D"]
script = ExtResource("1_qq3f1")
_maxHP = 100
[node name="Sprite" type="Sprite2D" parent="."]
position = Vector2(0, -44)
texture = ExtResource("2_4pdxh")
[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 4
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(2, -42)
shape = SubResource("RectangleShape2D_hxyad")
[node name="Eatbox" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Eatbox"]
position = Vector2(-10, -24)
shape = SubResource("RectangleShape2D_r4ug6")

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=3 uid="uid://b2hrv0aqbui7u"]
[ext_resource type="Script" path="res://scripts/LinearProjectile.cs" id="1_3kc4s"]
[ext_resource type="Texture2D" uid="uid://dq0mul65hevtt" path="res://assets/sprites/plants/pea.tres" id="2_26q5x"]
[sub_resource type="CircleShape2D" id="CircleShape2D_ix1sk"]
radius = 6.0
[node name="Pea" type="Area2D"]
collision_layer = 2
collision_mask = 4
script = ExtResource("1_3kc4s")
_speed = 3.0
[node name="Sprite" type="Sprite2D" parent="."]
texture = ExtResource("2_26q5x")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_ix1sk")
[node name="Timer" type="Timer" parent="."]
wait_time = 15.0
one_shot = true
autostart = true
[connection signal="area_entered" from="." to="." method="OnAreaEntered"]
[connection signal="timeout" from="Timer" to="." method="queue_free"]

View file

@ -0,0 +1,117 @@
[gd_scene load_steps=19 format=3 uid="uid://be1kgukmiu0hs"]
[ext_resource type="Texture2D" uid="uid://cksryh4w5dbbx" path="res://assets/sprites/atlases/plants/peashooter.png" id="1_cmjrw"]
[ext_resource type="Script" path="res://scripts/components/plants/RuntimePlantData.cs" id="1_f4h5i"]
[ext_resource type="AnimationLibrary" uid="uid://bv1dl1g4dmbho" path="res://resources/animations/plants/peashooter.res" id="2_vs0tj"]
[ext_resource type="Script" path="res://scripts/components/plants/Shooter.cs" id="4_sbggp"]
[ext_resource type="PackedScene" uid="uid://b2hrv0aqbui7u" path="res://scenes/entities/plants/pea.tscn" id="5_66an8"]
[ext_resource type="Script" path="res://scripts/components/plants/PlantEyesightLimiter.cs" id="6_0812i"]
[ext_resource type="Script" path="res://scripts/components/plants/behaviours/PeashooterBehaviour.cs" id="6_tdkoh"]
[ext_resource type="Script" path="res://scripts/components/plants/Eyesight.cs" id="7_fdkt2"]
[sub_resource type="Animation" id="Animation_pephc"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [0]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_djmlc"]
_data = {
"RESET": SubResource("Animation_pephc")
}
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_w1am6"]
animation = &"peashooter/idle"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_irqfm"]
animation = &"peashooter/shoot"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4oxpj"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_bjldt"]
advance_mode = 2
advance_condition = &"ready"
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_srdpm"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_8qsie"]
states/Start/position = Vector2(192, 100)
states/peashooter_idle/node = SubResource("AnimationNodeAnimation_w1am6")
states/peashooter_idle/position = Vector2(457, 91)
states/peashooter_shoot/node = SubResource("AnimationNodeAnimation_irqfm")
states/peashooter_shoot/position = Vector2(660, 91)
transitions = ["Start", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_4oxpj"), "peashooter_idle", "peashooter_shoot", SubResource("AnimationNodeStateMachineTransition_bjldt"), "peashooter_shoot", "peashooter_idle", SubResource("AnimationNodeStateMachineTransition_srdpm")]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4stx8"]
size = Vector2(26, 48)
[sub_resource type="SegmentShape2D" id="SegmentShape2D_v570y"]
resource_local_to_scene = true
b = Vector2(5.865, 0)
[node name="Peashooter" type="Node2D"]
script = ExtResource("1_f4h5i")
[node name="Sprite" type="Sprite2D" parent="."]
texture = ExtResource("1_cmjrw")
hframes = 2
vframes = 10
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_djmlc"),
"peashooter": ExtResource("2_vs0tj")
}
[node name="AnimationTree" type="AnimationTree" parent="."]
tree_root = SubResource("AnimationNodeStateMachine_8qsie")
anim_player = NodePath("../AnimationPlayer")
parameters/conditions/ready = false
[node name="Hitbox" type="Area2D" parent="."]
collision_layer = 2
collision_mask = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="Hitbox"]
position = Vector2(0, 4)
shape = SubResource("RectangleShape2D_4stx8")
[node name="Shooter" type="Node2D" parent="." node_paths=PackedStringArray("_timer")]
position = Vector2(17, -4)
script = ExtResource("4_sbggp")
_projectile = ExtResource("5_66an8")
_timer = NodePath("Timer")
[node name="Timer" type="Timer" parent="Shooter"]
wait_time = 1.5
one_shot = true
[node name="Behaviour" type="Node" parent="." node_paths=PackedStringArray("_animationTree", "_shootTimer", "_sight")]
script = ExtResource("6_tdkoh")
_animationTree = NodePath("../AnimationTree")
_shootTimer = NodePath("../Shooter/Timer")
_sight = NodePath("../Eyesight")
[node name="Eyesight" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 4
script = ExtResource("7_fdkt2")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Eyesight"]
shape = SubResource("SegmentShape2D_v570y")
script = ExtResource("6_0812i")
[connection signal="area_entered" from="Eyesight" to="Eyesight" method="OnAreaEntered"]
[connection signal="area_exited" from="Eyesight" to="Eyesight" method="OnAreaExited"]

View file

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=3 uid="uid://cgm7td1hgs0rr"]
[ext_resource type="Texture2D" uid="uid://bjsar1x67xk1t" path="res://assets/sprites/gui/FastForward1.tres" id="1_ta3h7"]
[node name="FastForwardButton" type="TextureButton"]
anchors_preset = -1
anchor_right = 0.06
anchor_bottom = 0.09
size_flags_vertical = 4
mouse_default_cursor_shape = 2
texture_normal = ExtResource("1_ta3h7")
stretch_mode = 0

View file

@ -0,0 +1,13 @@
[gd_scene load_steps=2 format=3 uid="uid://u5l3jd00s8vd"]
[ext_resource type="Texture2D" uid="uid://dm0hjd67a6mva" path="res://assets/sprites/gui/Pause.tres" id="1_7k3tg"]
[node name="PauseButton" type="TextureButton"]
anchors_preset = -1
anchor_right = 0.067
anchor_bottom = 0.1
offset_right = -0.200001
size_flags_vertical = 4
mouse_default_cursor_shape = 2
texture_normal = ExtResource("1_7k3tg")
stretch_mode = 0

View file

@ -0,0 +1,38 @@
[gd_scene load_steps=4 format=3 uid="uid://c8qru1yhnbbkl"]
[ext_resource type="Texture2D" uid="uid://cmgaryx5wgu14" path="res://assets/sprites/gui/PlantCard.tres" id="1_fugf5"]
[ext_resource type="Texture2D" uid="uid://cabpf23ndlvx0" path="res://assets/sprites/gui/Selection.tres" id="2_5mpv8"]
[sub_resource type="LabelSettings" id="LabelSettings_js4li"]
font_size = 13
font_color = Color(0, 0, 0, 1)
[node name="PlantCard" type="TextureButton"]
anchors_preset = -1
anchor_right = 0.137
anchor_bottom = 0.28
offset_right = -0.200005
mouse_default_cursor_shape = 2
texture_normal = ExtResource("1_fugf5")
texture_pressed = ExtResource("2_5mpv8")
texture_focused = ExtResource("2_5mpv8")
stretch_mode = 0
metadata/_edit_use_anchors_ = true
[node name="Label" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.146
anchor_top = 0.732
anchor_right = 0.854
anchor_bottom = 0.893
offset_left = 0.0279989
offset_top = 0.0159912
offset_right = -0.0279999
offset_bottom = -0.0160065
grow_horizontal = 2
grow_vertical = 2
label_settings = SubResource("LabelSettings_js4li")
horizontal_alignment = 1
vertical_alignment = 1
text_overrun_behavior = 3

View file

@ -0,0 +1,67 @@
[gd_scene load_steps=6 format=3 uid="uid://cfnmspei3k4p7"]
[ext_resource type="PackedScene" uid="uid://ky35veswaytr" path="res://scenes/gui/sun_counter.tscn" id="1_le3od"]
[ext_resource type="PackedScene" uid="uid://c8qru1yhnbbkl" path="res://scenes/gui/plant_card.tscn" id="2_cjtsw"]
[ext_resource type="PackedScene" uid="uid://t0vpmycj6c8j" path="res://scenes/gui/shovel_button.tscn" id="3_bheea"]
[ext_resource type="PackedScene" uid="uid://cgm7td1hgs0rr" path="res://scenes/gui/fast_forward_button.tscn" id="4_66uy4"]
[ext_resource type="PackedScene" uid="uid://u5l3jd00s8vd" path="res://scenes/gui/pause_button.tscn" id="5_jyq78"]
[node name="RuntimeGUI" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Hotbar" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 0.14
offset_bottom = -29.0
grow_horizontal = 2
metadata/_edit_use_anchors_ = true
[node name="SunCounter" parent="Hotbar" instance=ExtResource("1_le3od")]
layout_mode = 2
[node name="Seedpackets" type="HBoxContainer" parent="Hotbar"]
layout_mode = 2
theme_override_constants/separation = 0
[node name="PlantCard" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard2" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard3" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard4" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard5" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard6" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard7" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard8" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="PlantCard9" parent="Hotbar/Seedpackets" instance=ExtResource("2_cjtsw")]
layout_mode = 2
[node name="ShovelButton" parent="Hotbar" instance=ExtResource("3_bheea")]
layout_mode = 2
[node name="FastForwardButton" parent="Hotbar" instance=ExtResource("4_66uy4")]
layout_mode = 2
[node name="PauseButton" parent="Hotbar" instance=ExtResource("5_jyq78")]
layout_mode = 2

View file

@ -0,0 +1,15 @@
[gd_scene load_steps=2 format=3 uid="uid://t0vpmycj6c8j"]
[ext_resource type="Texture2D" uid="uid://cw73vihkrfenc" path="res://assets/sprites/gui/Shovel.tres" id="1_46afk"]
[node name="ShovelButton" type="TextureButton"]
anchors_preset = -1
anchor_right = 0.085
anchor_bottom = 0.117
offset_right = -11.0
offset_bottom = -6.8
size_flags_horizontal = 4
size_flags_vertical = 0
mouse_default_cursor_shape = 2
texture_normal = ExtResource("1_46afk")
stretch_mode = 0

View file

@ -0,0 +1,49 @@
[gd_scene load_steps=5 format=3 uid="uid://ky35veswaytr"]
[ext_resource type="Texture2D" uid="uid://bhp3vuvwf7lak" path="res://assets/sprites/gui/suncounter.tres" id="1_e5x4k"]
[ext_resource type="Texture2D" uid="uid://c47rflkf2wap0" path="res://assets/sprites/sun.tres" id="2_gugre"]
[ext_resource type="Script" path="res://scripts/components/gui/SunCounter.cs" id="3_qhmb8"]
[sub_resource type="LabelSettings" id="LabelSettings_lxkq5"]
font_size = 10
font_color = Color(0, 0, 0, 1)
[node name="SunCounter" type="TextureRect"]
anchors_preset = -1
anchor_right = 0.082
anchor_bottom = 0.067
offset_right = -0.200001
offset_bottom = 0.199999
size_flags_vertical = 0
texture = ExtResource("1_e5x4k")
[node name="Sun" type="TextureRect" parent="."]
show_behind_parent = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.5
anchor_top = 1.019
anchor_right = 0.5
anchor_bottom = 1.019
offset_left = -22.5
offset_top = -22.513
offset_right = 22.5
offset_bottom = 22.487
texture = ExtResource("2_gugre")
[node name="Label" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.122
anchor_top = 0.222
anchor_right = 0.878
anchor_bottom = 0.778
offset_left = 0.0219994
offset_top = 0.00599957
offset_right = -0.0219994
offset_bottom = -0.00600243
label_settings = SubResource("LabelSettings_lxkq5")
horizontal_alignment = 1
vertical_alignment = 1
text_overrun_behavior = 3
script = ExtResource("3_qhmb8")

View file

@ -0,0 +1,3 @@
[gd_scene format=3 uid="uid://dd3yegl1xo44m"]
[node name="level_template" type="Node2D"]

18
scenes/pools.tscn Normal file
View file

@ -0,0 +1,18 @@
[gd_scene load_steps=2 format=3 uid="uid://cg8713v6c5w15"]
[ext_resource type="Script" path="res://scripts/components/level/PoolContainer.cs" id="1_31ggc"]
[node name="Pools" type="Node" node_paths=PackedStringArray("Zombies", "Plants", "Projectiles", "Structures")]
script = ExtResource("1_31ggc")
Zombies = NodePath("Zombies")
Plants = NodePath("Plants")
Projectiles = NodePath("Projectiles")
Structures = NodePath("Structures")
[node name="Zombies" type="Node" parent="."]
[node name="Plants" type="Node" parent="."]
[node name="Projectiles" type="Node" parent="."]
[node name="Structures" type="Node" parent="."]