Initial commit
2
.gitattributes
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# Normalize EOL for all files that Git considers text files.
|
||||
* text=auto eol=lf
|
||||
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# Godot 4+ specific ignores
|
||||
.godot/
|
||||
.vs/
|
||||
/android/
|
||||
8
NewLON.csproj
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<Project Sdk="Godot.NET.Sdk/4.3.0">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net7.0</TargetFramework>
|
||||
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
|
||||
<EnableDynamicLoading>true</EnableDynamicLoading>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
19
NewLON.sln
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NewLON", "NewLON.csproj", "{9FFA6489-F73F-4493-8D9C-888092D73A4D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
ExportDebug|Any CPU = ExportDebug|Any CPU
|
||||
ExportRelease|Any CPU = ExportRelease|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{9FFA6489-F73F-4493-8D9C-888092D73A4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9FFA6489-F73F-4493-8D9C-888092D73A4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9FFA6489-F73F-4493-8D9C-888092D73A4D}.ExportDebug|Any CPU.ActiveCfg = ExportDebug|Any CPU
|
||||
{9FFA6489-F73F-4493-8D9C-888092D73A4D}.ExportDebug|Any CPU.Build.0 = ExportDebug|Any CPU
|
||||
{9FFA6489-F73F-4493-8D9C-888092D73A4D}.ExportRelease|Any CPU.ActiveCfg = ExportRelease|Any CPU
|
||||
{9FFA6489-F73F-4493-8D9C-888092D73A4D}.ExportRelease|Any CPU.Build.0 = ExportRelease|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
assets/sprites/atlases/atlas1.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
34
assets/sprites/atlases/atlas1.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dvldjlg0nr355"
|
||||
path="res://.godot/imported/atlas1.png-d9b0e26b17d461e6bb422d603802b67a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/atlas1.png"
|
||||
dest_files=["res://.godot/imported/atlas1.png-d9b0e26b17d461e6bb422d603802b67a.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/atlases/cursor/default_arrow.png
Normal file
|
After Width: | Height: | Size: 308 B |
34
assets/sprites/atlases/cursor/default_arrow.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c20dwjohaljdk"
|
||||
path="res://.godot/imported/default_arrow.png-1f28ab8cea591f4487d681c783ed6548.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/cursor/default_arrow.png"
|
||||
dest_files=["res://.godot/imported/default_arrow.png-1f28ab8cea591f4487d681c783ed6548.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/atlases/cursor/default_point.png
Normal file
|
After Width: | Height: | Size: 309 B |
34
assets/sprites/atlases/cursor/default_point.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cw0rqtl8ulndd"
|
||||
path="res://.godot/imported/default_point.png-b784c50ce053ec62476f81e29e9cbbf8.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/cursor/default_point.png"
|
||||
dest_files=["res://.godot/imported/default_point.png-b784c50ce053ec62476f81e29e9cbbf8.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/atlases/cursor/plant_arrow.png
Normal file
|
After Width: | Height: | Size: 476 B |
34
assets/sprites/atlases/cursor/plant_arrow.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dx123mhv4oee"
|
||||
path="res://.godot/imported/plant_arrow.png-3956c2fc071eacbb66c6ef38b1a85606.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/cursor/plant_arrow.png"
|
||||
dest_files=["res://.godot/imported/plant_arrow.png-3956c2fc071eacbb66c6ef38b1a85606.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/atlases/cursor/shovel_arrow.png
Normal file
|
After Width: | Height: | Size: 520 B |
34
assets/sprites/atlases/cursor/shovel_arrow.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dq375kjjo17g2"
|
||||
path="res://.godot/imported/shovel_arrow.png-4920259538173907d058312f63ceacad.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/cursor/shovel_arrow.png"
|
||||
dest_files=["res://.godot/imported/shovel_arrow.png-4920259538173907d058312f63ceacad.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/atlases/cursors.ase
Normal file
BIN
assets/sprites/atlases/cursors.png
Normal file
|
After Width: | Height: | Size: 1 KiB |
34
assets/sprites/atlases/cursors.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://bavtfq6sx7og1"
|
||||
path="res://.godot/imported/cursors.png-4bab4899b5bee9fb9f2191e6a4c15507.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/cursors.png"
|
||||
dest_files=["res://.godot/imported/cursors.png-4bab4899b5bee9fb9f2191e6a4c15507.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/atlases/plant_atlas.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
34
assets/sprites/atlases/plant_atlas.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dtd1id41sce3k"
|
||||
path="res://.godot/imported/plant_atlas.png-7c803e7a32a2e016afd0df2b5656319e.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plant_atlas.png"
|
||||
dest_files=["res://.godot/imported/plant_atlas.png-7c803e7a32a2e016afd0df2b5656319e.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/atlases/plants/aloe.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
34
assets/sprites/atlases/plants/aloe.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b6tyoa5htapir"
|
||||
path="res://.godot/imported/aloe.png-98cab871a2223a6762bf6c83bc166a4d.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/aloe.png"
|
||||
dest_files=["res://.godot/imported/aloe.png-98cab871a2223a6762bf6c83bc166a4d.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/atlases/plants/garlic.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
34
assets/sprites/atlases/plants/garlic.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dff73m8ahamaa"
|
||||
path="res://.godot/imported/garlic.png-e679c5b7eb4502e36fe465910bfa1756.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/garlic.png"
|
||||
dest_files=["res://.godot/imported/garlic.png-e679c5b7eb4502e36fe465910bfa1756.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/atlases/plants/peashooter.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
34
assets/sprites/atlases/plants/peashooter.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cksryh4w5dbbx"
|
||||
path="res://.godot/imported/peashooter.png-83b25b47dba7075c5ff9c13b11015aab.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/peashooter.png"
|
||||
dest_files=["res://.godot/imported/peashooter.png-83b25b47dba7075c5ff9c13b11015aab.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/atlases/plants/potato_mine.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
34
assets/sprites/atlases/plants/potato_mine.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://c77o6ba0mw7a3"
|
||||
path="res://.godot/imported/potato_mine.png-522970a968710e713bbe9c4c1c14c6a3.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/potato_mine.png"
|
||||
dest_files=["res://.godot/imported/potato_mine.png-522970a968710e713bbe9c4c1c14c6a3.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/atlases/plants/snow_pea.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
34
assets/sprites/atlases/plants/snow_pea.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cu0651pvvkmvm"
|
||||
path="res://.godot/imported/snow_pea.png-1955bdf47a5a3e1e8e04ad4787e98a49.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/snow_pea.png"
|
||||
dest_files=["res://.godot/imported/snow_pea.png-1955bdf47a5a3e1e8e04ad4787e98a49.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/atlases/plants/spikeweed.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
34
assets/sprites/atlases/plants/spikeweed.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://coafh3mjharxo"
|
||||
path="res://.godot/imported/spikeweed.png-65536246af1ae74d9a917b7eb281a3de.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/spikeweed.png"
|
||||
dest_files=["res://.godot/imported/spikeweed.png-65536246af1ae74d9a917b7eb281a3de.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/atlases/plants/sunflower.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
34
assets/sprites/atlases/plants/sunflower.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b3tuidu8dag8u"
|
||||
path="res://.godot/imported/sunflower.png-f1ec7688cdcdb0c6fd2aeee3e5aef48a.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/sunflower.png"
|
||||
dest_files=["res://.godot/imported/sunflower.png-f1ec7688cdcdb0c6fd2aeee3e5aef48a.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/atlases/plants/wallnut.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
34
assets/sprites/atlases/plants/wallnut.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dstqh1wc5dvmo"
|
||||
path="res://.godot/imported/wallnut.png-7cb59ad96ebf875f629356b2b7d79add.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/atlases/plants/wallnut.png"
|
||||
dest_files=["res://.godot/imported/wallnut.png-7cb59ad96ebf875f629356b2b7d79add.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
|
||||
7
assets/sprites/gui/FastForward1.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bjsar1x67xk1t"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_r6k0p"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_r6k0p")
|
||||
region = Rect2(36, 264, 36, 36)
|
||||
7
assets/sprites/gui/FastForward2.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dfr5ofieigu5j"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_cq0f1"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_cq0f1")
|
||||
region = Rect2(36, 264, 36, 36)
|
||||
7
assets/sprites/gui/FastForward3.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://qgmsoocd4p1o"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_xsjda"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_xsjda")
|
||||
region = Rect2(108, 264, 36, 36)
|
||||
7
assets/sprites/gui/Pause.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dm0hjd67a6mva"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_qlv5m"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_qlv5m")
|
||||
region = Rect2(0, 264, 36, 36)
|
||||
7
assets/sprites/gui/PlantCard.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cmgaryx5wgu14"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_bxos1"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_bxos1")
|
||||
region = Rect2(259, 172, 41, 56)
|
||||
7
assets/sprites/gui/Selection.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cabpf23ndlvx0"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_safs8"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_safs8")
|
||||
region = Rect2(300, 60, 41, 56)
|
||||
7
assets/sprites/gui/Shovel.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://cw73vihkrfenc"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_s2rs0"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_s2rs0")
|
||||
region = Rect2(14, 145, 51, 47)
|
||||
7
assets/sprites/gui/suncounter.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://bhp3vuvwf7lak"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_deojb"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_deojb")
|
||||
region = Rect2(80, 120, 49, 27)
|
||||
7
assets/sprites/plants/pea.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://dq0mul65hevtt"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_soyv1"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_soyv1")
|
||||
region = Rect2(2, 130, 12, 12)
|
||||
7
assets/sprites/plants/peashooter.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://ot1n4nval86w"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_vhxkc"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_vhxkc")
|
||||
region = Rect2(1, 10, 42, 48)
|
||||
BIN
assets/sprites/summertime_saga.png
Normal file
|
After Width: | Height: | Size: 33 KiB |
34
assets/sprites/summertime_saga.png.import
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://b0tb2hjum40aw"
|
||||
path="res://.godot/imported/summertime_saga.png-a514e890c4a5a9aa20ec33143673fe69.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/sprites/summertime_saga.png"
|
||||
dest_files=["res://.godot/imported/summertime_saga.png-a514e890c4a5a9aa20ec33143673fe69.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
|
||||
7
assets/sprites/sun.tres
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://c47rflkf2wap0"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_wwp2c"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_wwp2c")
|
||||
region = Rect2(84, 147, 45, 45)
|
||||
7
assets/sprites/zombie.tres
Normal file
|
|
@ -0,0 +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"]
|
||||
|
||||
[resource]
|
||||
atlas = ExtResource("1_f3kba")
|
||||
region = Rect2(129, 104, 45, 88)
|
||||
1
icon.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
||||
|
After Width: | Height: | Size: 994 B |
37
icon.svg.import
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://btvoh1lxk1tsn"
|
||||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.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
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
50
project.godot
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
; Engine configuration file.
|
||||
; It's best edited using the editor UI and not directly,
|
||||
; since the parameters that go here are not all obvious.
|
||||
;
|
||||
; Format:
|
||||
; [section] ; section goes between []
|
||||
; param=value ; assign values to parameters
|
||||
|
||||
config_version=5
|
||||
|
||||
[application]
|
||||
|
||||
config/name="Liberation of the Neighbourville"
|
||||
run/main_scene="res://scenes/debug_lvl.tscn"
|
||||
config/features=PackedStringArray("4.3", "C#", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[autoload]
|
||||
|
||||
LevelController="*res://scripts/LevelController.cs"
|
||||
Cursor="*res://scripts/Cursor.cs"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=600
|
||||
window/size/viewport_height=400
|
||||
window/stretch/mode="canvas_items"
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="NewLON"
|
||||
|
||||
[input]
|
||||
|
||||
cheat_add_sun={
|
||||
"deadzone": 0.5,
|
||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||
]
|
||||
}
|
||||
|
||||
[layer_names]
|
||||
|
||||
2d_physics/layer_1="Reserved"
|
||||
2d_physics/layer_2="Plants"
|
||||
2d_physics/layer_3="Zombies"
|
||||
|
||||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=0
|
||||
2d/snap/snap_2d_transforms_to_pixel=true
|
||||
BIN
resources/animations/plants/peashooter.res
Normal file
13
resources/plants/Peashooter.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://c8rr1dc7mjr3d"]
|
||||
|
||||
[ext_resource type="Script" path="res://scripts/resources/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://be1kgukmiu0hs" path="res://scenes/entities/plants/peashooter.tscn" id="1_rqf2x"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_amvh8")
|
||||
Cost = 75
|
||||
Scene = ExtResource("1_rqf2x")
|
||||
ReloadTime = 5.0
|
||||
StartReloadTime = 0.0
|
||||
Preview = ExtResource("1_rnq6r")
|
||||
51
scenes/debug_lvl.tscn
Normal 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")]
|
||||
32
scenes/entities/Zombies/zombie.tscn
Normal 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")
|
||||
27
scenes/entities/plants/pea.tscn
Normal 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"]
|
||||
117
scenes/entities/plants/peashooter.tscn
Normal 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"]
|
||||
12
scenes/gui/fast_forward_button.tscn
Normal 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
|
||||
13
scenes/gui/pause_button.tscn
Normal 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
|
||||
38
scenes/gui/plant_card.tscn
Normal 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
|
||||
67
scenes/gui/runtime_gui.tscn
Normal 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
|
||||
15
scenes/gui/shovel_button.tscn
Normal 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
|
||||
49
scenes/gui/sun_counter.tscn
Normal 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")
|
||||
3
scenes/level_template.tscn
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
[gd_scene format=3 uid="uid://dd3yegl1xo44m"]
|
||||
|
||||
[node name="level_template" type="Node2D"]
|
||||
18
scenes/pools.tscn
Normal 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="."]
|
||||
18
scripts/Cursor.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Cursor : Node
|
||||
{
|
||||
public static Cursor Instance { get; private set; }
|
||||
public override void _Ready()
|
||||
{
|
||||
Instance = this;
|
||||
SetDefaultCursorSet();
|
||||
}
|
||||
|
||||
public void SetDefaultCursorSet()
|
||||
{
|
||||
Input.SetCustomMouseCursor(ResourceLoader.Load<Texture2D>("res://assets/sprites/atlases/cursor/default_arrow.png"));
|
||||
Input.SetCustomMouseCursor(ResourceLoader.Load<Texture2D>("res://assets/sprites/atlases/cursor/default_point.png"),shape:Input.CursorShape.PointingHand);
|
||||
}
|
||||
}
|
||||
12
scripts/LevelButton.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// Button that contains level to load
|
||||
//
|
||||
|
||||
public partial class LevelButton : Node
|
||||
{
|
||||
[Export] private Script _levelScript;
|
||||
[Export] private PackedScene _levelTileset;
|
||||
}
|
||||
50
scripts/LevelController.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// Class that gives access to level data, pools and etc.
|
||||
//
|
||||
|
||||
public partial class LevelController : Node
|
||||
{
|
||||
public static LevelController Instance { get; private set; }
|
||||
|
||||
private bool _isLevelRunning = false;
|
||||
|
||||
public RuntimeLevelData LevelData { get; set; }
|
||||
public PoolContainer Pools { get; set; }
|
||||
|
||||
public override void _EnterTree()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
public void StartLevel(PackedScene levelTileset, Script levelScript = null)
|
||||
{
|
||||
if (_isLevelRunning)
|
||||
return;
|
||||
|
||||
GetTree().ChangeSceneToPacked(levelTileset);
|
||||
|
||||
if (levelScript != null)
|
||||
GetTree().CurrentScene.SetScript(levelScript);
|
||||
|
||||
_isLevelRunning = true;
|
||||
}
|
||||
|
||||
public void EndLevel()
|
||||
{
|
||||
if (_isLevelRunning == false)
|
||||
return;
|
||||
|
||||
LevelData = null;
|
||||
Pools = null;
|
||||
|
||||
_isLevelRunning = false;
|
||||
}
|
||||
}
|
||||
31
scripts/LinearProjectile.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// Projectile that travels from left to right
|
||||
//
|
||||
|
||||
public partial class LinearProjectile : Area2D, IProjectile
|
||||
{
|
||||
[Export(hintString: "suffix:tile/sec")]
|
||||
private float _speed;
|
||||
[Export]
|
||||
private int _damage;
|
||||
private int _line;
|
||||
public int Line { get => _line; set { _line = value; } }
|
||||
|
||||
public override void _PhysicsProcess(double delta)
|
||||
{
|
||||
Translate(Vector2.Right * _speed * (float)delta * Utility.TileWidth);
|
||||
}
|
||||
|
||||
public void OnAreaEntered(Area2D area)
|
||||
{
|
||||
var entity = area.GetParent<IEntity>();
|
||||
if (entity != null && entity.Line == _line)
|
||||
{
|
||||
entity.TakeDamage(_damage);
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
scripts/Utility.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// Class for general-used constants and utility tools
|
||||
//
|
||||
|
||||
public partial class Utility
|
||||
{
|
||||
public const int TileWidth = 50;
|
||||
public const int TileHeight = 60;
|
||||
public static readonly Vector2I LeftFieldBoundary = new Vector2I(305,76);
|
||||
public static readonly Vector2I RightFieldBoundary = new Vector2I(755,376);
|
||||
}
|
||||
11
scripts/components/IEntity.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//
|
||||
// Base interface for entities
|
||||
//
|
||||
public interface IEntity
|
||||
{
|
||||
public int Hp { get; }
|
||||
public int MaxHp { get; }
|
||||
public int Line { get; }
|
||||
public void TakeDamage(int amount);
|
||||
public void Heal(int amount);
|
||||
}
|
||||
7
scripts/components/IProjectile.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//
|
||||
// Base interface for entities
|
||||
//
|
||||
public interface IProjectile
|
||||
{
|
||||
public int Line { get; set; }
|
||||
}
|
||||
10
scripts/components/gui/SunCounter.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class SunCounter : Label
|
||||
{
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
Text = LevelController.Instance.LevelData.SunCount.ToString();
|
||||
}
|
||||
}
|
||||
24
scripts/components/level/PoolContainer.cs
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// PoolContainer contains nodes that contain different elemnts that generate during runtime
|
||||
// Is not pool in traditional sense, but named like that to prevent repetition
|
||||
//
|
||||
|
||||
public partial class PoolContainer : Node
|
||||
{
|
||||
[Export]
|
||||
public Node Zombies { get; private set; }
|
||||
[Export]
|
||||
public Node Plants { get; private set; }
|
||||
[Export]
|
||||
public Node Projectiles { get; private set; }
|
||||
[Export]
|
||||
public Node Structures { get; private set; }
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
LevelController.Instance.Pools = this;
|
||||
}
|
||||
}
|
||||
33
scripts/components/level/RuntimeLevelData.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
using Godot;
|
||||
//using Godot.Collections;
|
||||
using System;
|
||||
|
||||
public partial class RuntimeLevelData : Node
|
||||
{
|
||||
public int SunCount { get; private set; } = 0;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
LevelController.Instance.LevelData = this;
|
||||
}
|
||||
|
||||
public void AddSun(int amount)
|
||||
{
|
||||
SunCount += amount;
|
||||
}
|
||||
|
||||
public bool TrySpendSun(int amount)
|
||||
{
|
||||
if (SunCount - amount < 0) return false;
|
||||
|
||||
SunCount -= amount;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//private Array<PlantResource> _selectedPlants;
|
||||
//private bool _selected;
|
||||
//public Array<PlantResource> GetSelectedPlants();
|
||||
//public bool TrySelectPlants(Array<PlantResource>);
|
||||
//public void ResetSelection();
|
||||
}
|
||||
43
scripts/components/plants/Eyesight.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public partial class Eyesight : Area2D
|
||||
{
|
||||
private bool _enemyDetected;
|
||||
public bool EnemyDetected => _enemyDetected;
|
||||
private List<IEntity> _detectedEntities = new List<IEntity>();
|
||||
private RuntimePlantData _plantData;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_plantData = GetParent<RuntimePlantData>();
|
||||
}
|
||||
|
||||
public void OnAreaEntered(Area2D area)
|
||||
{
|
||||
var entity = area.GetParent<IEntity>();
|
||||
if (entity != null)
|
||||
{
|
||||
if (_plantData.Line == entity.Line)
|
||||
{
|
||||
_detectedEntities.Add(entity);
|
||||
}
|
||||
}
|
||||
|
||||
_enemyDetected = _detectedEntities.Count > 0;
|
||||
}
|
||||
|
||||
public void OnAreaExited(Area2D area)
|
||||
{
|
||||
var entity = area.GetParent<IEntity>();
|
||||
if (entity != null)
|
||||
{
|
||||
if (_detectedEntities.Contains(entity))
|
||||
{
|
||||
_detectedEntities.Remove(entity);
|
||||
}
|
||||
}
|
||||
|
||||
_enemyDetected = _detectedEntities.Count > 0;
|
||||
}
|
||||
}
|
||||
13
scripts/components/plants/PlantEyesightLimiter.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class PlantEyesightLimiter : CollisionShape2D
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
if (Shape is SegmentShape2D segment)
|
||||
{
|
||||
segment.B = new Vector2(Utility.RightFieldBoundary.X-GlobalPosition.X, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
43
scripts/components/plants/RuntimePlantData.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// Data that plant stores during runtime
|
||||
//
|
||||
|
||||
public partial class RuntimePlantData : Node2D, IEntity
|
||||
{
|
||||
[Export]
|
||||
private int _maxHP;
|
||||
private int _hp;
|
||||
[Export]
|
||||
private int _line;
|
||||
public int Hp => _hp;
|
||||
public int MaxHp => _maxHP;
|
||||
public int Line => _line;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_hp = _maxHP;
|
||||
}
|
||||
|
||||
public void Heal(int amount)
|
||||
{
|
||||
_hp += amount;
|
||||
|
||||
if (MaxHp > 0)
|
||||
{
|
||||
_hp = MaxHp;
|
||||
}
|
||||
}
|
||||
|
||||
public void TakeDamage(int amount)
|
||||
{
|
||||
_hp -= amount;
|
||||
|
||||
if (_hp <= 0)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
31
scripts/components/plants/Shooter.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using Godot;
|
||||
|
||||
// Shoot component of some plants
|
||||
public partial class Shooter : Node2D
|
||||
{
|
||||
[Export] private PackedScene _projectile;
|
||||
[Export] private Timer _timer;
|
||||
|
||||
private RuntimePlantData _plantData;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_plantData = GetParent<RuntimePlantData>();
|
||||
}
|
||||
|
||||
|
||||
public void Shoot()
|
||||
{
|
||||
if (_timer.TimeLeft > 0) return;
|
||||
|
||||
_timer.Start();
|
||||
var instance = _projectile.Instantiate<Node2D>();
|
||||
LevelController.Instance.Pools.Projectiles.AddChild(instance);
|
||||
instance.GlobalTransform = GlobalTransform;
|
||||
|
||||
if (instance is IProjectile projectile)
|
||||
{
|
||||
projectile.Line = _plantData.Line;
|
||||
}
|
||||
}
|
||||
}
|
||||
16
scripts/components/plants/behaviours/PeashooterBehaviour.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class PeashooterBehaviour : Node
|
||||
{
|
||||
[Export] private AnimationTree _animationTree;
|
||||
[Export] private Timer _shootTimer;
|
||||
[Export] private Eyesight _sight;
|
||||
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
bool readyToShoot = _sight.EnemyDetected && _shootTimer.TimeLeft <= 0;
|
||||
|
||||
_animationTree.Set("parameters/conditions/ready", readyToShoot);
|
||||
}
|
||||
}
|
||||
41
scripts/components/zombies/RuntimeZombieData.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class RuntimeZombieData : Node2D, IEntity
|
||||
{
|
||||
private int _hp;
|
||||
[Export]
|
||||
private int _maxHP;
|
||||
[Export]
|
||||
private int _line;
|
||||
public int Hp => _hp;
|
||||
|
||||
public int MaxHp => _maxHP;
|
||||
|
||||
public int Line => _line;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_hp = _maxHP;
|
||||
}
|
||||
|
||||
public void Heal(int amount)
|
||||
{
|
||||
_hp += amount;
|
||||
|
||||
if (MaxHp > 0)
|
||||
{
|
||||
_hp = MaxHp;
|
||||
}
|
||||
}
|
||||
|
||||
public void TakeDamage(int amount)
|
||||
{
|
||||
_hp -= amount;
|
||||
|
||||
if (_hp <= 0)
|
||||
{
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
}
|
||||
13
scripts/debug/Cheats.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class Cheats : Node
|
||||
{
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed("cheat_add_sun"))
|
||||
{
|
||||
LevelController.Instance.LevelData.AddSun(50);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
scripts/debug/Clock.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
//
|
||||
// Debug tool to check time since clock loaded
|
||||
//
|
||||
|
||||
public partial class Clock : Label
|
||||
{
|
||||
private ulong _time = 0;
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
_time += (ulong)(delta*1000);
|
||||
ulong seconds = _time / 1000 % 60;
|
||||
ulong minutes = seconds / 60 % 60;
|
||||
Text = minutes.ToString()+":"+seconds.ToString();
|
||||
}
|
||||
}
|
||||
17
scripts/resources/PlantResource.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class PlantResource : Resource
|
||||
{
|
||||
[Export]
|
||||
public int Cost;
|
||||
[Export]
|
||||
public PackedScene Scene;
|
||||
[Export]
|
||||
public float ReloadTime;
|
||||
[Export]
|
||||
public float StartReloadTime;
|
||||
[Export]
|
||||
public Texture Preview;
|
||||
}
|
||||