droppable items and win
This commit is contained in:
parent
0f6445d677
commit
5bdbfa4d82
47 changed files with 820 additions and 85 deletions
|
|
@ -10,6 +10,7 @@ public partial class AdventureLevelResource : Resource
|
|||
[Export(PropertyHint.Range, "0,1,0.01")] public float wavePercentage;
|
||||
[Export] public float standardWaveDelay;
|
||||
[Export] public float initialWaveDelay;
|
||||
[Export] public RewardResource reward;
|
||||
[Export] public Array<WaveData> waves;
|
||||
[Export] public Array<PackedScene> initialScenes = [.. new PackedScene[45]];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ isHugeWave = true
|
|||
|
||||
[resource]
|
||||
script = ExtResource("1_qb1ge")
|
||||
startSun = 50.0
|
||||
startSun = 50
|
||||
wavePercentage = 0.5
|
||||
standardWaveDelay = 5.0
|
||||
initialWaveDelay = 20.0
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=12 format=3 uid="uid://ds2js2vylygvy"]
|
||||
[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=13 format=3 uid="uid://ds2js2vylygvy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bximdujbkj2n4" path="res://addons/pvzadventure/AdventureLevelResource.cs" id="1_gpqmh"]
|
||||
[ext_resource type="Resource" uid="uid://cvbxosnd7cn5l" path="res://assets/rewards/SunflowerReward.tres" id="1_sw8bw"]
|
||||
[ext_resource type="Script" uid="uid://cw7yc3i2lgcja" path="res://addons/pvzadventure/WaveEvent.cs" id="2_pkoaj"]
|
||||
[ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="3_mtsmf"]
|
||||
[ext_resource type="Script" uid="uid://dl12rj75tk2qi" path="res://addons/pvzadventure/RowSpawn.cs" id="4_tpjav"]
|
||||
|
|
@ -32,9 +33,10 @@ isHugeWave = false
|
|||
|
||||
[resource]
|
||||
script = ExtResource("1_gpqmh")
|
||||
startSun = 50
|
||||
startSun = 150
|
||||
wavePercentage = 0.0
|
||||
standardWaveDelay = 20.0
|
||||
initialWaveDelay = 10.0
|
||||
reward = ExtResource("1_sw8bw")
|
||||
waves = [SubResource("Resource_swlbc"), SubResource("Resource_pkoaj")]
|
||||
initialScenes = Array[PackedScene]([null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null])
|
||||
|
|
|
|||
13
assets/rewards/AloeReward.tres
Normal file
13
assets/rewards/AloeReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://co53dl5pxc0nr"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://bf7vjtufjc8kt" path="res://assets/plants/Aloe.tres" id="1_v5yns"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_6fujh"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="3_0ahmi"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_0ahmi")
|
||||
Plant = ExtResource("1_v5yns")
|
||||
Scene = ExtResource("2_6fujh")
|
||||
Name = "aloe"
|
||||
Description = "rwd_aloe"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/CucumberReward.tres
Normal file
13
assets/rewards/CucumberReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://b7jjqhhb6cv7i"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="1_nwe4k"]
|
||||
[ext_resource type="Resource" uid="uid://ciewunnfalrbb" path="res://assets/plants/Cucumber.tres" id="1_y7bpw"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="2_y7bpw"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_y7bpw")
|
||||
Plant = ExtResource("1_y7bpw")
|
||||
Scene = ExtResource("1_nwe4k")
|
||||
Name = "cucumber"
|
||||
Description = "rwd_cucumber"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/GarlicReward.tres
Normal file
13
assets/rewards/GarlicReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://bhy1gc3vi8le1"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://btkkaow4tyw55" path="res://assets/plants/Garlic.tres" id="1_ti6wf"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_jsj0n"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="3_k120q"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_k120q")
|
||||
Plant = ExtResource("1_ti6wf")
|
||||
Scene = ExtResource("2_jsj0n")
|
||||
Name = "garlic"
|
||||
Description = "rwd_garlic"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/NerdusReward.tres
Normal file
13
assets/rewards/NerdusReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://c268ghdrraxgr"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://8edvnmwu4tyn" path="res://assets/plants/Nerdus.tres" id="1_aujky"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_oa88s"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="3_y1663"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_y1663")
|
||||
Plant = ExtResource("1_aujky")
|
||||
Scene = ExtResource("2_oa88s")
|
||||
Name = "nerdus"
|
||||
Description = "rwd_nerdus"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/PotatoMineReward.tres
Normal file
13
assets/rewards/PotatoMineReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://3qnpc64r3v3l"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="1_3td81"]
|
||||
[ext_resource type="Resource" uid="uid://bu25xgjd68gv8" path="res://assets/plants/PotatoMine.tres" id="1_pxrwk"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="2_pxrwk"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("2_pxrwk")
|
||||
Plant = ExtResource("1_pxrwk")
|
||||
Scene = ExtResource("1_3td81")
|
||||
Name = "potatomine"
|
||||
Description = "rwd_potatomine"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/SnowpeaReward.tres
Normal file
13
assets/rewards/SnowpeaReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://1xc5f4nnc75i"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://duflq3eexs6m" path="res://assets/plants/Snowpea.tres" id="1_llpxp"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_c26gh"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="3_xcfmg"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_xcfmg")
|
||||
Plant = ExtResource("1_llpxp")
|
||||
Scene = ExtResource("2_c26gh")
|
||||
Name = "snowpea"
|
||||
Description = "rwd_snowpea"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/SunflowerReward.tres
Normal file
13
assets/rewards/SunflowerReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://cvbxosnd7cn5l"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="1_cc1yg"]
|
||||
[ext_resource type="Resource" uid="uid://drm42f48urvc4" path="res://assets/plants/Sunflower.tres" id="1_qduei"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_qxx0x"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_cc1yg")
|
||||
Plant = ExtResource("1_qduei")
|
||||
Scene = ExtResource("2_qxx0x")
|
||||
Name = "sunflower"
|
||||
Description = "rwd_sunflower"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/ThreepeaterReward.tres
Normal file
13
assets/rewards/ThreepeaterReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://c5rg8mq50wka2"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://bnhwg57euiyf5" path="res://assets/plants/Threepeater.tres" id="1_bcp4j"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_h66y0"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="3_2tva0"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_2tva0")
|
||||
Plant = ExtResource("1_bcp4j")
|
||||
Scene = ExtResource("2_h66y0")
|
||||
Name = "threepeater"
|
||||
Description = "rwd_threepeater"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
13
assets/rewards/WallnutReward.tres
Normal file
13
assets/rewards/WallnutReward.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantReward" load_steps=4 format=3 uid="uid://cqy84f0msdhof"]
|
||||
|
||||
[ext_resource type="Resource" uid="uid://c2e2yj7rgoswi" path="res://assets/plants/Wallnut.tres" id="1_wbjkr"]
|
||||
[ext_resource type="PackedScene" uid="uid://myjhi5m0eaap" path="res://scenes/templates/plant_reward.tscn" id="2_66qmw"]
|
||||
[ext_resource type="Script" uid="uid://c8e40t5nbo83r" path="res://scripts/resources/PlantReward.cs" id="3_iv5xe"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("3_iv5xe")
|
||||
Plant = ExtResource("1_wbjkr")
|
||||
Scene = ExtResource("2_66qmw")
|
||||
Name = "wallnut"
|
||||
Description = "rwd_wallnut"
|
||||
metadata/_custom_type_script = "uid://c8e40t5nbo83r"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 10 KiB |
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
[resource]
|
||||
atlas = ExtResource("1_3sdui")
|
||||
region = Rect2(0, 144, 170, 63)
|
||||
region = Rect2(0, 143, 170, 85)
|
||||
|
|
|
|||
BIN
assets/sprites/leafy_background.png
Normal file
BIN
assets/sprites/leafy_background.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 199 KiB |
34
assets/sprites/leafy_background.png.import
Normal file
34
assets/sprites/leafy_background.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://nc6t245565lu"
|
||||
path="res://.godot/imported/leafy_background.png-76728ff4c19f7ae660721d899dcd7ad9.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/leafy_background.png"
|
||||
dest_files=["res://.godot/imported/leafy_background.png-76728ff4c19f7ae660721d899dcd7ad9.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
BIN
assets/sprites/leafy_background.pxc
Normal file
BIN
assets/sprites/leafy_background.pxc
Normal file
Binary file not shown.
80
scenes/droppables/plant/droppable_peashooter.tscn
Normal file
80
scenes/droppables/plant/droppable_peashooter.tscn
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bmn3ef86xi7e5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://gymo10tjruj2" path="res://scripts/droppable-items/DroppableSeedpacket.cs" id="1_a3ea7"]
|
||||
[ext_resource type="Texture2D" uid="uid://dxyf557m4mq1p" path="res://assets/sprites/gui/EmptyPlantCard.png" id="2_7ixh2"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_scv3y"]
|
||||
resource_local_to_scene = true
|
||||
font_size = 13
|
||||
font_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2c7xr"]
|
||||
size = Vector2(41, 56)
|
||||
|
||||
[node name="PlantReward" type="Area2D" node_paths=PackedStringArray("_cost", "_icon", "_packet")]
|
||||
script = ExtResource("1_a3ea7")
|
||||
_cost = NodePath("Seedpacket/Cost")
|
||||
_icon = NodePath("Seedpacket/PlantPreviewContainer/Preview")
|
||||
_packet = NodePath("Seedpacket")
|
||||
|
||||
[node name="Seedpacket" type="TextureRect" parent="."]
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.137
|
||||
anchor_bottom = 0.28
|
||||
offset_left = -20.5
|
||||
offset_top = -28.0
|
||||
offset_right = 20.5
|
||||
offset_bottom = 28.0
|
||||
mouse_default_cursor_shape = 2
|
||||
texture = ExtResource("2_7ixh2")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Cost" type="Label" parent="Seedpacket"]
|
||||
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_scv3y")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="PlantPreviewContainer" type="Control" parent="Seedpacket"]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchor_left = -0.061
|
||||
anchor_top = -0.036
|
||||
anchor_right = 1.061
|
||||
anchor_bottom = 0.661
|
||||
offset_left = 0.00199986
|
||||
offset_top = 0.0320001
|
||||
offset_right = -0.0019989
|
||||
offset_bottom = -0.0319977
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Preview" type="TextureRect" parent="Seedpacket/PlantPreviewContainer"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.185
|
||||
anchor_top = 0.205
|
||||
anchor_right = 0.815
|
||||
anchor_bottom = 1.333
|
||||
offset_left = -0.0200005
|
||||
offset_top = 0.00999928
|
||||
offset_right = 0.0199966
|
||||
offset_bottom = 0.0259933
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_2c7xr")
|
||||
|
|
@ -41,57 +41,49 @@ _armor = NodePath("Armor")
|
|||
material = SubResource("ShaderMaterial_sat5k")
|
||||
|
||||
[node name="RightUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="1"]
|
||||
scale = Vector2(0.999832, 0.999832)
|
||||
|
||||
[node name="RightLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg" index="1"]
|
||||
scale = Vector2(0.999839, 0.999839)
|
||||
|
||||
[node name="RightFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/RightUpperLeg/RightLowerLeg" index="0"]
|
||||
scale = Vector2(0.999833, 0.999833)
|
||||
scale = Vector2(0.999835, 0.999835)
|
||||
|
||||
[node name="LeftUpperLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="2"]
|
||||
scale = Vector2(0.999836, 0.999836)
|
||||
scale = Vector2(0.999829, 0.999829)
|
||||
|
||||
[node name="LeftLowerLeg" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg" index="1"]
|
||||
scale = Vector2(0.999833, 0.999833)
|
||||
scale = Vector2(0.999834, 0.999834)
|
||||
|
||||
[node name="LeftFoot" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/LeftUpperLeg/LeftLowerLeg" index="1"]
|
||||
scale = Vector2(0.999823, 0.999823)
|
||||
scale = Vector2(0.999826, 0.999826)
|
||||
|
||||
[node name="Body" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt" index="3"]
|
||||
scale = Vector2(0.999828, 0.999828)
|
||||
|
||||
[node name="RightUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="0"]
|
||||
scale = Vector2(0.999827, 0.999827)
|
||||
|
||||
[node name="RightLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm" index="1"]
|
||||
scale = Vector2(0.999829, 0.999829)
|
||||
|
||||
[node name="RightLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm" index="1"]
|
||||
scale = Vector2(0.999826, 0.999826)
|
||||
|
||||
[node name="RightHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/RightUpperArm/RightLowerArm" index="0"]
|
||||
scale = Vector2(0.999832, 0.999832)
|
||||
scale = Vector2(0.999831, 0.999831)
|
||||
|
||||
[node name="Tie" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="2"]
|
||||
rotation = 0.13159
|
||||
skew = -0.000126362
|
||||
rotation = 0.134918
|
||||
skew = -0.000136733
|
||||
|
||||
[node name="Head" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="3"]
|
||||
scale = Vector2(0.99983, 0.99983)
|
||||
|
||||
[node name="Right_Eye" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="0"]
|
||||
position = Vector2(-16, -8)
|
||||
scale = Vector2(1, 1)
|
||||
|
||||
[node name="Left_Eye" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="1"]
|
||||
position = Vector2(-4, -9)
|
||||
scale = Vector2(1, 1)
|
||||
|
||||
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="2"]
|
||||
position = Vector2(-2.93758, 2.84233)
|
||||
rotation = 0.0189273
|
||||
scale = Vector2(0.999823, 0.999823)
|
||||
|
||||
[node name="Right_Eye" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="0"]
|
||||
position = Vector2(-16, -7.99999)
|
||||
|
||||
[node name="Left_Eye" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="1"]
|
||||
position = Vector2(-4, -8.99999)
|
||||
|
||||
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head/HeadParticle/Head" index="2"]
|
||||
position = Vector2(-3.00166, 2.9972)
|
||||
rotation = 0.0130933
|
||||
scale = Vector2(0.999837, 0.999837)
|
||||
|
||||
[node name="Jaw" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="1"]
|
||||
scale = Vector2(0.999824, 0.999824)
|
||||
scale = Vector2(0.999837, 0.999837)
|
||||
|
||||
[node name="Hat" type="RigidBody2D" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/Head" index="4" node_paths=PackedStringArray("data")]
|
||||
position = Vector2(-2.5, -13.5)
|
||||
|
|
@ -120,29 +112,24 @@ position = Vector2(1, -6)
|
|||
shape = SubResource("CircleShape2D_67t4t")
|
||||
|
||||
[node name="LeftUpperArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body" index="4"]
|
||||
scale = Vector2(0.999828, 0.999828)
|
||||
scale = Vector2(0.999825, 0.999825)
|
||||
|
||||
[node name="Left_Lower_Arm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile" index="0"]
|
||||
rotation = 0.151384
|
||||
scale = Vector2(0.999994, 0.999994)
|
||||
rotation = 0.126852
|
||||
|
||||
[node name="Left_Hand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/HandProjectile/Left_Lower_Arm" index="0"]
|
||||
position = Vector2(-0.99983, 12.9978)
|
||||
rotation = -0.08093
|
||||
scale = Vector2(0.999659, 0.999659)
|
||||
|
||||
[node name="LeftLowerArm" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm" index="2"]
|
||||
scale = Vector2(0.999824, 0.999824)
|
||||
rotation = -0.0559848
|
||||
scale = Vector2(0.999655, 0.999655)
|
||||
|
||||
[node name="LeftHand" parent="CanvasGroup/basic_zombie_walk/Zombie/Butt/Body/LeftUpperArm/LeftLowerArm" index="0"]
|
||||
scale = Vector2(0.999829, 0.999829)
|
||||
scale = Vector2(0.999825, 0.999825)
|
||||
|
||||
[node name="Eatbox" parent="." index="2"]
|
||||
_damage = SubResource("Resource_011r0")
|
||||
|
||||
[node name="Mover" parent="." index="4"]
|
||||
_speed = SubResource("Resource_b6mal")
|
||||
_speedControlMult = 1.73312
|
||||
_speedControlMult = 0.918428
|
||||
|
||||
[node name="HitPlayer" parent="." index="5"]
|
||||
playlist = Array[AudioStream]([ExtResource("7_0amn8"), ExtResource("7_67t4t")])
|
||||
|
|
|
|||
|
|
@ -73,7 +73,6 @@ MaxHP = 30.0
|
|||
texture = ExtResource("2_fwcda")
|
||||
hframes = 9
|
||||
vframes = 2
|
||||
frame = 3
|
||||
|
||||
[node name="AnimationPlayer" parent="." index="1"]
|
||||
libraries = {
|
||||
|
|
|
|||
|
|
@ -22,11 +22,10 @@ anchor_bottom = 1.0
|
|||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
tab_alignment = 1
|
||||
current_tab = 1
|
||||
current_tab = 0
|
||||
script = ExtResource("1_oy57w")
|
||||
|
||||
[node name="plants" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 0
|
||||
|
||||
|
|
@ -109,6 +108,7 @@ theme_override_colors/font_selected_color = Color(0, 0, 0, 1)
|
|||
bbcode_enabled = true
|
||||
|
||||
[node name="zombies" type="HBoxContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
metadata/_tab_index = 1
|
||||
|
||||
|
|
@ -139,12 +139,10 @@ size_flags_horizontal = 0
|
|||
size_flags_vertical = 0
|
||||
texture = ExtResource("1_1hnxi")
|
||||
|
||||
[node name="Previewport" type="SubViewport" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame" node_paths=PackedStringArray("title", "description", "_frameField")]
|
||||
[node name="Previewport" type="SubViewport" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame" node_paths=PackedStringArray("_frameField")]
|
||||
canvas_item_default_texture_filter = 0
|
||||
size = Vector2i(130, 130)
|
||||
script = ExtResource("2_ru62c")
|
||||
title = NodePath("../../../Label")
|
||||
description = NodePath("../../../../Description/ScrollContainer/RichTextLabel")
|
||||
_frameField = NodePath("CanvasLayer/Field")
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="zombies/Infobox/FrameAndTitle/VBoxContainer/Frame/Previewport"]
|
||||
|
|
|
|||
42
scenes/gui/frame.tscn
Normal file
42
scenes/gui/frame.tscn
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://disdegexxmcro"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dr8a0rx42o3qy" path="res://assets/sprites/gui/ChooseYourSeeds/PlantFrame.tres" id="1_hc23v"]
|
||||
[ext_resource type="Script" uid="uid://covbig00p22di" path="res://scripts/gui/choose_your_seeds/Previewport.cs" id="2_cf55k"]
|
||||
[ext_resource type="Texture2D" uid="uid://ksxucobpgv7n" path="res://assets/sprites/field.png" id="3_7j5d4"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_7yl8g"]
|
||||
viewport_path = NodePath("zombies/Infobox/FrameAndTitle/VBoxContainer/Frame/Previewport")
|
||||
|
||||
[node name="Frame" type="TextureRect"]
|
||||
clip_contents = true
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
texture = ExtResource("1_hc23v")
|
||||
|
||||
[node name="Previewport" type="SubViewport" parent="." node_paths=PackedStringArray("_frameField")]
|
||||
canvas_item_default_texture_filter = 0
|
||||
size = Vector2i(130, 130)
|
||||
script = ExtResource("2_cf55k")
|
||||
_frameField = NodePath("CanvasLayer/Field")
|
||||
|
||||
[node name="CanvasLayer" type="CanvasLayer" parent="Previewport"]
|
||||
layer = -10
|
||||
follow_viewport_enabled = true
|
||||
|
||||
[node name="Field" type="Sprite2D" parent="Previewport/CanvasLayer"]
|
||||
position = Vector2(0, 30)
|
||||
texture = ExtResource("3_7j5d4")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="Previewport"]
|
||||
position = Vector2(0, -45)
|
||||
|
||||
[node name="Render" type="TextureRect" parent="."]
|
||||
show_behind_parent = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("ViewportTexture_7yl8g")
|
||||
expand_mode = 1
|
||||
144
scenes/gui/reward_scene.tscn
Normal file
144
scenes/gui/reward_scene.tscn
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://cwck7e1tt057k"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cqlghusry0hej" path="res://scripts/gui/RewardScene.cs" id="1_rclqa"]
|
||||
[ext_resource type="Texture2D" uid="uid://nc6t245565lu" path="res://assets/sprites/leafy_background.png" id="1_uwg38"]
|
||||
[ext_resource type="Texture2D" uid="uid://bq8n778sk4qnv" path="res://assets/sprites/gui/almanach/frame.tres" id="2_hbmdt"]
|
||||
[ext_resource type="Texture2D" uid="uid://ksxucobpgv7n" path="res://assets/sprites/field.png" id="3_mbhdb"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_rclqa"]
|
||||
viewport_path = NodePath("PanelContainer/VBoxContainer/Frame/SubViewport")
|
||||
|
||||
[sub_resource type="Animation" id="Animation_rclqa"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ColorRect:color")
|
||||
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)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_mbhdb"]
|
||||
resource_name = "main"
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("ColorRect:color")
|
||||
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, 0.921569, 1), Color(1, 1, 0.92, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_rfkmu"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_rclqa"),
|
||||
&"main": SubResource("Animation_mbhdb")
|
||||
}
|
||||
|
||||
[node name="RewardScene" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_rclqa")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="Background" type="TextureRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_uwg38")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.285
|
||||
anchor_top = 0.105
|
||||
anchor_right = 0.713333
|
||||
anchor_bottom = 0.895
|
||||
offset_right = -3.05176e-05
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Frame" type="TextureRect" parent="PanelContainer/VBoxContainer"]
|
||||
clip_contents = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
texture = ExtResource("2_hbmdt")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="PanelContainer/VBoxContainer/Frame"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="Field" type="Sprite2D" parent="PanelContainer/VBoxContainer/Frame/SubViewport"]
|
||||
unique_name_in_owner = true
|
||||
texture = ExtResource("3_mbhdb")
|
||||
|
||||
[node name="Camera2D" type="Camera2D" parent="PanelContainer/VBoxContainer/Frame/SubViewport"]
|
||||
zoom = Vector2(0.75, 0.75)
|
||||
|
||||
[node name="ViewportTexture" type="TextureRect" parent="PanelContainer/VBoxContainer/Frame"]
|
||||
show_behind_parent = true
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = SubResource("ViewportTexture_rclqa")
|
||||
|
||||
[node name="NameLabel" type="Label" parent="PanelContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="DescriptionPanel" type="PanelContainer" parent="PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
theme_type_variation = &"description_panel_container"
|
||||
|
||||
[node name="DescriptionLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/DescriptionPanel"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/default_color = Color(0, 0, 0, 1)
|
||||
bbcode_enabled = true
|
||||
|
||||
[node name="ContinueButton" type="Button" parent="PanelContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "continue"
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_rfkmu")
|
||||
}
|
||||
autoplay = "main"
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=41 format=3 uid="uid://dd3yegl1xo44m"]
|
||||
[gd_scene load_steps=42 format=3 uid="uid://dd3yegl1xo44m"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bndu1h5kgcde8" path="res://scripts/level/RuntimeLevelData.cs" id="1_31ltw"]
|
||||
[ext_resource type="Script" uid="uid://bso32xkw738sy" path="res://scripts/level/PoolContainer.cs" id="2_s5sti"]
|
||||
|
|
@ -281,7 +281,7 @@ length = 0.001
|
|||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Fade:self_modulate")
|
||||
tracks/0/path = NodePath("LooseFade:self_modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
|
|
@ -293,7 +293,7 @@ tracks/0/keys = {
|
|||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Fade/Brainz:self_modulate")
|
||||
tracks/1/path = NodePath("LooseFade/Brainz:self_modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
|
|
@ -305,7 +305,7 @@ tracks/1/keys = {
|
|||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Fade:visible")
|
||||
tracks/2/path = NodePath("LooseFade:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
|
|
@ -338,6 +338,18 @@ tracks/4/keys = {
|
|||
"update": 0,
|
||||
"values": [Color(1, 1, 1, 1)]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/path = NodePath("WinFade:color")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/keys = {
|
||||
"times": PackedFloat32Array(0),
|
||||
"transitions": PackedFloat32Array(1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 0.92, 0)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_h1ksq"]
|
||||
resource_name = "fade"
|
||||
|
|
@ -345,7 +357,7 @@ length = 4.0
|
|||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Fade:self_modulate")
|
||||
tracks/0/path = NodePath("LooseFade:self_modulate")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
|
|
@ -357,7 +369,7 @@ tracks/0/keys = {
|
|||
tracks/1/type = "value"
|
||||
tracks/1/imported = false
|
||||
tracks/1/enabled = true
|
||||
tracks/1/path = NodePath("Fade/Brainz:self_modulate")
|
||||
tracks/1/path = NodePath("LooseFade/Brainz:self_modulate")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
|
|
@ -369,7 +381,7 @@ tracks/1/keys = {
|
|||
tracks/2/type = "value"
|
||||
tracks/2/imported = false
|
||||
tracks/2/enabled = true
|
||||
tracks/2/path = NodePath("Fade:visible")
|
||||
tracks/2/path = NodePath("LooseFade:visible")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/keys = {
|
||||
|
|
@ -403,10 +415,27 @@ tracks/4/keys = {
|
|||
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="Animation" id="Animation_y72yf"]
|
||||
resource_name = "win"
|
||||
length = 5.0
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("WinFade:color")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
"times": PackedFloat32Array(0, 4, 5),
|
||||
"transitions": PackedFloat32Array(1, 1, 1),
|
||||
"update": 0,
|
||||
"values": [Color(1, 1, 0.92, 0), Color(1, 1, 0.92, 0), Color(1, 1, 0.92, 1)]
|
||||
}
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_pb02i"]
|
||||
_data = {
|
||||
&"RESET": SubResource("Animation_r81g1"),
|
||||
&"fade": SubResource("Animation_h1ksq")
|
||||
&"loose": SubResource("Animation_h1ksq"),
|
||||
&"win": SubResource("Animation_y72yf")
|
||||
}
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_y5tw7"]
|
||||
|
|
@ -531,6 +560,10 @@ follow_viewport_enabled = true
|
|||
|
||||
[node name="FieldController" parent="Overlay" instance=ExtResource("2_w4oj7")]
|
||||
|
||||
[node name="RewardLayer" type="CanvasLayer" parent="."]
|
||||
layer = 10
|
||||
follow_viewport_enabled = true
|
||||
|
||||
[node name="GUI" type="CanvasLayer" parent="."]
|
||||
layer = 10
|
||||
|
||||
|
|
@ -569,7 +602,7 @@ vertical_alignment = 1
|
|||
process_mode = 3
|
||||
layer = 11
|
||||
|
||||
[node name="Fade" type="ColorRect" parent="GameOverScreen"]
|
||||
[node name="LooseFade" type="ColorRect" parent="GameOverScreen"]
|
||||
visible = false
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
|
|
@ -578,18 +611,28 @@ grow_horizontal = 2
|
|||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
||||
|
||||
[node name="Brainz" type="TextureRect" parent="GameOverScreen/Fade"]
|
||||
[node name="Brainz" type="TextureRect" parent="GameOverScreen/LooseFade"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_left = 141.0
|
||||
offset_top = 146.0
|
||||
offset_top = 125.0
|
||||
offset_right = -143.0
|
||||
offset_bottom = -137.0
|
||||
offset_bottom = -116.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("7_482ps")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="WinFade" type="ColorRect" parent="GameOverScreen"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
color = Color(1, 1, 0.92, 0)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="GameOverScreen"]
|
||||
libraries = {
|
||||
|
|
@ -659,11 +702,13 @@ runner = NodePath("../LevelRunner")
|
|||
[node name="DelayTimer" type="Timer" parent="RowSpawner"]
|
||||
wait_time = 2.5
|
||||
|
||||
[node name="LevelRunner" type="Node" parent="." node_paths=PackedStringArray("rowSpawner", "waveTimer")]
|
||||
[node name="LevelRunner" type="Node" parent="." node_paths=PackedStringArray("rowSpawner", "waveTimer", "player", "rewardParent")]
|
||||
script = ExtResource("23_8vb7v")
|
||||
rowSpawner = NodePath("../RowSpawner")
|
||||
waveTimer = NodePath("WaveTimer")
|
||||
approachNotificationTime = 5.0
|
||||
player = NodePath("../GameOverScreen/AnimationPlayer")
|
||||
rewardParent = NodePath("../RewardLayer")
|
||||
|
||||
[node name="WaveTimer" type="Timer" parent="LevelRunner"]
|
||||
one_shot = true
|
||||
|
|
|
|||
80
scenes/templates/plant_reward.tscn
Normal file
80
scenes/templates/plant_reward.tscn
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://myjhi5m0eaap"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://gymo10tjruj2" path="res://scripts/droppable-items/DroppableSeedpacket.cs" id="1_rir1v"]
|
||||
[ext_resource type="Texture2D" uid="uid://dxyf557m4mq1p" path="res://assets/sprites/gui/EmptyPlantCard.png" id="2_wupw1"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_scv3y"]
|
||||
resource_local_to_scene = true
|
||||
font_size = 13
|
||||
font_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_2c7xr"]
|
||||
size = Vector2(41, 56)
|
||||
|
||||
[node name="PlantReward" type="Area2D" node_paths=PackedStringArray("_cost", "_icon", "_packet")]
|
||||
script = ExtResource("1_rir1v")
|
||||
_cost = NodePath("Seedpacket/Cost")
|
||||
_icon = NodePath("Seedpacket/PlantPreviewContainer/Preview")
|
||||
_packet = NodePath("Seedpacket")
|
||||
|
||||
[node name="Seedpacket" type="TextureRect" parent="."]
|
||||
anchors_preset = -1
|
||||
anchor_right = 0.137
|
||||
anchor_bottom = 0.28
|
||||
offset_left = -20.5
|
||||
offset_top = -28.0
|
||||
offset_right = 20.5
|
||||
offset_bottom = 28.0
|
||||
mouse_default_cursor_shape = 2
|
||||
texture = ExtResource("2_wupw1")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="Cost" type="Label" parent="Seedpacket"]
|
||||
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_scv3y")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="PlantPreviewContainer" type="Control" parent="Seedpacket"]
|
||||
clip_contents = true
|
||||
layout_mode = 1
|
||||
anchor_left = -0.061
|
||||
anchor_top = -0.036
|
||||
anchor_right = 1.061
|
||||
anchor_bottom = 0.661
|
||||
offset_left = 0.00199986
|
||||
offset_top = 0.0320001
|
||||
offset_right = -0.0019989
|
||||
offset_bottom = -0.0319977
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="Preview" type="TextureRect" parent="Seedpacket/PlantPreviewContainer"]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.185
|
||||
anchor_top = 0.205
|
||||
anchor_right = 0.815
|
||||
anchor_bottom = 1.333
|
||||
offset_left = -0.0200005
|
||||
offset_top = 0.00999928
|
||||
offset_right = 0.0199966
|
||||
offset_bottom = 0.0259933
|
||||
mouse_filter = 2
|
||||
mouse_default_cursor_shape = 2
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
shape = SubResource("RectangleShape2D_2c7xr")
|
||||
1
scripts/droppable-items/DropMover.cs.uid
Normal file
1
scripts/droppable-items/DropMover.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b2j41pq6cmpgm
|
||||
17
scripts/droppable-items/DroppableItem.cs
Normal file
17
scripts/droppable-items/DroppableItem.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using Godot;
|
||||
|
||||
|
||||
[GlobalClass]
|
||||
public abstract partial class DroppableItem : Area2D
|
||||
{
|
||||
[Signal] public delegate void PickedUpEventHandler();
|
||||
public override void _InputEvent(Viewport viewport, InputEvent @event, int shapeIdx)
|
||||
{
|
||||
if (@event.IsActionPressed("primary_action"))
|
||||
{
|
||||
PickUp();
|
||||
}
|
||||
}
|
||||
public abstract void PickUp();
|
||||
|
||||
}
|
||||
1
scripts/droppable-items/DroppableItem.cs.uid
Normal file
1
scripts/droppable-items/DroppableItem.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cwf2y3pxi6psc
|
||||
25
scripts/droppable-items/DroppableSeedpacket.cs
Normal file
25
scripts/droppable-items/DroppableSeedpacket.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
|
||||
public partial class DroppableSeedpacket : DroppableItem
|
||||
{
|
||||
public PlantResource plant;
|
||||
[Export] private Label _cost;
|
||||
[Export] private TextureRect _icon;
|
||||
[Export] private TextureRect _packet;
|
||||
public override void _Ready()
|
||||
{
|
||||
_cost.Text = plant.Cost.ToString();
|
||||
_icon.Texture = plant.Preview;
|
||||
if (plant.customFrame != null)
|
||||
{
|
||||
_packet.Texture = plant.customFrame.frame;
|
||||
_cost.LabelSettings = plant.customFrame.font;
|
||||
}
|
||||
}
|
||||
|
||||
public override void PickUp()
|
||||
{
|
||||
EmitSignal(SignalName.PickedUp);
|
||||
}
|
||||
}
|
||||
1
scripts/droppable-items/DroppableSeedpacket.cs.uid
Normal file
1
scripts/droppable-items/DroppableSeedpacket.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://gymo10tjruj2
|
||||
|
|
@ -1,9 +1,10 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
|
||||
public partial class ExitButton : Button
|
||||
{
|
||||
public override void _Pressed()
|
||||
{
|
||||
GetTree().ChangeSceneToFile("uid://bfstrli64u23y");
|
||||
LevelController.Instance.EndLevel();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Godot;
|
||||
using Newlon.Components.Level;
|
||||
|
||||
namespace Newlon.Components.GUI;
|
||||
|
||||
|
|
@ -12,10 +13,32 @@ public partial class FastForwardButton : Button
|
|||
|
||||
private int speed = 1;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
RuntimeLevelData.Instance.OnLevelStateChanged += OnLevelStateChanged;
|
||||
}
|
||||
|
||||
private void OnLevelStateChanged(RuntimeLevelData.LevelStates state)
|
||||
{
|
||||
if (state == RuntimeLevelData.LevelStates.Game) return;
|
||||
|
||||
speed = 1;
|
||||
Update();
|
||||
}
|
||||
|
||||
public void OnPressed()
|
||||
{
|
||||
speed = Mathf.Wrap(speed+1, 1, 4);
|
||||
if (RuntimeLevelData.Instance.GetLevelState() != RuntimeLevelData.LevelStates.Game) return;
|
||||
|
||||
speed = Mathf.Wrap(speed + 1, 1, 4);
|
||||
|
||||
flashAnimator.Play("flash");
|
||||
|
||||
Update();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
switch (speed)
|
||||
{
|
||||
case 1:
|
||||
|
|
@ -29,8 +52,6 @@ public partial class FastForwardButton : Button
|
|||
break;
|
||||
}
|
||||
|
||||
flashAnimator.Play("flash");
|
||||
|
||||
Engine.TimeScale = speed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public partial class PauseMenu : Control
|
|||
}
|
||||
public void Exit()
|
||||
{
|
||||
GetTree().ChangeSceneToFile("uid://bfstrli64u23y");
|
||||
LevelController.Instance.EndLevel();
|
||||
currently_paused = false;
|
||||
}
|
||||
public static void Pause()
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
using Godot;
|
||||
using System;
|
||||
using Newlon;
|
||||
|
||||
public partial class RestartButton : Button
|
||||
{
|
||||
public override void _Pressed()
|
||||
{
|
||||
GetTree().Paused = false;
|
||||
GetTree().ReloadCurrentScene();
|
||||
LevelController.Instance.RestartLevel();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
34
scripts/gui/RewardScene.cs
Normal file
34
scripts/gui/RewardScene.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
using Newlon.Components;
|
||||
using Newlon.Components.Plants;
|
||||
|
||||
public partial class RewardScene : Node
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
var reward = LevelController.Instance.Reward;
|
||||
var subviewport = GetNode<SubViewport>("%SubViewport");
|
||||
var nameLabel = GetNode<Label>("%NameLabel");
|
||||
var descriptionLabel = GetNode<RichTextLabel>("%DescriptionLabel");
|
||||
var continueButton = GetNode<Button>("%ContinueButton");
|
||||
var field = GetNode<Sprite2D>("%Field");
|
||||
|
||||
nameLabel.Text = Tr(reward.Name);
|
||||
descriptionLabel.Text = Tr(reward.Description);
|
||||
continueButton.Pressed += LevelController.Instance.ReturnToInitiator;
|
||||
|
||||
if (reward is PlantReward plantReward && plantReward.Plant.customFrame != null)
|
||||
{
|
||||
field.Texture = plantReward.Plant.customFrame.almanachField;
|
||||
}
|
||||
|
||||
var rewardedObject = reward.GetPreview().Instantiate();
|
||||
subviewport.AddChild(rewardedObject);
|
||||
|
||||
if (rewardedObject is Entity entity)
|
||||
{
|
||||
entity.DisableBrain();
|
||||
}
|
||||
}
|
||||
}
|
||||
1
scripts/gui/RewardScene.cs.uid
Normal file
1
scripts/gui/RewardScene.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cqlghusry0hej
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
using Godot;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class CustomSeedpacketFrame : Resource
|
||||
{
|
||||
[Export] public Texture2D frame;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ namespace Newlon;
|
|||
|
||||
public partial class LevelController : Node
|
||||
{
|
||||
const string REWARD_SCENE_UID = "uid://cwck7e1tt057k";
|
||||
public static LevelController Instance { get; private set; }
|
||||
public RewardResource Reward { get; private set; }
|
||||
private string pathToInitiator;
|
||||
|
||||
private bool _isLevelRunning = false;
|
||||
|
||||
|
|
@ -17,7 +20,7 @@ public partial class LevelController : Node
|
|||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
Instance = null;
|
||||
|
|
@ -31,12 +34,13 @@ public partial class LevelController : Node
|
|||
{
|
||||
if (_isLevelRunning)
|
||||
return;
|
||||
|
||||
|
||||
pathToInitiator = GetTree().CurrentScene.SceneFilePath;
|
||||
RuntimeLevelData.LevelResource = levelResource;
|
||||
|
||||
GetTree().ChangeSceneToPacked(levelTileset);
|
||||
|
||||
|
||||
|
||||
|
||||
_isLevelRunning = true;
|
||||
}
|
||||
public void RestartLevel()
|
||||
|
|
@ -49,8 +53,32 @@ public partial class LevelController : Node
|
|||
{
|
||||
if (_isLevelRunning == false)
|
||||
return;
|
||||
|
||||
|
||||
RuntimeLevelData.LevelResource = null;
|
||||
|
||||
_isLevelRunning = false;
|
||||
|
||||
if (Reward != null)
|
||||
{
|
||||
GetTree().ChangeSceneToFile(REWARD_SCENE_UID);
|
||||
}
|
||||
else
|
||||
{
|
||||
ReturnToInitiator();
|
||||
}
|
||||
}
|
||||
public void ReturnToInitiator()
|
||||
{
|
||||
if (pathToInitiator == null) return;
|
||||
|
||||
GetTree().ChangeSceneToFile(pathToInitiator);
|
||||
|
||||
pathToInitiator = null;
|
||||
}
|
||||
|
||||
public void SetReward(RewardResource reward)
|
||||
{
|
||||
Reward = reward;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,9 +13,12 @@ public partial class LevelRunner : Node
|
|||
public float waveHealth = 0;
|
||||
public float waveHealthMax = 0;
|
||||
public List<RuntimeZombieData> zombies = [];
|
||||
[Export] private MoneyReward defaultReward;
|
||||
[Export] private RowSpawner rowSpawner;
|
||||
[Export] private Timer waveTimer;
|
||||
[Export] private float approachNotificationTime;
|
||||
[Export] private AnimationPlayer player;
|
||||
[Export] private Node rewardParent;
|
||||
[Signal] public delegate void ResourceChangedEventHandler(AdventureLevelResource resource);
|
||||
[Signal] public delegate void WaveChangedEventHandler(int to);
|
||||
[Signal] public delegate void HugeWaveApproachingCallbackEventHandler();
|
||||
|
|
@ -59,7 +62,7 @@ public partial class LevelRunner : Node
|
|||
rowSpawner.Add(resource.waves[waveIndex].zombiesOrdered);
|
||||
|
||||
ClearZombies();
|
||||
|
||||
|
||||
if (waveIndex == resource.waves.Count - 1)
|
||||
{
|
||||
EmitSignal(SignalName.FinalWaveInitiated);
|
||||
|
|
@ -110,18 +113,46 @@ public partial class LevelRunner : Node
|
|||
waveHealthMax += zombie.GetMaxHPMixed();
|
||||
waveHealth = waveHealthMax;
|
||||
zombie.HPChangedMixed += OnHPChanged;
|
||||
|
||||
|
||||
|
||||
|
||||
if (waveIndex == resource.waves.Count - 1)
|
||||
{
|
||||
zombie.HasBeenKilled += (who) =>
|
||||
{
|
||||
if (waveHealth <= 0)
|
||||
{
|
||||
RuntimeLevelData.Instance.SetLevelState(RuntimeLevelData.LevelStates.Win);
|
||||
}
|
||||
};
|
||||
zombie.HasBeenKilled += OnLastZombieKilled;
|
||||
}
|
||||
}
|
||||
private void OnLastZombieKilled(RuntimeZombieData who)
|
||||
{
|
||||
if (waveHealth > 0) return;
|
||||
|
||||
RuntimeLevelData.Instance.SetLevelState(RuntimeLevelData.LevelStates.Win);
|
||||
|
||||
var reward = resource.reward.Scene.Instantiate<DroppableItem>();
|
||||
if (reward is DroppableSeedpacket seedpacket && resource.reward is PlantReward plantReward)
|
||||
{
|
||||
seedpacket.plant = plantReward.Plant;
|
||||
}
|
||||
LevelController.Instance.SetReward(resource.reward);
|
||||
player.Play("win");
|
||||
Callable.From(() =>
|
||||
{
|
||||
rewardParent.AddChild(reward);
|
||||
|
||||
reward.GlobalPosition = who.GlobalPosition + Vector2.Up * FieldParams.TileHeight * 0.5f;
|
||||
|
||||
var dropmover = new DropMover();
|
||||
reward.AddChild(dropmover);
|
||||
}).CallDeferred();
|
||||
reward.PickedUp += () =>
|
||||
{
|
||||
var tween = CreateTween();
|
||||
var camera = GetViewport().GetCamera2D();
|
||||
tween.TweenProperty(reward, "global_position", camera.GlobalPosition, 4.0);
|
||||
tween.Parallel().TweenProperty(reward, "global_scale", new Vector2(3.0f, 3.0f), 4.0);
|
||||
tween.TweenInterval(1.0);
|
||||
tween.TweenCallback(Callable.From(LevelController.Instance.EndLevel));
|
||||
|
||||
reward.InputPickable = false;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ public partial class LoseCheckbox : Area2D
|
|||
if (zombieData.HP <= 0) return;
|
||||
RuntimeLevelData.Instance.SetLevelState(RuntimeLevelData.LevelStates.Loose);
|
||||
Engine.TimeScale = 1.0;
|
||||
fadeAnimation.Play("fade");
|
||||
fadeAnimation.Play("loose");
|
||||
GetTree().Paused = true;
|
||||
PhysicsServer2D.SetActive(true);
|
||||
Callable.From(()=>
|
||||
|
|
|
|||
13
scripts/resources/MoneyReward.cs
Normal file
13
scripts/resources/MoneyReward.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Godot;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class MoneyReward : RewardResource
|
||||
{
|
||||
[Export] public int Cost;
|
||||
public override PackedScene GetPreview()
|
||||
{
|
||||
return Scene;
|
||||
}
|
||||
|
||||
}
|
||||
1
scripts/resources/MoneyReward.cs.uid
Normal file
1
scripts/resources/MoneyReward.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dtfmy3los1si1
|
||||
|
|
@ -3,6 +3,7 @@ using Godot;
|
|||
namespace Newlon;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class PlantResource : DisplayResource
|
||||
{
|
||||
}
|
||||
|
|
|
|||
15
scripts/resources/PlantReward.cs
Normal file
15
scripts/resources/PlantReward.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
using Godot;
|
||||
using Newlon;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public partial class PlantReward : RewardResource
|
||||
{
|
||||
[Export]
|
||||
public PlantResource Plant { get; private set; }
|
||||
public override PackedScene GetPreview()
|
||||
{
|
||||
return Plant.Scene;
|
||||
}
|
||||
|
||||
}
|
||||
1
scripts/resources/PlantReward.cs.uid
Normal file
1
scripts/resources/PlantReward.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c8e40t5nbo83r
|
||||
12
scripts/resources/RewardResource.cs
Normal file
12
scripts/resources/RewardResource.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using Godot;
|
||||
|
||||
[GlobalClass]
|
||||
[Tool]
|
||||
public abstract partial class RewardResource : Resource
|
||||
{
|
||||
[Export]
|
||||
public PackedScene Scene { get; private set; }
|
||||
[Export] public string Name { get; private set; }
|
||||
[Export] public string Description { get; private set; }
|
||||
public abstract PackedScene GetPreview();
|
||||
}
|
||||
1
scripts/resources/RewardResource.cs.uid
Normal file
1
scripts/resources/RewardResource.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://co3cs8suo67gw
|
||||
Loading…
Add table
Add a link
Reference in a new issue