pathfinding rework for now

This commit is contained in:
2025-06-13 00:06:51 +10:00
parent 400415f8a5
commit 6f4f465e37
817 changed files with 5533 additions and 3146 deletions

15
3dtree.tscn Normal file
View File

@ -0,0 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://406wnf58lo7h"]
[ext_resource type="PackedScene" uid="uid://bvyx8hxvka7vu" path="res://tree_test.glb" id="1_pscrb"]
[ext_resource type="Material" uid="uid://cqwo7la40rbkn" path="res://foliage/foliage.material" id="2_kkjgf"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_us4dp"]
albedo_color = Color(0.326727, 0.157357, 0.00483305, 1)
[node name="tree_test" instance=ExtResource("1_pscrb")]
[node name="Cube" parent="." index="0"]
surface_material_override/0 = SubResource("StandardMaterial3D_us4dp")
[node name="Cube_001" parent="." index="1"]
surface_material_override/0 = ExtResource("2_kkjgf")

Binary file not shown.

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://batrfsos6x38m"
path="res://.godot/imported/Kaph-Italic.otf-b932c8d71aaa63b737342951ee078e8c.fontdata"
[deps]
source_file="res://Assets/Fonts/OpenType (.otf)/Kaph-Italic.otf"
dest_files=["res://.godot/imported/Kaph-Italic.otf-b932c8d71aaa63b737342951ee078e8c.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://c3hwdjscf2hnk"
path="res://.godot/imported/Kaph-Regular.otf-c770fc91b9eb1ce8db6944bab31619b9.fontdata"
[deps]
source_file="res://Assets/Fonts/OpenType (.otf)/Kaph-Regular.otf"
dest_files=["res://.godot/imported/Kaph-Regular.otf-c770fc91b9eb1ce8db6944bab31619b9.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://cx86thi8mw004"
path="res://.godot/imported/Kaph-Italic.ttf-31eaeaf877ae291841853cd19c804cff.fontdata"
[deps]
source_file="res://Assets/Fonts/TrueType (.ttf)/Kaph-Italic.ttf"
dest_files=["res://.godot/imported/Kaph-Italic.ttf-31eaeaf877ae291841853cd19c804cff.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://nplrjxvauux5"
path="res://.godot/imported/Kaph-Regular.ttf-3e4a3d814747db553ebe53d1dc381d87.fontdata"
[deps]
source_file="res://Assets/Fonts/TrueType (.ttf)/Kaph-Regular.ttf"
dest_files=["res://.godot/imported/Kaph-Regular.ttf-3e4a3d814747db553ebe53d1dc381d87.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://ybhk4hblpvu2"
path="res://.godot/imported/Kaph-Italic.woff-408cfefde00325f89e26cdd96bcff524.fontdata"
[deps]
source_file="res://Assets/Fonts/Web Open Font Format (.woff)/Kaph-Italic.woff"
dest_files=["res://.godot/imported/Kaph-Italic.woff-408cfefde00325f89e26cdd96bcff524.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://e2e3jmoyo8p6"
path="res://.godot/imported/Kaph-Italic.woff2-00d7afb1c8d47f57b914cef10b8f58d1.fontdata"
[deps]
source_file="res://Assets/Fonts/Web Open Font Format (.woff)/Kaph-Italic.woff2"
dest_files=["res://.godot/imported/Kaph-Italic.woff2-00d7afb1c8d47f57b914cef10b8f58d1.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://cnikb22cx5s51"
path="res://.godot/imported/Kaph-Regular.woff-fc271f9b94e07fbf896c6ad9c61a5014.fontdata"
[deps]
source_file="res://Assets/Fonts/Web Open Font Format (.woff)/Kaph-Regular.woff"
dest_files=["res://.godot/imported/Kaph-Regular.woff-fc271f9b94e07fbf896c6ad9c61a5014.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View File

@ -0,0 +1,35 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://dskkuioa22v7a"
path="res://.godot/imported/Kaph-Regular.woff2-79e390799d1d1d3f7ecd9fa77b6726a8.fontdata"
[deps]
source_file="res://Assets/Fonts/Web Open Font Format (.woff)/Kaph-Regular.woff2"
dest_files=["res://.godot/imported/Kaph-Regular.woff2-79e390799d1d1d3f7ecd9fa77b6726a8.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
disable_embedded_bitmaps=true
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=4
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://broy365egmulr"
path="res://.godot/imported/bracket_b_vertical.png-315545aada90ad95c2805a4864e6e856.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Textures/bracket_b_vertical.png"
dest_files=["res://.godot/imported/bracket_b_vertical.png-315545aada90ad95c2805a4864e6e856.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dqrfgw65d0sq8"
path.s3tc="res://.godot/imported/bridge_map.png-c72524a9194bfb29ec0afa9089c51f6d.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Assets/Textures/bridge_map.png"
dest_files=["res://.godot/imported/bridge_map.png-c72524a9194bfb29ec0afa9089c51f6d.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bs2mskoyvyehv"
path="res://.godot/imported/crosshair159.png-1ca12955e39d6730ad57a007ee3592c9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Textures/crosshair159.png"
dest_files=["res://.godot/imported/crosshair159.png-1ca12955e39d6730ad57a007ee3592c9.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 409 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bc2pqfjucp6c3"
path="res://.godot/imported/cursor_none.png-8ef0d513f5b0742e2a06563125975c2c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Textures/cursor_none.png"
dest_files=["res://.godot/imported/cursor_none.png-8ef0d513f5b0742e2a06563125975c2c.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://0x80ptif1diq"
path="res://.godot/imported/hand_small_point.png-dd650890c01dd4526b4ed41c883582ff.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Textures/hand_small_point.png"
dest_files=["res://.godot/imported/hand_small_point.png-dd650890c01dd4526b4ed41c883582ff.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

View File

@ -3,25 +3,26 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cb66pspr16scy"
path="res://.godot/imported/leapfrog_2.png-6ca968bda2f2a97809552ed0bab21743.ctex"
path.s3tc="res://.godot/imported/leapfrog_2.png-6ca968bda2f2a97809552ed0bab21743.s3tc.ctex"
metadata={
"vram_texture": false
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Assets/Textures/leapfrog_2.png"
dest_files=["res://.godot/imported/leapfrog_2.png-6ca968bda2f2a97809552ed0bab21743.ctex"]
dest_files=["res://.godot/imported/leapfrog_2.png-6ca968bda2f2a97809552ed0bab21743.s3tc.ctex"]
[params]
compress/mode=0
compress/mode=2
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/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
@ -31,4 +32,4 @@ 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
detect_3d/compress_to=0

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cwykwcaxbrxdi"
path.s3tc="res://.godot/imported/prototype.png-2678c44321b389387a13e51fcac78d61.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Assets/Textures/prototype.png"
dest_files=["res://.godot/imported/prototype.png-2678c44321b389387a13e51fcac78d61.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

BIN
Assets/Textures/tile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ds4ccfym5ej7w"
path.s3tc="res://.godot/imported/tile.png-f2c836729428dd06f567f8db05c6afb6.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Assets/Textures/tile.png"
dest_files=["res://.godot/imported/tile.png-f2c836729428dd06f567f8db05c6afb6.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

BIN
Assets/Textures/tile.png~ Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="HeroClass" load_steps=12 format=3 uid="uid://b5pc3frhx467q"]
[gd_resource type="Resource" script_class="HeroClass" load_steps=11 format=3 uid="uid://b5pc3frhx467q"]
[ext_resource type="PackedScene" uid="uid://dq8v5e11rvyi6" path="res://Classes/Engineer/plan.tscn" id="1_2m5d7"]
[ext_resource type="Script" uid="uid://d40isem6w5d8" path="res://Scripts/Resources/card.gd" id="1_t4fvj"]
@ -7,7 +7,6 @@
[ext_resource type="Resource" uid="uid://cvto66tp7rrst" path="res://Cards/gatling.tres" id="4_ovvb2"]
[ext_resource type="Resource" uid="uid://cucdevshmdohf" path="res://Cards/overclock_card.tres" id="5_vqkxt"]
[ext_resource type="Texture2D" uid="uid://ctkixdue3o7ec" path="res://Classes/Engineer/red_hand.png" id="6_a8dvt"]
[ext_resource type="Resource" uid="uid://b3o112jw3loiu" path="res://Cards/reactor.tres" id="7_1qd1v"]
[ext_resource type="Script" uid="uid://dcwtg2gev3uia" path="res://Scripts/Resources/hero_class.gd" id="7_ftkad"]
[ext_resource type="PackedScene" uid="uid://ciagj1hfn4gou" path="res://Classes/Engineer/podium.tscn" id="7_nyup7"]
[ext_resource type="Texture2D" uid="uid://d4jd718brpsed" path="res://Classes/Engineer/doe.png" id="8_0o0bw"]
@ -17,7 +16,7 @@ script = ExtResource("7_ftkad")
hero_name = "Engineer"
texture = ExtResource("8_0o0bw")
hand_texture = ExtResource("6_a8dvt")
deck = Array[ExtResource("1_t4fvj")]([ExtResource("2_62g46"), ExtResource("2_62g46"), ExtResource("3_eml7q"), ExtResource("4_ovvb2"), ExtResource("5_vqkxt"), ExtResource("7_1qd1v")])
deck = Array[ExtResource("1_t4fvj")]([ExtResource("2_62g46"), ExtResource("2_62g46"), ExtResource("3_eml7q"), ExtResource("4_ovvb2"), ExtResource("5_vqkxt")])
faction = 1
podium = ExtResource("7_nyup7")
card_item = ExtResource("1_2m5d7")

View File

@ -1,34 +0,0 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dngl8iot8uqet"
path="res://.godot/imported/xbox_stick_r_left.png-396824eb8a716515d7b92ff5c3e85c2b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://KennyControllerPrompts/Xbox/xbox_stick_r_left.png"
dest_files=["res://.godot/imported/xbox_stick_r_left.png-396824eb8a716515d7b92ff5c3e85c2b.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

View File

@ -0,0 +1,185 @@
class_name PathEditTool extends Node3D
@export var hero: Hero
@export var inventory: Inventory
@export var ray: RayCast3D
@export var wall_preview: TowerBase
@export var progress_bar: TextureProgressBar
var enabled: bool = true
var point: FlowNode = null
var obstacle_last_point: int = -1
var valid_point: bool = false # a point is valid if the path would still be traversable overall if this point was made untraversable
var tower_preview: Tower
var ray_collider: Object
var ray_point: Vector3
var last_point: FlowNode = null
var last_tower_base: TowerBase
var interact_key_held: bool = false
var interacted_once: bool = false
var interact_held_time: float = 0.0
var interact_hold_time: float = 0.4
func _ready() -> void:
var c: Color = Color.GREEN
c.a = 0.8
wall_preview.set_color(c)
wall_preview.set_float(0.0)
wall_preview.toggle_collision()
func _process(delta: float) -> void:
if !enabled:
ray_collider = null
wall_preview.set_visible(false)
return
if interact_key_held:
if !interacted_once:
if valid_point and hero.currency >= Data.wall_cost and ray.is_colliding() and point.buildable:
interact_held_time += delta
set_progress_percent(interact_held_time / interact_hold_time)
wall_preview.set_float(interact_held_time / interact_hold_time)
if interact_held_time >= interact_hold_time:
set_progress_percent(0)
interacted_once = true
build_wall()
elif ray.is_colliding() and ray.get_collider() is TowerBase:
interact_held_time += delta
set_progress_percent(interact_held_time / interact_hold_time)
if interact_held_time >= interact_hold_time:
set_progress_percent(0)
interacted_once = true
refund_wall(ray.get_collider())
else:
interact_held_time = 0.0
interacted_once = false
set_progress_percent(0)
wall_preview.set_float(0.0)
if !interacted_once and ray.is_colliding():
#if statement makes sure once the building animation has started then
#the position the wall builds in is already decided and moving the mouse
#around isnt going to make the resulting
#wall teleport to the new mouse location
if !interact_key_held:
wall_preview.set_visible(true)
if is_instance_valid(ray_collider) and ray_collider is TowerBase:
Game.level.walls[ray_collider.point].set_float(1.0)
ray_collider = ray.get_collider()
ray_point = ray.get_collision_point()
if ray_collider is TowerBase:
process_looking_at_tower()
elif Game.level:
process_looking_at_level()
else:
if is_instance_valid(ray_collider) and ray_collider is TowerBase and Game.level.walls.has(ray_collider.point):
Game.level.walls[ray_collider.point].set_float(1.0)
ray_collider = null
delete_tower_preview()
wall_preview.set_visible(false)
clear_previous_point()
last_point = null
if !valid_point:
wall_preview.set_visible(false)
func process_looking_at_level() -> void:
if tower_preview:
delete_tower_preview()
point = Game.level.flow_field.get_closest_buildable_point(ray_point)
if Game.level.walls.has(point) or !point.buildable or hero.currency < Data.wall_cost:
wall_preview.set_visible(false)
valid_point = false
clear_previous_point()
last_point = point
else:
wall_preview.global_position = point.global_position
wall_preview.global_rotation = Vector3.ZERO
if last_point != point:
clear_previous_point()
last_point = point
if !Game.level.walls.has(point) and Game.level.flow_field.traversable_after_blocking_point(point):
Game.level.flow_field.toggle_traversable(point)
wall_preview.set_float(0.0)
valid_point = true
else:
valid_point = false
func clear_previous_point() -> void:
if last_point and !Game.level.walls.has(last_point) and !last_point.traversable:
Game.level.flow_field.toggle_traversable(last_point)
func process_looking_at_tower() -> void:
valid_point = false
point = ray_collider.point
if last_point != point:
clear_previous_point()
if tower_preview:
delete_tower_preview()
wall_preview.set_visible(false)
ray_collider.set_color(Color.RED)
ray_collider.set_float(0.0)
if inventory.contents.size() > 0 and !ray_collider.has_card:
if ray_collider != last_tower_base or inventory.selected_item != inventory.contents.keys()[hero.inventory_selected_index]:
spawn_tower_preview()
func spawn_tower_preview() -> void:
delete_tower_preview()
last_tower_base = ray_collider
var card: Card = inventory.contents.keys()[hero.inventory_selected_index]
tower_preview = card.turret_scene.instantiate() as Tower
tower_preview.stats = card.tower_stats
tower_preview.position = Vector3.UP
tower_preview.preview_range(true)
ray_collider.add_child(tower_preview)
func delete_tower_preview() -> void:
last_tower_base = null
if is_instance_valid(tower_preview):
tower_preview.queue_free()
tower_preview = null
func interact() -> void:
if ray_collider is TowerBase:
var tower_base: TowerBase = ray_collider as TowerBase
put_card_in_tower_base(tower_base)
func build_wall() -> void:
if point and valid_point and hero.currency >= Data.wall_cost:
hero.currency -= Data.wall_cost
Game.level.set_wall(point, multiplayer.get_unique_id())
wall_preview.visible = false
func refund_wall(wall: TowerBase) -> void:
if !is_instance_valid(wall):
return
if wall.has_card:
wall.remove_card()
Game.level.remove_wall(wall.point)
func put_card_in_tower_base(tower_base: TowerBase) -> void:
if tower_base.has_card:
tower_base.remove_card()
elif inventory.size > 0:
var card: Card = inventory.remove_at(hero.inventory_selected_index)
if !inventory.contents.has(card):
hero.decrement_selected()
tower_base.add_card(card, multiplayer.get_unique_id())
hero.place_card_audio.play()
func set_progress_percent(value: float) -> void:
progress_bar.value = progress_bar.max_value * value

View File

@ -1,26 +1,20 @@
[gd_scene load_steps=5 format=3 uid="uid://dqt1ggtkpkuhs"]
[gd_scene load_steps=4 format=3 uid="uid://dqt1ggtkpkuhs"]
[ext_resource type="Script" uid="uid://ckm02cx0ai624" path="res://Scripts/edit_tool.gd" id="1_yf8lt"]
[ext_resource type="PackedScene" uid="uid://ddbbwx0yy16lh" path="res://Scenes/TowerBase/tower_base.tscn" id="2_r3632"]
[ext_resource type="Texture2D" uid="uid://gh4yvnerf1f5" path="res://Assets/Textures/radial.png" id="3_a323w"]
[ext_resource type="Script" uid="uid://ckm02cx0ai624" path="res://PCs/PathEditTool/path_edit_tool.gd" id="1_l8cck"]
[ext_resource type="PackedScene" uid="uid://ddbbwx0yy16lh" path="res://Scenes/TowerBase/tower_base.tscn" id="2_pjtpe"]
[ext_resource type="Texture2D" uid="uid://gh4yvnerf1f5" path="res://Assets/Textures/radial.png" id="3_fs118"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_36ot1"]
transparency = 1
depth_draw_mode = 1
[node name="EditTool" type="Node3D" node_paths=PackedStringArray("ray", "wall_preview", "progress_bar")]
script = ExtResource("1_yf8lt")
[node name="PathEditTool" type="Node3D" node_paths=PackedStringArray("ray", "wall_preview", "progress_bar")]
script = ExtResource("1_l8cck")
ray = NodePath("RayCast3D")
wall_preview = NodePath("WallPreview")
build_preview_material = SubResource("StandardMaterial3D_36ot1")
progress_bar = NodePath("ProgressBar")
[node name="RayCast3D" type="RayCast3D" parent="."]
target_position = Vector3(0, 0, -20)
collision_mask = 25
[node name="WallPreview" parent="." instance=ExtResource("2_r3632")]
visible = false
[node name="WallPreview" parent="." instance=ExtResource("2_pjtpe")]
[node name="ProgressBar" type="TextureProgressBar" parent="."]
anchors_preset = 8
@ -38,4 +32,4 @@ scale = Vector2(0.5, 0.5)
pivot_offset = Vector2(90, 90)
step = 0.0
fill_mode = 4
texture_progress = ExtResource("3_a323w")
texture_progress = ExtResource("3_fs118")

View File

@ -10,7 +10,7 @@ signal ready_state_changed(state: bool)
@export var left_hand: Node3D
@export var right_hand: Node3D
@export var right_hand_animator: AnimationPlayer
@export var edit_tool: EditTool
@export var edit_tool: PathEditTool
@export var gauntlet_sprite: Sprite3D
@export var sprite: EightDirectionSprite3D
@export var hand_sprite: Sprite2D
@ -120,7 +120,7 @@ func _process(delta: float) -> void:
hovering_item.disable_hover_effect()
hovering_item = null
if edit_tool.is_looking_at_tower_base:
if is_instance_valid(edit_tool.ray_collider) and edit_tool.ray_collider is TowerBase:
card_sprites[0].view_tower()
else:
card_sprites[0].view_weapon()

View File

@ -7,7 +7,7 @@
[ext_resource type="PackedScene" uid="uid://buvgdem68wtev" path="res://Scenes/Menus/PauseMenu/pause_menu.tscn" id="3_avnsx"]
[ext_resource type="Script" uid="uid://cij76at0nbs1v" path="res://PCs/view_movement.gd" id="4_mhexa"]
[ext_resource type="PackedScene" uid="uid://dixtx38u4jhd7" path="res://Scenes/UI/card_hand.tscn" id="4_mwtvp"]
[ext_resource type="PackedScene" uid="uid://dqt1ggtkpkuhs" path="res://Scenes/gauntlet.tscn" id="5_jlxb3"]
[ext_resource type="PackedScene" uid="uid://dqt1ggtkpkuhs" path="res://PCs/PathEditTool/path_edit_tool.tscn" id="5_jlxb3"]
[ext_resource type="Script" uid="uid://do24iuot0j7d7" path="res://Scripts/inventory.gd" id="6_cf5ap"]
[ext_resource type="Texture2D" uid="uid://cjqxkraykhxxk" path="res://Classes/Engineer/red.png" id="6_yyp8i"]
[ext_resource type="Script" uid="uid://b6kjrl7ae1mi0" path="res://PCs/hud.gd" id="8_yl6ka"]
@ -20,13 +20,14 @@
[ext_resource type="Texture2D" uid="uid://chhmkmlfrobhu" path="res://Assets/Textures/bubble.png" id="15_q3yot"]
[ext_resource type="Texture2D" uid="uid://cqnapc8cscl7i" path="res://Assets/Textures/border.png" id="16_x1xjr"]
[ext_resource type="PackedScene" uid="uid://chnj376d3lcjd" path="res://Scenes/UI/pickup_notification.tscn" id="17_oyeww"]
[ext_resource type="PackedScene" uid="uid://d17c77pqsi8oy" path="res://enemy_card_ui.tscn" id="18_dfkac"]
[ext_resource type="PackedScene" uid="uid://d17c77pqsi8oy" path="res://UI/EnemyCard/enemy_card_ui.tscn" id="18_dfkac"]
[ext_resource type="Texture2D" uid="uid://cvjcu3hofahr6" path="res://Assets/Textures/place_slot.png" id="18_okmpi"]
[ext_resource type="Script" uid="uid://b5wle8f6rv3e7" path="res://PCs/player_movement.gd" id="20_cfhw8"]
[ext_resource type="Shader" uid="uid://dhtylicctk3g4" path="res://UI/crosshair.gdshader" id="20_gxpgc"]
[ext_resource type="AudioStream" uid="uid://csu2hce4bfoki" path="res://Audio/cardPlace1.ogg" id="24_8ch4w"]
[ext_resource type="AudioStream" uid="uid://dxq8b77wa41os" path="res://Audio/cardPlace2.ogg" id="25_awl6m"]
[ext_resource type="Texture2D" uid="uid://bs2mskoyvyehv" path="res://Assets/Textures/crosshair159.png" id="25_l7gpx"]
[ext_resource type="AudioStream" uid="uid://bxripx3suub1v" path="res://Audio/cardPlace3.ogg" id="26_7tm07"]
[ext_resource type="Texture2D" uid="uid://0x80ptif1diq" path="res://Assets/Textures/hand_small_point.png" id="26_dfkac"]
[ext_resource type="PackedScene" uid="uid://c2id8hjico4w8" path="res://energy_bar.tscn" id="27_14ugt"]
[ext_resource type="AudioStream" uid="uid://k1lsqkvohjpa" path="res://Audio/cardPlace4.ogg" id="27_xvxs8"]
[ext_resource type="AudioStream" uid="uid://bn8lkvy5wibvo" path="res://Audio/cardSlide1.ogg" id="28_1thk8"]
@ -94,21 +95,6 @@ viewport_path = NodePath("FirstPersonViewport")
[sub_resource type="ViewportTexture" id="ViewportTexture_574jy"]
viewport_path = NodePath("MiniMapViewport")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_lg5jo"]
shader = ExtResource("20_gxpgc")
shader_parameter/center_enabled = true
shader_parameter/legs_enabled = true
shader_parameter/inverted = false
shader_parameter/color_id = 0
shader_parameter/color_0 = Vector4(1, 0, 0, 0.95)
shader_parameter/color_1 = Vector4(1, 0, 0, 1)
shader_parameter/color_2 = Vector4(0, 0, 1, 1)
shader_parameter/center_radius = 0.002
shader_parameter/width = 0.002
shader_parameter/len = 0.012
shader_parameter/spacing = 0.008
shader_parameter/spread = 1.0
[sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_tsiqi"]
properties/0/path = NodePath(".:position")
properties/0/spawn = true
@ -382,19 +368,18 @@ max_look_down_angle = 80.0
max_look_up_angle = 80.0
enable_jumping = true
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "lives_count", "currency_count", "minimap_outline", "crosshair", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "new_energy_bar")]
[node name="HUD" type="CanvasLayer" parent="." node_paths=PackedStringArray("player", "wave_count", "lives_count", "currency_count", "minimap_outline", "minimap", "minimap_cam", "minimap_viewport", "fps_label", "hover_text", "enemy_sprites", "enemy_counts", "wave_start_label", "place_icon", "swap_icon", "place_text", "swap_text", "new_energy_bar")]
script = ExtResource("8_yl6ka")
player = NodePath("..")
wave_count = NodePath("WaveCount")
lives_count = NodePath("LivesCount")
currency_count = NodePath("CurrencyCount")
minimap_outline = NodePath("MinimapBorder")
crosshair = NodePath("Crosshair")
wave_count = NodePath("EnemyTracker/WaveCount")
lives_count = NodePath("LivesBar/LivesCount")
currency_count = NodePath("Minimap/CurrencyCount")
minimap_outline = NodePath("Minimap/MinimapBorder")
minimap = NodePath("Minimap")
minimap_cam = NodePath("../MiniMapViewport/Camera3D")
minimap_viewport = NodePath("../MiniMapViewport")
fps_label = NodePath("FPSCounter")
hover_text = NodePath("RichTextLabel2")
hover_text = NodePath("InteractLabel")
enemy_sprites = [NodePath("EnemyTracker/TextureRect"), NodePath("EnemyTracker/TextureRect2"), NodePath("EnemyTracker/TextureRect3"), NodePath("EnemyTracker/TextureRect4"), NodePath("EnemyTracker/TextureRect5")]
enemy_counts = [NodePath("EnemyTracker/TextureRect/Label"), NodePath("EnemyTracker/TextureRect2/Label2"), NodePath("EnemyTracker/TextureRect3/Label3"), NodePath("EnemyTracker/TextureRect4/Label4"), NodePath("EnemyTracker/TextureRect5/Label5")]
pickup_notif_scene = ExtResource("17_oyeww")
@ -481,6 +466,35 @@ grow_horizontal = 0
mouse_filter = 2
texture = SubResource("ViewportTexture_574jy")
[node name="MinimapBorder" type="TextureRect" parent="HUD/Minimap"]
texture_filter = 1
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -259.0
offset_top = -3.0
offset_right = 3.0
offset_bottom = 333.0
grow_horizontal = 0
mouse_filter = 2
texture = ExtResource("16_x1xjr")
[node name="CurrencyCount" type="Label" parent="HUD/Minimap"]
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -61.0
offset_top = 260.0
offset_bottom = 318.0
grow_horizontal = 0
theme_override_colors/font_color = Color(0.988235, 0.909804, 0.65098, 1)
theme_override_font_sizes/font_size = 37
text = "20"
horizontal_alignment = 1
vertical_alignment = 1
[node name="FPSCounter" type="Label" parent="HUD"]
anchors_preset = 1
anchor_left = 1.0
@ -505,31 +519,17 @@ grow_vertical = 1
scale = Vector2(3, 3)
mouse_filter = 2
[node name="LivesCount" type="Label" parent="HUD"]
offset_left = -2.24
offset_top = 23.28
offset_right = 102.76
offset_bottom = 112.28
[node name="LivesCount" type="Label" parent="HUD/LivesBar"]
layout_mode = 0
offset_right = 79.0
offset_bottom = 70.0
scale = Vector2(0.33, 0.33)
theme_override_colors/font_color = Color(0.65098, 0.227451, 0.243137, 1)
theme_override_font_sizes/font_size = 37
text = "120
"
text = "120"
horizontal_alignment = 1
vertical_alignment = 1
[node name="MinimapBorder" type="TextureRect" parent="HUD"]
texture_filter = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -262.0
offset_top = 37.0
offset_right = -37.0
offset_bottom = 336.0
grow_horizontal = 0
mouse_filter = 2
texture = ExtResource("16_x1xjr")
[node name="EnemyTracker" type="TextureRect" parent="HUD"]
texture_filter = 1
anchors_preset = 5
@ -652,22 +652,23 @@ text = "999"
horizontal_alignment = 1
vertical_alignment = 1
[node name="CurrencyCount" type="Label" parent="HUD"]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -101.0
offset_top = 300.0
offset_right = -40.0
offset_bottom = 54.0
grow_horizontal = 0
theme_override_colors/font_color = Color(0.988235, 0.909804, 0.65098, 1)
theme_override_font_sizes/font_size = 37
text = "20"
[node name="WaveCount" type="Label" parent="HUD/EnemyTracker"]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -30.0
offset_top = 59.0
offset_right = 30.0
offset_bottom = 87.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 18
text = "1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="RichTextLabel2" type="RichTextLabel" parent="HUD"]
[node name="InteractLabel" type="RichTextLabel" parent="HUD"]
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
@ -687,30 +688,6 @@ bbcode_enabled = true
text = "[center]Press Button To do thing"
scroll_active = false
[node name="WaveCount" type="Label" parent="HUD"]
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -30.0
offset_top = 81.0
offset_right = 30.0
offset_bottom = 109.0
grow_horizontal = 2
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_font_sizes/font_size = 18
text = "1"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Crosshair" type="ColorRect" parent="HUD"]
material = SubResource("ShaderMaterial_lg5jo")
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="VBoxContainer" type="VBoxContainer" parent="HUD"]
anchors_preset = 4
anchor_top = 0.5
@ -757,8 +734,45 @@ grow_horizontal = 2
grow_vertical = 2
[node name="EnergyBar" parent="HUD" instance=ExtResource("27_14ugt")]
visible = false
mouse_filter = 2
[node name="TextureRect" type="TextureRect" parent="HUD"]
modulate = Color(0.54324, 0.193653, 0.15885, 0.9)
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = ExtResource("25_l7gpx")
expand_mode = 3
stretch_mode = 5
[node name="TextureRect2" type="TextureRect" parent="HUD"]
visible = false
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
texture = ExtResource("26_dfkac")
expand_mode = 3
stretch_mode = 5
[node name="WeaponSwapTimer" type="Timer" parent="."]
wait_time = 0.4
one_shot = true

View File

@ -93,12 +93,16 @@ func tween_label(x: float) -> void:
func set_hover_text(text: String) -> void:
$TextureRect2.visible = true
$TextureRect.visible = false
hover_text.text = parse_action_tag(text)
hover_text.set_visible(true)
hover_text.visible = true
func unset_hover_text() -> void:
hover_text.set_visible(false)
hover_text.visible = false
$TextureRect2.visible = false
$TextureRect.visible = true
func set_wave_count(value: int) -> void:
@ -125,8 +129,12 @@ func set_upcoming_wave(value: Dictionary) -> void:
var frame_count: int = 0
enemy_names = []
var wave: Dictionary = {}
for index: int in value:
wave[Data.enemies[index]] = value[index]
for key: String in value:
var new_enemy: Enemy
for enemy: Enemy in Data.enemies:
if enemy.title == key:
new_enemy = enemy
wave[new_enemy] = value[key]
for x: int in enemy_sprites.size():
enemy_sprites[x].set_visible(false)
enemy_counts[x].set_visible(false)

View File

@ -1,14 +1,16 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://dsgkwh3opyqtx"]
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://dsgkwh3opyqtx"]
[ext_resource type="Texture2D" uid="uid://chhmkmlfrobhu" path="res://Assets/Textures/bubble.png" id="1_57rr1"]
[ext_resource type="Texture2D" uid="uid://ta47gpiwloxm" path="res://Assets/Textures/dead_bubble.png" id="1_ioqxi"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="1_wjbfx"]
[ext_resource type="PackedScene" uid="uid://bjo2q6vca5qlv" path="res://Worlds/GreenPlanet/Enemies/air_enemy.tscn" id="3_86skx"]
[ext_resource type="Texture2D" uid="uid://d0vafwv4lhjji" path="res://Assets/TextureAtlases/bubble.tres" id="3_homny"]
[resource]
script = ExtResource("1_wjbfx")
title = "bubble"
target_type = 2
scene = ExtResource("3_86skx")
icon = ExtResource("1_57rr1")
death_sprite = ExtResource("1_ioqxi")
sprite = ExtResource("3_homny")

View File

@ -1,14 +1,16 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://bffhb5krs5elm"]
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://bffhb5krs5elm"]
[ext_resource type="Texture2D" uid="uid://b1lwaxw62yp3p" path="res://Assets/Textures/dead_spike.png" id="1_1js8q"]
[ext_resource type="Texture2D" uid="uid://duywsy7jmh4u" path="res://Assets/Textures/spike.png" id="1_22o7e"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="1_q5r05"]
[ext_resource type="PackedScene" uid="uid://bjo2q6vca5qlv" path="res://Worlds/GreenPlanet/Enemies/air_enemy.tscn" id="3_b3axe"]
[ext_resource type="Texture2D" uid="uid://sybn6bjbj5fh" path="res://Assets/TextureAtlases/spike.tres" id="3_tbb38"]
[resource]
script = ExtResource("1_q5r05")
title = "spike"
target_type = 2
scene = ExtResource("3_b3axe")
icon = ExtResource("1_22o7e")
death_sprite = ExtResource("1_1js8q")
sprite = ExtResource("3_tbb38")

View File

@ -1,8 +1,9 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://8eba45hql7bo"]
[gd_resource type="Resource" script_class="Enemy" load_steps=7 format=3 uid="uid://8eba45hql7bo"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="1_ivs7a"]
[ext_resource type="Texture2D" uid="uid://cdnhe2mi5c5ln" path="res://Assets/Textures/dead_eye_dog.png" id="1_r8gpy"]
[ext_resource type="Texture2D" uid="uid://g00wwrlxxdc5" path="res://Assets/Textures/icon_eye_dog.png" id="2_tyyee"]
[ext_resource type="PackedScene" uid="uid://bvq6tbkuv2mfp" path="res://eye_dog.tscn" id="3_tyyee"]
[ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="4_7ypa6"]
[sub_resource type="AtlasTexture" id="AtlasTexture_n6kdu"]
@ -15,6 +16,7 @@ resource_local_to_scene = true
script = ExtResource("1_ivs7a")
title = "dog"
target_type = 1
scene = ExtResource("3_tyyee")
icon = ExtResource("2_tyyee")
death_sprite = ExtResource("1_r8gpy")
sprite = SubResource("AtlasTexture_n6kdu")

View File

@ -1,14 +1,16 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://boik1gnpl4v0a"]
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://boik1gnpl4v0a"]
[ext_resource type="Texture2D" uid="uid://cde0voyrwnqkl" path="res://Assets/Textures/icon_eye_dog_boss.png" id="1_2o720"]
[ext_resource type="Texture2D" uid="uid://bp3njt3h0qfbg" path="res://Assets/Textures/dead_eye_dog_boss.png" id="1_5xm32"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="1_euaab"]
[ext_resource type="Texture2D" uid="uid://ff3cys53p37j" path="res://Assets/TextureAtlases/dog_fast_boss.tres" id="2_1m62w"]
[ext_resource type="PackedScene" uid="uid://b0nady5xm88bo" path="res://Worlds/GreenPlanet/Enemies/land_enemy.tscn" id="3_g83md"]
[resource]
script = ExtResource("1_euaab")
title = "boss dog"
target_type = 1
scene = ExtResource("3_g83md")
icon = ExtResource("1_2o720")
death_sprite = ExtResource("1_5xm32")
sprite = ExtResource("2_1m62w")

View File

@ -1,14 +1,16 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://cvehqh4tt28g7"]
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://cvehqh4tt28g7"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="1_k5sd1"]
[ext_resource type="Texture2D" uid="uid://cv5p03aw78vwd" path="res://Assets/Textures/icon_eye_dog_fast.png" id="1_xgen5"]
[ext_resource type="Texture2D" uid="uid://dgdofekr7ow73" path="res://Assets/Textures/dead_eye_dog_fast.png" id="1_yj87d"]
[ext_resource type="Texture2D" uid="uid://dd212gh03wloa" path="res://Assets/TextureAtlases/dog_fast.tres" id="2_mkbm6"]
[ext_resource type="PackedScene" uid="uid://b0nady5xm88bo" path="res://Worlds/GreenPlanet/Enemies/land_enemy.tscn" id="3_e3fq0"]
[resource]
script = ExtResource("1_k5sd1")
title = "fast dog"
target_type = 1
scene = ExtResource("3_e3fq0")
icon = ExtResource("1_xgen5")
death_sprite = ExtResource("1_yj87d")
sprite = ExtResource("2_mkbm6")

View File

@ -1,14 +1,16 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://dxi17xvdlhkvc"]
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://dxi17xvdlhkvc"]
[ext_resource type="Texture2D" uid="uid://08n5jvq5tptf" path="res://Assets/Textures/icon_eye_dog_heavy.png" id="1_lck53"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="1_q48il"]
[ext_resource type="Texture2D" uid="uid://e7lahg40lq8a" path="res://Assets/Textures/dead_eye_dog_heavy.png" id="1_qveaa"]
[ext_resource type="Texture2D" uid="uid://c0543ucoalwmi" path="res://Assets/TextureAtlases/dog_fast_heavy.tres" id="2_7nc4x"]
[ext_resource type="PackedScene" uid="uid://b0nady5xm88bo" path="res://Worlds/GreenPlanet/Enemies/land_enemy.tscn" id="3_t3gih"]
[resource]
script = ExtResource("1_q48il")
title = "heavy dog"
target_type = 1
scene = ExtResource("3_t3gih")
icon = ExtResource("1_lck53")
death_sprite = ExtResource("1_qveaa")
sprite = ExtResource("2_7nc4x")

View File

@ -1,8 +1,9 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://btudmfd7wfwec"]
[gd_resource type="Resource" script_class="Enemy" load_steps=7 format=3 uid="uid://btudmfd7wfwec"]
[ext_resource type="Texture2D" uid="uid://bl16mvx4xaxeb" path="res://Assets/Textures/dead_leapfrog.png" id="1_aa1x4"]
[ext_resource type="Texture2D" uid="uid://3ywtwfpuuknr" path="res://Assets/Textures/leapfrog.png" id="2_pj3v3"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="3_i5ry5"]
[ext_resource type="PackedScene" uid="uid://cmneu5o0m02l8" path="res://Worlds/GreenPlanet/Enemies/leaping_enemy.tscn" id="3_pj3v3"]
[ext_resource type="Texture2D" uid="uid://cb66pspr16scy" path="res://Assets/Textures/leapfrog_2.png" id="4_i5ry5"]
[sub_resource type="AtlasTexture" id="AtlasTexture_n6kdu"]
@ -15,6 +16,7 @@ resource_local_to_scene = true
script = ExtResource("3_i5ry5")
title = "Leapdog"
target_type = 1
scene = ExtResource("3_pj3v3")
icon = ExtResource("2_pj3v3")
death_sprite = ExtResource("1_aa1x4")
sprite = SubResource("AtlasTexture_n6kdu")

View File

@ -11,10 +11,7 @@ class_name GameEndScreen extends PanelContainer
func _ready() -> void:
var wins: int = Data.save_data.twenty_game_history.count(true)
var games: int = Data.save_data.twenty_game_history.size()
var winrate: int = int((float(wins) / float(games)) * 100.0)
winrate_label.text = "Your 20-game winrate is now: " + str(winrate) + "%!"
winrate_label.text = "Your 20-game winrate is now: " + str(Data.save_data.winrate) + "%!"
total_games_label.text = "Total games: " + str(Data.save_data.wins + Data.save_data.losses)
total_wins_label.text = "Total wins: " + str(Data.save_data.wins)
total_losses_label.text = "Total losses: " + str(Data.save_data.losses)

View File

@ -19,18 +19,18 @@ var temp_data: SaveData
func _ready() -> void:
$ProfileEditor/VBoxContainer/HBoxContainer/DisplayName.text = Data.player_profile.display_name
load_stats(Data.save_data)
bg_level.a_star_graph_3d.make_grid()
bg_level.a_star_graph_3d.find_path()
bg_level.a_star_graph_3d.build_random_maze(70)
bg_level.a_star_graph_3d.place_random_towers(30)
bg_level.a_star_graph_3d.disable_all_tower_frames()
#bg_level.a_star_graph_3d.make_grid()
#bg_level.a_star_graph_3d.find_path()
#bg_level.a_star_graph_3d.build_random_maze(70)
#bg_level.a_star_graph_3d.place_random_towers(30)
#bg_level.a_star_graph_3d.disable_all_tower_frames()
Game.level = bg_level
WaveManager.generate_wave(WaveManager.calculate_spawn_power(50, 4), bg_level.enemy_pool, bg_level.enemy_spawns)
for spawn: EnemySpawner in bg_level.enemy_spawns:
spawn.enemy_died_callback = enemy_died
spawn.enemy_reached_goal_callback = damage_goal
spawn.enemy_spawned.connect(increase_enemy_count)
spawn.spawn_wave()
#WaveManager.generate_wave(WaveManager.calculate_spawn_power(50, 4), bg_level.enemy_pool, bg_level.enemy_spawns)
#for spawn: EnemySpawner in bg_level.enemy_spawns:
# spawn.enemy_died_callback = enemy_died
# spawn.enemy_reached_goal_callback = damage_goal
# spawn.enemy_spawned.connect(increase_enemy_count)
# spawn.spawn_wave()
#these exist purely to make the enemies that spawn on the main menu happy
@ -122,7 +122,7 @@ func _on_standard_button_pressed() -> void:
func _on_daily_button_pressed() -> void:
gamemode.seed = hash(Time.get_date_string_from_system(true))
gamemode.rng_seed = hash(Time.get_date_string_from_system(true))
gamemode.endless = false
gamemode.daily = true
start_game()
@ -144,7 +144,7 @@ func _on_changelog_button_pressed() -> void:
func load_stats(stats: SaveData) -> void:
$ProfileManager/VBoxContainer/Stats/Wins/Label2.text = str(stats.wins)
$ProfileManager/VBoxContainer/Stats/Losses/Label2.text = str(stats.losses)
$ProfileManager/VBoxContainer/Stats/Winrate/Label2.text = str(int(stats.wins / 20.0))
$ProfileManager/VBoxContainer/Stats/Winrate/Label2.text = str(stats.winrate) + "%"
$ProfileManager/VBoxContainer/Stats/EngineerCardsBought/Label2.text = str(stats.engineer_cards_bought)
$ProfileManager/VBoxContainer/Stats/MageCardsBought/Label2.text = str(stats.mage_cards_bought)

View File

@ -2,7 +2,6 @@
[ext_resource type="Theme" uid="uid://b6a0ip4p72tgx" path="res://UI/new_theme.tres" id="1_p1cib"]
[ext_resource type="Script" uid="uid://ci8vq73u23viy" path="res://Scenes/Menus/MainMenu/main_menu.gd" id="2_ivytu"]
[ext_resource type="Texture2D" uid="uid://lvvnrb5jugum" path="res://Assets/Textures/logo_title.png" id="3_8jkeb"]
[ext_resource type="PackedScene" uid="uid://y1qa1g3ic8sp" path="res://Worlds/GreenPlanet/Levels/first_level.tscn" id="3_l8r4a"]
[ext_resource type="AudioStream" uid="uid://cp6ph4ra7u5rk" path="res://Scenes/UI/drop_003.ogg" id="5_cwn2i"]
[ext_resource type="Script" uid="uid://cbwxa2a4hfcy4" path="res://Scripts/Resources/enemy.gd" id="5_u514r"]
@ -19,6 +18,7 @@
[ext_resource type="Texture2D" uid="uid://cpa1hl36xfplg" path="res://Assets/Textures/first_scroll_seen.png" id="16_sv1gy"]
[ext_resource type="Texture2D" uid="uid://ctbi3gm1me1t5" path="res://Assets/Textures/unlock_mage_achievement.png" id="17_6t4jd"]
[ext_resource type="Script" uid="uid://cxrm2naq75jo1" path="res://mod_menu.gd" id="19_6t4jd"]
[ext_resource type="FontFile" uid="uid://c3hwdjscf2hnk" path="res://Assets/Fonts/OpenType (.otf)/Kaph-Regular.otf" id="20_y5bw6"]
[sub_resource type="ViewportTexture" id="ViewportTexture_5u75i"]
viewport_path = NodePath("SubViewport")
@ -94,19 +94,23 @@ grow_horizontal = 2
grow_vertical = 2
texture = SubResource("ViewportTexture_5u75i")
[node name="TextureRect2" type="TextureRect" parent="."]
[node name="TitleLabel" type="Label" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -627.0
offset_top = 73.0
offset_right = 1293.0
offset_bottom = 1153.0
anchors_preset = -1
anchor_right = 1.0
anchor_bottom = 0.5
grow_horizontal = 2
scale = Vector2(0.67, 0.67)
texture = ExtResource("3_8jkeb")
expand_mode = 1
theme_override_colors/font_color = Color(0.8, 0.5644, 0.344, 1)
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/line_spacing = -35
theme_override_constants/outline_size = 55
theme_override_fonts/font = ExtResource("20_y5bw6")
theme_override_font_sizes/font_size = 146
text = "decked
out
defense"
horizontal_alignment = 1
vertical_alignment = 1
[node name="MainControls" type="VBoxContainer" parent="."]
layout_mode = 1
@ -125,6 +129,7 @@ text = "Play"
[node name="MultiplayerButton" type="Button" parent="MainControls"]
layout_mode = 2
disabled = true
text = "Multiplayer"
[node name="ModsButton" type="Button" parent="MainControls"]

View File

@ -9,7 +9,6 @@ texture = ExtResource("1_kau30")
[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_hqcdo"]
parameter_name = "Texture2DParameter"
qualifier = 2
texture_type = 1
texture_filter = 1
@ -17,7 +16,6 @@ texture_filter = 1
output_port_for_preview = 0
expanded_output_ports = [0]
parameter_name = "Color"
qualifier = 2
default_value_enabled = true
default_value = Color(0, 1, 0, 0.752941)
@ -51,7 +49,6 @@ op_type = 2
[sub_resource type="VisualShaderNodeFloatParameter" id="VisualShaderNodeFloatParameter_8utgl"]
parameter_name = "Float"
qualifier = 2
default_value_enabled = true
default_value = 1.0
@ -80,8 +77,8 @@ render_mode blend_mix, depth_draw_always, cull_back, diffuse_lambert, specular_s
uniform sampler2D Texture2DParameter : source_color, filter_nearest;
uniform sampler2D tex_frg_7;
instance uniform float Float = 1.0;
instance uniform vec4 Color : source_color = vec4(0.000000, 1.000000, 0.000000, 0.752941);
uniform float Float = 1.0;
uniform vec4 Color : source_color = vec4(0.000000, 1.000000, 0.000000, 0.752941);
@ -150,6 +147,8 @@ void fragment() {
"
modes/depth_draw = 1
flags/depth_prepass_alpha = true
preview_params/Texture2DParameter = "Resource(\"res://Scenes/TowerBase/funboxtex.png\")"
preview_params/Float = "1.0"
nodes/fragment/0/position = Vector2(1220, 280)
nodes/fragment/2/node = SubResource("VisualShaderNodeInput_nxokf")
nodes/fragment/2/position = Vector2(-580, 180)
@ -162,11 +161,11 @@ nodes/fragment/8/position = Vector2(-60, 340)
nodes/fragment/9/node = SubResource("VisualShaderNodeFloatFunc_h0gpf")
nodes/fragment/9/position = Vector2(140, 360)
nodes/fragment/13/node = SubResource("VisualShaderNodeTexture_ugjxq")
nodes/fragment/13/position = Vector2(260, 140)
nodes/fragment/13/position = Vector2(260, 120)
nodes/fragment/14/node = SubResource("VisualShaderNodeTexture2DParameter_hqcdo")
nodes/fragment/14/position = Vector2(-60, 0)
nodes/fragment/14/position = Vector2(-60, -240)
nodes/fragment/15/node = SubResource("VisualShaderNodeColorParameter_rwgpq")
nodes/fragment/15/position = Vector2(40, 940)
nodes/fragment/15/position = Vector2(20, 1040)
nodes/fragment/18/node = SubResource("VisualShaderNodeVectorOp_g2jnk")
nodes/fragment/18/position = Vector2(500, 340)
nodes/fragment/19/node = SubResource("VisualShaderNodeVectorOp_ddxtc")

Binary file not shown.

View File

@ -33,15 +33,19 @@ animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={
"materials": {
"Material": {
"use_external/enabled": true,
"use_external/path": "uid://dsi0ofa74tfc4"
}
},
"meshes": {
"funbox_Cube_001": {
"generate/lightmap_uv": 0,
"generate/lods": 0,
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"save_to_file/enabled": false,
"save_to_file/make_streamable": "",
"save_to_file/enabled": true,
"save_to_file/path": "res://textmesh.res"
}
}

View File

@ -0,0 +1,12 @@
[gd_resource type="ShaderMaterial" load_steps=3 format=3 uid="uid://bi0grduhgdma4"]
[ext_resource type="Shader" uid="uid://dsi0ofa74tfc4" path="res://Scenes/TowerBase/dissolve.tres" id="1_id1v3"]
[ext_resource type="Texture2D" uid="uid://bmor4v4j7krgh" path="res://Scenes/TowerBase/funboxtex.png" id="2_8kmo6"]
[resource]
resource_local_to_scene = true
render_priority = 0
shader = ExtResource("1_id1v3")
shader_parameter/Texture2DParameter = ExtResource("2_8kmo6")
shader_parameter/Float = 1.0
shader_parameter/Color = Color(0, 1, 0, 0.752941)

View File

@ -4,21 +4,9 @@ class_name TowerBase extends StaticBody3D
@export var block: Node3D
@export var collider: CollisionShape3D
@export var minimap_icon: Sprite3D
@export var north_icon: Sprite3D
@export var south_icon: Sprite3D
@export var east_icon: Sprite3D
@export var west_icon: Sprite3D
@export var north_mesh: CSGBox3D
@export var south_mesh: CSGBox3D
@export var east_mesh: CSGBox3D
@export var west_mesh: CSGBox3D
@export var north_collider: CollisionShape3D
@export var south_collider: CollisionShape3D
@export var east_collider: CollisionShape3D
@export var west_collider: CollisionShape3D
var owner_id: int
var point_id: int
var point: FlowNode
var tower: Tower = null
var has_card: bool :
set(_value):
@ -28,11 +16,11 @@ var has_card: bool :
func set_color(color: Color) -> void:
$MeshInstance3D.set_instance_shader_parameter("Color", color)
$MeshInstance3D.material_override.set("shader_parameter/Color", color)
func set_float(value: float) -> void:
$MeshInstance3D.set_instance_shader_parameter("Float", value)
$MeshInstance3D.material_override.set("shader_parameter/Float", value)
func add_card(card: Card, caller_id: int) -> void:
@ -47,26 +35,6 @@ func toggle_collision() -> void:
collider.disabled = !collider.disabled
func set_north_wall(value: bool) -> void:
north_mesh.set_visible(value)
north_collider.disabled = !value
func set_south_wall(value: bool) -> void:
south_mesh.set_visible(value)
south_collider.disabled = !value
func set_east_wall(value: bool) -> void:
east_mesh.set_visible(value)
east_collider.disabled = !value
func set_west_wall(value: bool) -> void:
west_mesh.set_visible(value)
west_collider.disabled = !value
@rpc("reliable", "call_local", "any_peer")
func networked_spawn_tower(card_index: int, caller_id: int) -> void:
var card: Card = Data.cards[card_index]
@ -78,10 +46,6 @@ func networked_spawn_tower(card_index: int, caller_id: int) -> void:
tower.owner_id = caller_id
tower.position = Vector3(0, 1.2, 0)
minimap_icon.modulate = Color.RED
north_icon.modulate = Color.RED
south_icon.modulate = Color.RED
west_icon.modulate = Color.RED
east_icon.modulate = Color.RED
add_child(tower)
@ -92,7 +56,3 @@ func networked_remove_tower() -> void:
tower.queue_free()
tower = null
minimap_icon.modulate = Color.GREEN
north_icon.modulate = Color.GREEN
south_icon.modulate = Color.GREEN
west_icon.modulate = Color.GREEN
east_icon.modulate = Color.GREEN

View File

@ -1,56 +1,33 @@
[gd_scene load_steps=10 format=3 uid="uid://ddbbwx0yy16lh"]
[gd_scene load_steps=7 format=3 uid="uid://ddbbwx0yy16lh"]
[ext_resource type="Script" uid="uid://si58bm4r7r2i" path="res://Scripts/tower_base.gd" id="1_kalmg"]
[ext_resource type="Script" uid="uid://si58bm4r7r2i" path="res://Scenes/TowerBase/tower_base.gd" id="1_kalmg"]
[ext_resource type="Script" uid="uid://do24iuot0j7d7" path="res://Scripts/inventory.gd" id="2_m0oxx"]
[ext_resource type="ArrayMesh" uid="uid://cr83c74ys8rll" path="res://Scenes/TowerBase/textmesh.res" id="3_ly30x"]
[ext_resource type="Material" uid="uid://bi0grduhgdma4" path="res://Scenes/TowerBase/new_shader_material.tres" id="3_ueedj"]
[ext_resource type="ArrayMesh" uid="uid://cm5xjp442ew0y" path="res://textmesh.res" id="4_8j8ue"]
[ext_resource type="Texture2D" uid="uid://ba85u6i558x4w" path="res://Assets/Textures/minimap_node.png" id="4_lbvtm"]
[sub_resource type="BoxShape3D" id="BoxShape3D_lc72v"]
size = Vector3(1.1, 1.1, 1.1)
size = Vector3(1.381, 1.377, 1.381)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_o3uwr"]
albedo_color = Color(0.462745, 0.439216, 0.415686, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_1i074"]
albedo_color = Color(0.462745, 0.439216, 0.415686, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_jt61s"]
albedo_color = Color(0.462745, 0.439216, 0.415686, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t32n1"]
albedo_color = Color(0.462745, 0.439216, 0.415686, 1)
[node name="Node3D" type="StaticBody3D" node_paths=PackedStringArray("inventory", "block", "collider", "minimap_icon", "north_icon", "south_icon", "east_icon", "west_icon", "north_mesh", "south_mesh", "east_mesh", "west_mesh", "north_collider", "south_collider", "east_collider", "west_collider") groups=["TowerBases"]]
[node name="TowerBase" type="StaticBody3D" node_paths=PackedStringArray("inventory", "block", "collider", "minimap_icon") groups=["TowerBases"]]
collision_layer = 17
script = ExtResource("1_kalmg")
inventory = NodePath("Inventory")
block = NodePath("MeshInstance3D")
collider = NodePath("CollisionShape3D")
minimap_icon = NodePath("MinimapIcon")
north_icon = NodePath("North/NorthMinimapIcon")
south_icon = NodePath("South/SouthMinimapIcon")
east_icon = NodePath("East/EastMinimapIcon")
west_icon = NodePath("West/WestMinimapIcon")
north_mesh = NodePath("North")
south_mesh = NodePath("South")
east_mesh = NodePath("East")
west_mesh = NodePath("West")
north_collider = NodePath("CollisionShape3D2")
south_collider = NodePath("CollisionShape3D3")
east_collider = NodePath("CollisionShape3D5")
west_collider = NodePath("CollisionShape3D4")
[node name="Inventory" type="Node" parent="."]
script = ExtResource("2_m0oxx")
max_size = 1
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.688315, 0.00199121)
shape = SubResource("BoxShape3D_lc72v")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55, 0)
mesh = ExtResource("3_ly30x")
material_override = ExtResource("3_ueedj")
mesh = ExtResource("4_8j8ue")
[node name="MinimapIcon" type="Sprite3D" parent="."]
transform = Transform3D(3.5, 0, 0, 0, -1.5299e-07, 3.5, 0, -3.5, -1.5299e-07, 0, 1.5, 0)
@ -58,79 +35,3 @@ layers = 4
modulate = Color(0, 1, 0, 1)
texture_filter = 0
texture = ExtResource("4_lbvtm")
[node name="North" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 0.45, 0)
visible = false
size = Vector3(1, 0.9, 0.5)
material = SubResource("StandardMaterial3D_o3uwr")
[node name="NorthMinimapIcon" type="Sprite3D" parent="North"]
transform = Transform3D(3.5, 0, 0, 0, -6.7097e-08, 3.5, 0, -1.535, -1.5299e-07, 0.0251597, 1, 0)
layers = 4
modulate = Color(0, 1, 0, 1)
texture_filter = 0
texture = ExtResource("4_lbvtm")
[node name="CollisionShape3D2" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.5, 0.55, 0)
visible = false
shape = SubResource("BoxShape3D_lc72v")
disabled = true
[node name="South" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.45, 0)
visible = false
size = Vector3(1, 0.9, 0.5)
material = SubResource("StandardMaterial3D_1i074")
[node name="SouthMinimapIcon" type="Sprite3D" parent="South"]
transform = Transform3D(3.5, 0, 0, 0, -6.7097e-08, 3.5, 0, -1.535, -1.5299e-07, -0.0251607, 1, 0)
layers = 4
modulate = Color(0, 1, 0, 1)
texture_filter = 0
texture = ExtResource("4_lbvtm")
[node name="CollisionShape3D3" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.5, 0.55, 0)
visible = false
shape = SubResource("BoxShape3D_lc72v")
disabled = true
[node name="East" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.45, -0.5)
visible = false
size = Vector3(0.5, 0.9, 1)
material = SubResource("StandardMaterial3D_jt61s")
[node name="EastMinimapIcon" type="Sprite3D" parent="East"]
transform = Transform3D(1.535, 0, 0, 0, -1.5299e-07, 3.5, 0, -3.5, -1.5299e-07, 0, 1, 0.0248078)
layers = 4
modulate = Color(0, 1, 0, 1)
texture_filter = 0
texture = ExtResource("4_lbvtm")
[node name="CollisionShape3D5" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55, -0.5)
visible = false
shape = SubResource("BoxShape3D_lc72v")
disabled = true
[node name="West" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.45, 0.5)
visible = false
size = Vector3(0.5, 0.9, 1)
material = SubResource("StandardMaterial3D_t32n1")
[node name="WestMinimapIcon" type="Sprite3D" parent="West"]
transform = Transform3D(1.535, 0, 0, 0, -1.5299e-07, 3.5, 0, -3.5, -1.5299e-07, 0, 1, -0.0252527)
layers = 4
modulate = Color(0, 1, 0, 1)
texture_filter = 0
texture = ExtResource("4_lbvtm")
[node name="CollisionShape3D4" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.55, 0.5)
visible = false
shape = SubResource("BoxShape3D_lc72v")
disabled = true

View File

@ -17,27 +17,27 @@ albedo_color = Color(0.356863, 0.87451, 0.94902, 1)
[node name="Node3D" type="Node3D"]
[node name="CSGBox3D2" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.02, 0.475)
size = Vector3(1, 0.04, 0.05)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.02, 0.625)
size = Vector3(1.25, 0.04, 0.05)
material = SubResource("StandardMaterial3D_xt3aj")
[node name="CSGBox3D3" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.02, -0.475)
size = Vector3(1, 0.04, 0.05)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.02, -0.625)
size = Vector3(1.25, 0.04, 0.05)
material = SubResource("StandardMaterial3D_gbm1j")
[node name="CSGBox3D4" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.475, 0.02, 0)
size = Vector3(0.05, 0.04, 1)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.625, 0.02, 0)
size = Vector3(0.05, 0.04, 1.3)
material = SubResource("StandardMaterial3D_18qg8")
[node name="CSGBox3D5" type="CSGBox3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.475, 0.02, 0)
size = Vector3(0.05, 0.04, 1)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.625, 0.02, 0)
size = Vector3(0.05, 0.04, 1.3)
material = SubResource("StandardMaterial3D_ip8b2")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(3.5, 0, 0, 0, -1.5299e-07, 3.5, 0, -3.5, -1.5299e-07, 0, 0, 0)
transform = Transform3D(4, 0, 0, 0, -1.74846e-07, 4, 0, -4, -1.74846e-07, 0, 0, 0)
layers = 4
texture_filter = 0
texture = ExtResource("1_phew5")

View File

@ -11,9 +11,9 @@ func apply_effect(effect: Effect, targets: Array[EnemyController]) -> void:
if targets.has(enemy):
enemy.apply_effect(effect)
if Data.preferences.display_tower_damage_indicators and effect.damage > 0:
spawn_damage_indicator(effect.damage, enemy.sprite.global_position)
spawn_damage_indicator(effect.damage, enemy.d_n.global_position)
else:
for enemy: EnemyController in targets:
enemy.apply_effect(effect)
if Data.preferences.display_tower_damage_indicators and effect.damage > 0:
spawn_damage_indicator(effect.damage, enemy.sprite.global_position)
spawn_damage_indicator(effect.damage, enemy.d_n.global_position)

View File

@ -5,4 +5,4 @@ func apply_effect(effect: Effect, targets: Array[EnemyController]) -> void:
for enemy: EnemyController in targets:
enemy.apply_effect(effect)
if Data.preferences.display_tower_damage_indicators and effect.damage > 0:
spawn_damage_indicator(effect.damage, enemy.sprite.global_position)
spawn_damage_indicator(effect.damage, enemy.d_n.global_position)

View File

@ -10,6 +10,7 @@ class_name LeapingController extends PathingController
@export var souths: Sprite3D
@export var box: CSGBox3D
@export var tol: Label
@export var jump_distance: float = 4.0
var tolerance: float = 50.0
var jumping: bool = false
@ -21,20 +22,19 @@ func _process(delta: float) -> void:
func _physics_process(delta: float) -> void:
if !path or jumping:
if !next_node or jumping:
return
var distance_travelled: float = (character.stats.movement_speed * clampf(character.movement_speed_penalty, 0.0, 1.0)) * delta
distance_remaining -= distance_travelled
path_progress += distance_travelled
var sample: Transform3D = path.sample_baked_with_rotation(path_progress, true)
character.global_position = sample.origin
character.look_at(character.global_position + -sample.basis.z)
var closest_point: int = astar.astar.get_closest_point(character.global_position, false)
box.global_position = astar.astar.get_point_position(closest_point)
var east: int = astar.get_east_point(closest_point)
var west: int = astar.get_west_point(closest_point)
var north: int = astar.get_north_point(closest_point)
var south: int = astar.get_south_point(closest_point)
walk(delta)
consider_leap(Vector3.FORWARD)
consider_leap(Vector3.LEFT)
consider_leap(Vector3.BACK)
consider_leap(Vector3.RIGHT)
#var closest_point: int = astar.astar.get_closest_point(character.global_position, false)
#box.global_position = astar.astar.get_point_position(closest_point)
#var east: int = astar.get_east_point(closest_point)
#var west: int = astar.get_west_point(closest_point)
#var north: int = astar.get_north_point(closest_point)
#var south: int = astar.get_south_point(closest_point)
#if east >= 0 and astar.astar.is_point_disabled(east):
#eastl.text = "fuck no"
#else:
@ -51,95 +51,117 @@ func _physics_process(delta: float) -> void:
#southl.text = "fuck no"
#else:
#southl.text = "yeah"
norths.global_position = character.global_position + Vector3(-1.0, 1.0, 0.0)
souths.global_position = character.global_position + Vector3(1.0, 1.0, 0.0)
easts.global_position = character.global_position + Vector3(0.0, 1.0, -1.0)
wests.global_position = character.global_position + Vector3(0.0, 1.0, 1.0)
if east >= 0:
if astar.astar.is_point_disabled(east):
var further_point: int = astar.get_east_point(east)
if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(0.0, 0.0, -4.0))
var current_offset: float = path.get_closest_offset(character.global_position)
var gain: float = expected_offset - current_offset
if gain >= tolerance:
distance_remaining -= gain
path_progress += gain
leap(Vector3(0.0, 0.0, -4.0))
eastl.text = str(gain)
#easts.visible = true
else:
eastl.text = "cant"
else:
eastl.text = "clear"
else:
eastl.text = "invalid"
if west >= 0:
if astar.astar.is_point_disabled(west):
var further_point: int = astar.get_west_point(west)
if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(0.0, 0.0, 4.0))
var current_offset: float = path.get_closest_offset(character.global_position)
var gain: float = expected_offset - current_offset
if gain >= tolerance:
distance_remaining -= gain
path_progress += gain
leap(Vector3(0.0, 0.0, 4.0))
westl.text = str(gain)
#wests.visible = true
else:
westl.text = "cant"
else:
westl.text = "clear"
else:
westl.text = "invalid"
if north >= 0:
if astar.astar.is_point_disabled(north):
var further_point: int = astar.get_north_point(north)
if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(-4.0, 0.0, 0.0))
var current_offset: float = path.get_closest_offset(character.global_position)
var gain: float = expected_offset - current_offset
if gain >= tolerance:
distance_remaining -= gain
path_progress += gain
leap(Vector3(-4.0, 0.0, 0.0))
northl.text = str(gain)
#norths.visible = true
else:
northl.text = "cant"
else:
northl.text = "clear"
else:
northl.text = "invalid"
if south >= 0:
if astar.astar.is_point_disabled(south):
var further_point: int = astar.get_south_point(south)
if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(4.0, 0.0, 0.0))
var current_offset: float = path.get_closest_offset(character.global_position)
var gain: float = expected_offset - current_offset
if gain >= tolerance:
distance_remaining -= gain
path_progress += gain
leap(Vector3(4.0, 0.0, 0.0))
southl.text = str(gain)
#souths.visible = true
else:
southl.text = "cant"
else:
southl.text = "clear"
else:
southl.text = "invalid"
#norths.global_position = character.global_position + Vector3(-1.0, 1.0, 0.0)
#souths.global_position = character.global_position + Vector3(1.0, 1.0, 0.0)
#easts.global_position = character.global_position + Vector3(0.0, 1.0, -1.0)
#wests.global_position = character.global_position + Vector3(0.0, 1.0, 1.0)
#if east >= 0:
#if astar.astar.is_point_disabled(east):
#var further_point: int = astar.get_east_point(east)
#if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
#var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(0.0, 0.0, -4.0))
#var current_offset: float = path.get_closest_offset(character.global_position)
#var gain: float = expected_offset - current_offset
#if gain >= tolerance:
#distance_remaining -= gain
##path_progress += gain
#leap(Vector3(0.0, 0.0, -4.0))
#eastl.text = str(gain)
##easts.visible = true
#else:
#eastl.text = "cant"
#else:
#eastl.text = "clear"
#else:
#eastl.text = "invalid"
#if west >= 0:
#if astar.astar.is_point_disabled(west):
#var further_point: int = astar.get_west_point(west)
#if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
#var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(0.0, 0.0, 4.0))
#var current_offset: float = path.get_closest_offset(character.global_position)
#var gain: float = expected_offset - current_offset
#if gain >= tolerance:
#distance_remaining -= gain
##path_progress += gain
#leap(Vector3(0.0, 0.0, 4.0))
#westl.text = str(gain)
##wests.visible = true
#else:
#westl.text = "cant"
#else:
#westl.text = "clear"
#else:
#westl.text = "invalid"
#if north >= 0:
#if astar.astar.is_point_disabled(north):
#var further_point: int = astar.get_north_point(north)
#if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
#var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(-4.0, 0.0, 0.0))
#var current_offset: float = path.get_closest_offset(character.global_position)
#var gain: float = expected_offset - current_offset
#if gain >= tolerance:
#distance_remaining -= gain
##path_progress += gain
#leap(Vector3(-4.0, 0.0, 0.0))
#northl.text = str(gain)
##norths.visible = true
#else:
#northl.text = "cant"
#else:
#northl.text = "clear"
#else:
#northl.text = "invalid"
#if south >= 0:
#if astar.astar.is_point_disabled(south):
#var further_point: int = astar.get_south_point(south)
#if further_point >= 0 and !astar.astar.is_point_disabled(further_point):
#var expected_offset: float = path.get_closest_offset(character.global_position + Vector3(4.0, 0.0, 0.0))
#var current_offset: float = path.get_closest_offset(character.global_position)
#var gain: float = expected_offset - current_offset
#if gain >= tolerance:
#distance_remaining -= gain
##path_progress += gain
#leap(Vector3(4.0, 0.0, 0.0))
#southl.text = str(gain)
##souths.visible = true
#else:
#southl.text = "cant"
#else:
#southl.text = "clear"
#else:
#southl.text = "invalid"
func consider_leap(direction: Vector3) -> void:
var node: FlowNode = check_jump(character.global_position + (direction * jump_distance))
if node:
var expected_distance_remaining: float = calculate_distance_to_goal(node)
expected_distance_remaining += (character.global_position + (direction * jump_distance)).distance_to(node.global_position)
var gain: float = distance_remaining - expected_distance_remaining
if gain >= tolerance:
distance_remaining -= gain
leap(direction * jump_distance)
next_node = node
func finish_jump() -> void:
jumping = false
func check_jump(destination: Vector3) -> FlowNode:
var closest_point: FlowNode = flow_field.get_closest_traversable_point(destination)
if !closest_point.best_path or closest_point.global_position.distance_to(destination) > 1.2:
return null
return closest_point.best_path
func leap(to_point: Vector3) -> void:
jumping = true
var tween: Tween = create_tween()
tween.tween_property(character, "global_position", character.global_position + (to_point / 2.0) + Vector3.UP, 0.5)
tween.tween_property(character, "global_position", character.global_position + to_point, 0.5)
tween.tween_property(character, "global_position", character.global_position + (to_point / 2.0) + Vector3.UP, 0.3)
tween.tween_property(character, "global_position", character.global_position + to_point, 0.3)
tween.tween_callback(finish_jump)

View File

@ -1,21 +1,47 @@
class_name PathingController extends EnemyMovement
var path: Curve3D
var path_progress: float = 0.0
#var path: Curve3D
#var path_progress: float = 0.0
var flow_field: FlowField
var next_node: FlowNode
func _ready() -> void:
if path:
distance_remaining = path.get_baked_length()
#if path:
# distance_remaining = path.get_baked_length()
next_node = flow_field.get_closest_traversable_point(character.global_position)
distance_remaining += calculate_distance_to_goal(next_node)
func calculate_distance_to_goal(node: FlowNode) -> float:
var distance: float = 0.0
distance += character.global_position.distance_to(node.global_position)
if node.best_path:
var then_next_node: FlowNode = node.best_path
distance += node.global_position.distance_to(then_next_node.global_position)
while then_next_node.best_path:
distance += then_next_node.global_position.distance_to(then_next_node.best_path.global_position)
then_next_node = then_next_node.best_path
return distance
func walk(delta: float) -> void:
var distance_travelled: float = (character.stats.movement_speed * clampf(character.movement_speed_penalty, 0.0, 1.0)) * delta
distance_remaining -= distance_travelled
character.global_position = character.global_position.move_toward(next_node.global_position, distance_travelled)
character.look_at(next_node.global_position)
if character.global_position.distance_to(next_node.global_position) <= 0.05:
next_node = next_node.best_path
func _physics_process(delta: float) -> void:
if !path:
#if !path:
# return
if !next_node:
return
var distance_travelled: float = (character.stats.movement_speed * clampf(character.movement_speed_penalty, 0.0, 1.0)) * delta
distance_remaining -= distance_travelled
path_progress += distance_travelled
var sample: Transform3D = path.sample_baked_with_rotation(path_progress, true)
character.global_position = sample.origin
character.look_at(character.global_position + -sample.basis.z)
var closest_point: Vector3 = path.get_closest_point(character.global_position)
walk(delta)
#path_progress += distance_travelled
#var sample: Transform3D = path.sample_baked_with_rotation(path_progress, true)
#character.global_position = sample.origin
#character.look_at(character.global_position + -sample.basis.z)
#var closest_point: Vector3 = path.get_closest_point(character.global_position)

View File

@ -36,13 +36,13 @@ func hit(target: CharacterBody3D) -> void:
target.apply_effect(effect)
if owner_id == 0:
if Data.preferences.display_tower_damage_indicators:
spawn_damage_indicator(target.sprite.global_position)
spawn_damage_indicator(target.d_n.global_position)
if owner_id == multiplayer.get_unique_id():
if Data.preferences.display_self_damage_indicators:
spawn_damage_indicator(target.sprite.global_position)
spawn_damage_indicator(target.d_n.global_position)
if owner_id != 0 and owner_id != multiplayer.get_unique_id():
if Data.preferences.display_party_damage_indicators:
spawn_damage_indicator(target.sprite.global_position)
spawn_damage_indicator(target.d_n.global_position)
@rpc("reliable")

View File

@ -2,6 +2,7 @@ class_name Enemy extends Resource
@export var title: String = "dog"
@export var target_type: Data.EnemyType
@export var scene: PackedScene
@export var icon: Texture
@export var death_sprite: Texture
@export var sprite: AtlasTexture

View File

@ -6,6 +6,11 @@ var save_slot: int = 0
var twenty_game_history: Array[bool] = []
var wins: int = 0
var losses: int = 0
var winrate: int :
get():
return int((float(twenty_game_history.count(true)) / float(twenty_game_history.size())) * 100.0)
set(_value):
return
#Engineer
var engineer_cards_bought: int = 0

View File

@ -37,4 +37,4 @@ func networked_hit(target_path: String, target_hitbox_path: String) -> void:
var target_hitbox: Hitbox = get_tree().root.get_node(target_hitbox_path) as Hitbox
hit(target, target_hitbox)
if Data.preferences.display_party_damage_indicators:
spawn_damage_indicator(target.sprite.global_position)
spawn_damage_indicator(target.d_n.global_position)

View File

@ -30,7 +30,7 @@ func shoot() -> void:
if target_hitbox is Hitbox:
hit(target, target_hitbox)
if Data.preferences.display_self_damage_indicators:
spawn_damage_indicator(target.sprite.global_position)
spawn_damage_indicator(target.d_n.global_position)
networked_hit.rpc(get_tree().root.get_path_to(target), get_tree().root.get_path_to(target_hitbox))
@ -51,4 +51,4 @@ func networked_hit(target_path: String, target_hitbox_path: String) -> void:
var target_hitbox: Hitbox = get_tree().root.get_node(target_hitbox_path) as Hitbox
hit(target, target_hitbox)
if Data.preferences.display_party_damage_indicators:
spawn_damage_indicator(target.sprite.global_position)
spawn_damage_indicator(target.d_n.global_position)

View File

@ -230,12 +230,13 @@ func find_path() -> bool:
func make_grid() -> void:
for x: int in grid_size.x:
for y: int in grid_size.y:
var point_position: Vector3 = Vector3((x - floori(grid_size.x / 2.0)) * point_gap, 0.5, (y - floori(grid_size.y / 2.0)) * point_gap)
var point_position: Vector3 = Vector3((x - floori(grid_size.x / 2.0)) * point_gap, 0, (y - floori(grid_size.y / 2.0)) * point_gap)
point_position += global_position
astar.add_point(int(x * grid_size.y + y), point_position)
var frame: Node3D = tower_frame_scene.instantiate()
frame.position = point_position
tower_frames.append(frame)
add_child(frame)
frame.global_position = point_position
for x: int in grid_size.x:
for y: int in grid_size.y:

View File

@ -4,7 +4,7 @@ class_name CinematicCamManager extends Node3D
@export var cameras: Array[Camera3D]
@export var pan_speed: float = 1.0
var current_cam: int = 0
var does_its_thing: bool = true
@export var does_its_thing: bool = true
func _ready() -> void:

View File

@ -1,178 +0,0 @@
class_name EditTool extends Node3D
@export var hero: Hero
@export var inventory: Inventory
@export var ray: RayCast3D
@export var wall_preview: TowerBase
@export var progress_bar: TextureProgressBar
var enabled: bool = true
var point_id: int = -1
var obstacle_last_point: int = -1
var valid_point: bool = false
var is_looking_at_tower_base: bool = false
var tower_preview: Tower
var last_tower_base: TowerBase
var last_collider: Object
var last_card: Card
var ray_collider: Object
var ray_point: Vector3
var interact_key_held: bool = false
var interacted_once: bool = false
var interact_held_time: float = 0.0
var interact_hold_time: float = 0.4
func _ready() -> void:
var c: Color = Color.GREEN
c.a = 0.8
wall_preview.set_color(c)
wall_preview.set_float(0.0)
wall_preview.toggle_collision()
func _process(delta: float) -> void:
if !enabled:
ray_collider = null
wall_preview.set_visible(false)
if is_instance_valid(last_collider):
Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_float(1.0)
last_collider = null
return
if interact_key_held and !interacted_once and valid_point and hero.currency >= Data.wall_cost and ray.is_colliding() and Game.level.a_star_graph_3d.point_is_build_location(point_id):
interact_held_time += delta
set_progress_percent(interact_held_time / interact_hold_time)
wall_preview.set_float(interact_held_time / interact_hold_time)
if interact_held_time >= interact_hold_time:
set_progress_percent(0)
interacted_once = true
build_wall()
if interact_key_held and !interacted_once and last_collider and ray.is_colliding():
interact_held_time += delta
set_progress_percent(interact_held_time / interact_hold_time)
if interact_held_time >= interact_hold_time:
set_progress_percent(0)
interacted_once = true
refund_wall(last_collider)
if !interact_key_held:
interact_held_time = 0.0
interacted_once = false
set_progress_percent(0)
wall_preview.set_float(0.0)
point_id = -1
if !interacted_once and ray.is_colliding():
if !interact_key_held:
wall_preview.set_visible(true)
ray_collider = ray.get_collider()
ray_point = ray.get_collision_point()
is_looking_at_tower_base = ray_collider is TowerBase
if is_looking_at_tower_base:
valid_point = false
point_id = ray_collider.point_id
if obstacle_last_point != point_id:
obstacle_last_point = point_id
if is_instance_valid(last_collider):
Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_float(1.0)
last_collider = null
if tower_preview:
delete_tower_preview()
wall_preview.set_visible(false)
last_collider = ray_collider
ray_collider.set_color(Color.RED)
ray_collider.set_float(0.0)
if inventory.contents.size() > 0 and !ray_collider.has_card:
if ray_collider != last_tower_base or inventory.selected_item != last_card:
spawn_tower_preview()
elif Game.level:
if is_instance_valid(last_collider):
Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_float(1.0)
last_collider = null
if tower_preview:
delete_tower_preview()
point_id = Game.level.a_star_graph_3d.astar.get_closest_point(ray_point)
if !Game.level.a_star_graph_3d.point_is_build_location(point_id) or hero.currency < Data.wall_cost:
wall_preview.set_visible(false)
else:
var point_position: Vector3 = Game.level.a_star_graph_3d.astar.get_point_position(point_id)
wall_preview.global_position = point_position
wall_preview.global_rotation = Vector3.ZERO
if obstacle_last_point != point_id:
obstacle_last_point = point_id
if Game.level.a_star_graph_3d.test_path_if_point_toggled(point_id):
var c: Color = Color.GREEN
c.a = 0.8
wall_preview.set_color(c)
wall_preview.set_float(0.0)
valid_point = true
else:
#build_preview_material.albedo_color = Color.RED
#build_preview_material.albedo_color.a = 0.8
valid_point = false
else:
ray_collider = null
is_looking_at_tower_base = false
delete_tower_preview()
wall_preview.set_visible(false)
if !valid_point:
wall_preview.set_visible(false)
func spawn_tower_preview() -> void:
delete_tower_preview()
last_tower_base = ray_collider
var card: Card = inventory.contents.keys()[hero.inventory_selected_index]
last_card = card
tower_preview = card.turret_scene.instantiate() as Tower
tower_preview.stats = card.tower_stats
tower_preview.position = Vector3.UP
tower_preview.preview_range(true)
ray_collider.add_child(tower_preview)
func delete_tower_preview() -> void:
last_tower_base = null
last_card = null
if is_instance_valid(tower_preview):
tower_preview.queue_free()
tower_preview = null
func interact() -> void:
if ray_collider is TowerBase:
var tower_base: TowerBase = ray_collider as TowerBase
put_card_in_tower_base(tower_base)
func build_wall() -> void:
if point_id >= 0 and valid_point and hero.currency >= Data.wall_cost:
hero.currency -= Data.wall_cost
Game.level.a_star_graph_3d.toggle_point(point_id, multiplayer.get_unique_id())
wall_preview.set_visible(false)
func refund_wall(wall: TowerBase) -> void:
if !is_instance_valid(wall):
return
last_collider = null
if wall.has_card:
wall.remove_card()
Game.level.a_star_graph_3d.remove_wall(wall)
func put_card_in_tower_base(tower_base: TowerBase) -> void:
if tower_base.has_card:
tower_base.remove_card()
elif inventory.size > 0:
var card: Card = inventory.remove_at(hero.inventory_selected_index)
if !inventory.contents.has(card):
hero.decrement_selected()
tower_base.add_card(card, multiplayer.get_unique_id())
hero.place_card_audio.play()
func set_progress_percent(value: float) -> void:
progress_bar.value = progress_bar.max_value * value

View File

@ -7,6 +7,7 @@ signal enemy_spawned()
@export var air_enemy_scene: PackedScene
@export var path: VisualizedPath
var astar: AStarGraph3D
@export var flow_field: FlowField
@export var own_id: int = 0
@export var type: Data.EnemyType
@export var dest: Node3D
@ -22,6 +23,12 @@ var enemies_spawned: Dictionary = {}
var enemies_to_spawn: int = 0
var done_spawning: bool = true
var enemy_id: int = 0
var new_path: Path3D
var path_polygon: PackedScene = preload("res://path_polygon.tscn")
func _ready() -> void:
create_path()
func _process(delta: float) -> void:
@ -29,56 +36,88 @@ func _process(delta: float) -> void:
done_spawning = true
return
for x: Enemy in enemy_spawn_timers:
if enemies_spawned[x] == enemy_types_to_spawn[x]:
for enemy: Enemy in enemy_spawn_timers:
if enemies_spawned[enemy] == enemy_types_to_spawn[enemy]:
continue
var enemy_stats: Enemy = x
enemy_spawn_timers[x] += delta
enemy_spawn_timers[enemy] += delta
if enemy_spawn_timers[x] >= enemy_stats.spawn_cooldown:
if enemy_spawn_timers[enemy] >= enemy.spawn_cooldown:
if is_multiplayer_authority():
if type == Data.EnemyType.LAND:
networked_spawn_land_enemy.rpc(Data.enemies.find(enemy_stats), own_id, enemy_id)
networked_spawn_land_enemy.rpc(enemy.title, own_id, enemy_id)
if type == Data.EnemyType.AIR:
var radius: float = 10.0
var random_dir: Vector3 = Vector3(randf_range(-1, 1), randf_range(-1, 1), randf_range(-1, 1))
var random_pos: Vector3 = randf_range(0, radius) * random_dir.normalized()
networked_spawn_air_enemy.rpc(Data.enemies.find(enemy_stats), random_pos, own_id, enemy_id)
networked_spawn_air_enemy.rpc(enemy.title, random_pos, own_id, enemy_id)
enemy_spawn_timers[x] -= enemy_stats.spawn_cooldown
enemy_spawn_timers[enemy] -= enemy.spawn_cooldown
enemy_spawned.emit()
enemy_id += 1
enemies_spawned[x] += 1
enemies_spawned[enemy] += 1
enemies_to_spawn -= 1
#TODO: not sure enemies need all this info over the network
#TODO: generalize enemy scene selection, i.e. store the scenes in the enemy
#card like towers do
@rpc("reliable", "call_local")
func networked_spawn_land_enemy(enemy_stats: int, id1: int, id2: int) -> void:
func networked_spawn_land_enemy(enemy_stats: String, id1: int, id2: int) -> void:
var e_stats: Enemy = null
for enemy: Enemy in Data.enemies:
if enemy.title == enemy_stats:
e_stats = enemy
var enemy: EnemyController
if enemy_stats != 6:
enemy = land_enemy_scene.instantiate() as EnemyController
else:
enemy = leap_enemy_scene.instantiate() as EnemyController
enemy = e_stats.scene.instantiate()
enemy.name = str(id1) + str(id2)
enemy.stats = Data.enemies[enemy_stats]
enemy.stats = e_stats
enemy.died.connect(enemy_died_callback)
enemy.reached_goal.connect(enemy_reached_goal_callback)
enemy.movement_controller.path = path.curve
enemy.movement_controller.astar = astar
#enemy.movement_controller.path = path.curve
#enemy.movement_controller.astar = astar
enemy.movement_controller.flow_field = flow_field
enemy.position = global_position
enemy_path.add_child(enemy)
func create_path() -> void:
if type != Data.EnemyType.LAND:
return
new_path = Path3D.new()
new_path.curve = Curve3D.new()
add_child(new_path)
var polygon: CSGPolygon3D = path_polygon.instantiate()
new_path.add_child(polygon)
polygon.mode = CSGPolygon3D.MODE_PATH
polygon.path_node = new_path.get_path()
new_path.global_position = Vector3.ZERO
update_path()
func update_path() -> void:
if type != Data.EnemyType.LAND:
return
new_path.curve.add_point(global_position + Vector3(0, 0.5, 0))
new_path.curve = Curve3D.new()
var node: FlowNode = flow_field.get_closest_traversable_point(global_position)
new_path.curve.add_point(node.global_position + Vector3(0, 0.5, 0))
while node.best_path:
node = node.best_path
new_path.curve.add_point(node.global_position + Vector3(0, 0.5, 0))
@rpc("reliable", "call_local")
func networked_spawn_air_enemy(enemy_stats: int, pos: Vector3, id1: int, id2: int) -> void:
var enemy: EnemyController = air_enemy_scene.instantiate() as EnemyController
func networked_spawn_air_enemy(enemy_stats: String, pos: Vector3, id1: int, id2: int) -> void:
var e_stats: Enemy = null
for enemy: Enemy in Data.enemies:
if enemy.title == enemy_stats:
e_stats = enemy
var enemy: EnemyController
enemy = e_stats.scene.instantiate()
enemy.name = str(id1) + str(id2)
enemy.position = pos + global_position
enemy.stats = Data.enemies[enemy_stats]
enemy.stats = e_stats
enemy.died.connect(enemy_died_callback)
enemy.reached_goal.connect(enemy_reached_goal_callback)
enemy.movement_controller.goal = dest

155
Scripts/flow_field_tool.gd Normal file
View File

@ -0,0 +1,155 @@
class_name FlowFieldTool extends Node
@export var flow_field: FlowField
@export var raycast: RayCast3D
@export var project_raycast: RayCast3D
@export var camera: Camera3D
@export var camera_pivot: Node3D
@export var position_field: HBoxContainer
@export var x_field: LineEdit
@export var y_field: LineEdit
@export var z_field: LineEdit
@export var x_size_field: LineEdit
@export var y_size_field: LineEdit
@export var gap_field: LineEdit
var hover: FlowNode = null
var selected: Array[FlowNode] = []
var vector_dirty: bool = false
func _ready() -> void:
camera.make_current()
func _process(delta: float) -> void:
if raycast.is_colliding() and (!hover or hover != raycast.get_collider()):
hover = raycast.get_collider()
if hover and !raycast.is_colliding():
hover = null
if selected.size() == 1 and vector_dirty:
position_field.visible = true
x_field.text = str(selected[0].global_position.x)
y_field.text = str(selected[0].global_position.y)
z_field.text = str(selected[0].global_position.z)
vector_dirty = false
elif selected.size() != 1:
position_field.visible = false
for node: FlowNode in flow_field.nodes:
if node.traversable and node.buildable:
node.set_color(Color.WEB_GRAY)
elif node.traversable and !node.buildable:
node.set_color(Color.CORAL)
else:
node.set_color(Color.BLACK)
if flow_field.goals.has(node):
node.set_color(Color.BLUE)
if flow_field.starts.has(node):
node.set_color(Color.PINK)
if selected.has(node):
node.set_color(Color.GREEN)
if node == hover:
node.set_color(Color.RED)
var y: float = Input.get_axis("Move Forward", "Move Backward")
var x: float = Input.get_axis("Move Left", "Move Right")
camera_pivot.position += Vector3(x, 0, y) * delta * 10
func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion:
var from: Vector3 = camera.project_ray_origin(event.position)
var to: Vector3 = camera.project_local_ray_normal(event.position)
raycast.global_position = from
raycast.target_position = to * 1000.0
if event is InputEventMouseButton and event.button_index == 1 and hover:
if !selected.has(hover):
selected.append(hover)
vector_dirty = true
if event is InputEventMouseButton and event.button_index == 2 and selected.size() > 0:
selected = []
func _on_x_field_changed(text: String) -> void:
selected[0].global_position.x = float(text)
func _on_y_field_changed(text: String) -> void:
selected[0].global_position.y = float(text)
func _on_z_field_changed(text: String) -> void:
selected[0].global_position.z = float(text)
func _on_create_button_pressed() -> void:
flow_field.create_node()
func _on_generate_grid_button_pressed() -> void:
flow_field.create_grid(int(x_size_field.text), int(y_size_field.text), float(gap_field.text))
selected.append_array(flow_field.nodes)
func _on_calculate_button_pressed() -> void:
flow_field.calculate()
func _on_connect_button_pressed() -> void:
flow_field.connect_many_nodes(selected[0], selected.slice(1, selected.size()))
func _on_mark_goal_button_pressed() -> void:
flow_field.toggle_goal(selected)
selected = []
vector_dirty = true
func _on_mark_start_button_pressed() -> void:
flow_field.toggle_start(selected)
selected = []
vector_dirty = true
func _on_extrude_button_pressed() -> void:
if selected.size() == 1:
var node: FlowNode = flow_field.create_node(selected[0].position)
node.add_connection(selected[0])
selected[0].add_connection(node)
selected[0].set_color(Color.WEB_GRAY)
selected = []
selected.append(node)
vector_dirty = true
func _on_toggle_traversable_button_pressed() -> void:
for node: FlowNode in selected:
if !flow_field.toggle_traversable(node):
flow_field.toggle_traversable(node)
selected = []
return
selected = []
func _on_toggle_buildable_button_pressed() -> void:
for node: FlowNode in selected:
flow_field.toggle_buildable(node)
func _on_finalize_button_pressed() -> void:
var packed_scene: PackedScene = PackedScene.new()
packed_scene.pack(flow_field)
ResourceSaver.save(packed_scene, "res://flow_field_tool_output.tscn")
#TODO: This doesnt work as you'd expect because of physics frames
func _on_project_downwards_button_pressed() -> void:
for node: FlowNode in selected:
project_raycast.global_position = node.global_position + Vector3.UP
project_raycast.target_position = Vector3.DOWN * 100.0
await get_tree().physics_frame
await get_tree().physics_frame
await get_tree().physics_frame
await get_tree().physics_frame
if project_raycast.is_colliding():
node.global_position = project_raycast.get_collision_point()

View File

@ -0,0 +1 @@
uid://05c5q1v2nv8p

View File

@ -1,8 +1,10 @@
class_name FlowNode extends StaticBody3D
var connections: Array[FlowNode]
var visualisers: Array[CSGBox3D]
var traversable: bool = true
@export var connections: Array[FlowNode]
@export var visualisers: Array[Node3D]
var visual_scene: PackedScene = preload("res://cube2.tscn")
@export var traversable: bool = true
@export var buildable: bool = true
var best_path: FlowNode :
get():
return best_path
@ -12,33 +14,44 @@ var best_path: FlowNode :
set_connector_color(best_path, Color.DARK_GREEN)
func _ready() -> void:
visualisers = []
for node: FlowNode in connections:
var visual: Node3D = visual_scene.instantiate()
add_child(visual)
visual.owner = self
visualisers.append(visual)
set_connector_color(node, Color.WEB_GRAY)
func _process(delta: float) -> void:
for i: int in connections.size():
var distance: float = global_position.distance_to(connections[i].global_position)
visualisers[i].size = Vector3(0.3, 0.3, 1.0 * (distance / 2.0))
visualisers[i].position = to_local(connections[i].global_position) / 4.0
if distance >= 0.05:
visualisers[i].look_at(connections[i].global_position)
if visible:
for i: int in connections.size():
var distance: float = global_position.distance_to(connections[i].global_position)
visualisers[i].scale = Vector3(0.3, 0.3, 1.0 * (distance / 2.0))
visualisers[i].position = to_local(connections[i].global_position) / 4.0
if distance >= 0.05:
visualisers[i].look_at(connections[i].global_position)
func set_color(new_color: Color) -> void:
$CSGSphere3D.material.albedo_color = new_color
$flow_node/Sphere.material_override.albedo_color = new_color
func set_connector_color(node: FlowNode, new_color: Color) -> void:
var i: int = connections.find(node)
visualisers[i].material.albedo_color = new_color
if visible:
var i: int = connections.find(node)
visualisers[i].get_child(0).material_override.albedo_color = new_color
func add_connection(node: FlowNode) -> void:
if !connections.has(node):
var visual: CSGBox3D = CSGBox3D.new()
visual.material = StandardMaterial3D.new()
visual.material.resource_local_to_scene = true
visual.material.albedo_color = Color.DARK_GRAY
var visual: Node3D = visual_scene.instantiate()
add_child(visual)
visual.owner = self
connections.append(node)
visualisers.append(visual)
set_connector_color(node, Color.WEB_GRAY)
func remove_connection(node: FlowNode) -> void:

View File

@ -39,6 +39,17 @@ func _ready() -> void:
UILayer = CanvasLayer.new()
UILayer.layer = 2
get_tree().root.add_child.call_deferred(UILayer)
var version_label: Label = Label.new()
var version: String = ProjectSettings.get_setting("application/config/version")
version_label.text = "WORK IN PROGRESS | ALPHA - VERSION " + version + " | PLAYTEST"
version_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
version_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
version_label.add_theme_font_size_override("font_size", 18)
version_label.add_theme_color_override("font_color", Color(0.85, 0.85, 0.85, 0.7))
version_label.set_anchors_preset(Control.PRESET_TOP_WIDE)
UILayer.add_child(version_label)
Input.set_custom_mouse_cursor(load("res://Assets/Textures/cursor_none.png"), Input.CURSOR_ARROW, Vector2(9, 6))
Input.set_custom_mouse_cursor(load("res://Assets/Textures/bracket_b_vertical.png"), Input.CURSOR_IBEAM, Vector2(16, 16))
@rpc("reliable", "call_local")
@ -169,10 +180,12 @@ func ready_player(player_ready_true: bool) -> void:
func spawn_enemy_wave() -> void:
level.shop.close()
wave += 1
level.a_star_graph_3d.find_path()
level.a_star_graph_3d.disable_all_tower_frames()
level.disable_all_tower_frames()
#level.a_star_graph_3d.find_path()
#level.a_star_graph_3d.disable_all_tower_frames()
level.flow_field.calculate()
for spawn: EnemySpawner in level.enemy_spawns:
spawn.path.disable_visualization()
#spawn.path.disable_visualization()
spawn.spawn_wave()
wave_started.emit(wave)
@ -248,7 +261,7 @@ func end_wave() -> void:
connected_players_nodes[peer_id].unready_self()
for spawn: EnemySpawner in level.enemy_spawns:
spawn.path.enable_visualization()
level.a_star_graph_3d.enable_non_path_tower_frames()
#level.a_star_graph_3d.enable_non_path_tower_frames()
if is_multiplayer_authority():
if randf_in_range(23 * wave, 0.0, 1.0) <= shop_chance:
networked_spawn_shop.rpc()
@ -304,11 +317,14 @@ func start() -> void:
#Relies on rng having been seeded
set_upcoming_wave()
level.a_star_graph_3d.make_grid()
level.flow_field.calculate()
level.enemy_spawns[0].update_path()
#level.a_star_graph_3d.make_grid()
level.generate_obstacles()
level.a_star_graph_3d.disable_all_tower_frames()
level.a_star_graph_3d.enable_non_path_tower_frames()
level.a_star_graph_3d.find_path()
level.enable_non_path_tower_frames()
#level.a_star_graph_3d.disable_all_tower_frames()
#level.a_star_graph_3d.enable_non_path_tower_frames()z
#level.a_star_graph_3d.find_path()
#Start game
game_active = true

View File

@ -1,157 +0,0 @@
class_name KeyIconMap
static var playstation_keys: Dictionary = {
"0" = "res://KennyControllerPrompts/Playstation/playstation_button_color_cross.png",
"1" = "res://KennyControllerPrompts/Playstation/playstation_button_color_circle.png",
"2" = "res://KennyControllerPrompts/Playstation/playstation_button_color_square.png",
"3" = "res://KennyControllerPrompts/Playstation/playstation_button_color_triangle.png",
"4" = "res://KennyControllerPrompts/Playstation/playstation5_button_create.png",
"6" = "res://KennyControllerPrompts/Playstation/playstation5_button_options.png",
"7" = "res://KennyControllerPrompts/Playstation/playstation_stick_side_l.png",
"8" = "res://KennyControllerPrompts/Playstation/playstation_stick_side_r.png",
"9" = "res://KennyControllerPrompts/Playstation/playstation_trigger_l1_alternative.png",
"10" = "res://KennyControllerPrompts/Playstation/playstation_trigger_r1_alternative.png",
"11" = "res://KennyControllerPrompts/Playstation/playstation_dpad_up.png",
"12" = "res://KennyControllerPrompts/Playstation/playstation_dpad_down.png",
"13" = "res://KennyControllerPrompts/Playstation/playstation_dpad_left.png",
"14" = "res://KennyControllerPrompts/Playstation/playstation_dpad_right.png",
"15" = "res://KennyControllerPrompts/Playstation/playstation5_button_mute.png",
}
static var xbox_series_keys: Dictionary = {
"0" = "res://KennyControllerPrompts/Xbox/xbox_button_a_outline.png",
"1" = "res://KennyControllerPrompts/Xbox/xbox_button_b_outline.png",
"2" = "res://KennyControllerPrompts/Xbox/xbox_button_x_outline.png",
"3" = "res://KennyControllerPrompts/Xbox/xbox_button_y_outline.png",
"4" = "res://KennyControllerPrompts/Xbox/xbox_button_view_outline.png",
"5" = "res://KennyControllerPrompts/Xbox/xbox_guide.png",
"6" = "res://KennyControllerPrompts/Xbox/xbox_button_menu_outline.png",
"7" = "res://KennyControllerPrompts/Xbox/xbox_stick_side_l.png",
"8" = "res://KennyControllerPrompts/Xbox/xbox_stick_side_r.png",
"9" = "res://KennyControllerPrompts/Xbox/xbox_lb_outline.png",
"10" = "res://KennyControllerPrompts/Xbox/xbox_rb_outline.png",
"11" = "res://KennyControllerPrompts/Xbox/xbox_dpad_up_outline.png",
"12" = "res://KennyControllerPrompts/Xbox/xbox_dpad_down_outline.png",
"13" = "res://KennyControllerPrompts/Xbox/xbox_dpad_left_outline.png",
"14" = "res://KennyControllerPrompts/Xbox/xbox_dpad_right_outline.png",
"15" = "res://KennyControllerPrompts/Xbox/xbox_button_share_outline.png",
}
static var xbox_360_keys: Dictionary = {
"0" = "res://KennyControllerPrompts/Xbox/xbox_button_color_a.png",
"1" = "res://KennyControllerPrompts/Xbox/xbox_button_color_b.png",
"2" = "res://KennyControllerPrompts/Xbox/xbox_button_color_x.png",
"3" = "res://KennyControllerPrompts/Xbox/xbox_button_color_y.png",
"4" = "res://KennyControllerPrompts/Xbox/xbox_button_back.png",
"5" = "res://KennyControllerPrompts/Xbox/xbox_guide_outline.png",
"6" = "res://KennyControllerPrompts/Xbox/xbox_button_start.png",
"7" = "res://KennyControllerPrompts/Xbox/xbox_stick_side_l.png",
"8" = "res://KennyControllerPrompts/Xbox/xbox_stick_side_r.png",
"9" = "res://KennyControllerPrompts/Xbox/xbox_lb.png",
"10" = "res://KennyControllerPrompts/Xbox/xbox_rb.png",
"11" = "res://KennyControllerPrompts/Xbox/xbox_dpad_round_up.png",
"12" = "res://KennyControllerPrompts/Xbox/xbox_dpad_round_down.png",
"13" = "res://KennyControllerPrompts/Xbox/xbox_dpad_round_left.png",
"14" = "res://KennyControllerPrompts/Xbox/xbox_dpad_round_right.png",
}
static var keys: Dictionary = {
"48" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/0_Key_Light.png",
"49" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/1_Key_Light.png",
"50" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/2_Key_Light.png",
"51" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/3_Key_Light.png",
"52" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/4_Key_Light.png",
"53" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/5_Key_Light.png",
"54" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/6_Key_Light.png",
"55" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/7_Key_Light.png",
"56" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/8_Key_Light.png",
"57" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/9_Key_Light.png",
"65" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/A_Key_Light.png",
"66" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/B_Key_Light.png",
"67" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/C_Key_Light.png",
"68" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/D_Key_Light.png",
"69" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/E_Key_Light.png",
"70" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F_Key_Light.png",
"71" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/G_Key_Light.png",
"72" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/H_Key_Light.png",
"73" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/I_Key_Light.png",
"74" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/J_Key_Light.png",
"75" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/K_Key_Light.png",
"76" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/L_Key_Light.png",
"77" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/M_Key_Light.png",
"78" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/N_Key_Light.png",
"79" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/O_Key_Light.png",
"80" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/P_Key_Light.png",
"81" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Q_Key_Light.png",
"82" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/R_Key_Light.png",
"83" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/S_Key_Light.png",
"84" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/T_Key_Light.png",
"85" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/U_Key_Light.png",
"86" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/V_Key_Light.png",
"87" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/W_Key_Light.png",
"88" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/X_Key_Light.png",
"89" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Y_Key_Light.png",
"90" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Z_Key_Light.png",
"4194328" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Alt_Key_Light.png",
"4194322" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Arrow_Down_Key_Light.png",
"4194319" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Arrow_Left_Key_Light.png",
"4194321" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Arrow_Right_Key_Light.png",
"4194320" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Arrow_Up_Key_Light.png",
"42" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Asterisk_Key_Light.png",
"4194433" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Asterisk_Key_Light.png",
"4194308" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Backspace_Alt_Key_Light.png",
"91" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Bracket_Left_Key_Light.png",
"93" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Bracket_Right_Key_Light.png",
"4194329" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Caps_Lock_Key_Light.png",
"4194327" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Command_Key_Light.png",
"4194326" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Ctrl_Key_Light.png",
"4194312" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Del_Key_Light.png",
"4194318" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/End_Key_Light.png",
"4194309" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Enter_Alt_Key_Light.png",
"4194305" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Esc_Key_Light.png",
"4194332" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F1_Key_Light.png",
"4194333" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F2_Key_Light.png",
"4194334" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F3_Key_Light.png",
"4194335" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F4_Key_Light.png",
"4194336" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F5_Key_Light.png",
"4194337" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F6_Key_Light.png",
"4194338" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F7_Key_Light.png",
"4194339" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F8_Key_Light.png",
"4194340" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F9_Key_Light.png",
"4194341" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F10_Key_Light.png",
"4194342" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F11_Key_Light.png",
"4194343" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/F12_Key_Light.png",
"4194317" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Home_Key_Light.png",
"4194311" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Insert_Key_Light.png",
"60" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Mark_Left_Key_Light.png",
"62" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Mark_Right_Key_Light.png",
"45" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Minus_Key_Light.png",
"4194435" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Minus_Key_Light.png",
"4194330" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Num_Lock_Key_Light.png",
"4194324" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Page_Down_Key_Light.png",
"4194323" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Page_Up_Key_Light.png",
"43" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Plus_Key_Light.png",
"4194437" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Plus_Key_Light.png",
"4194314" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Print_Screen_Key_Light.png",
"63" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Question_Key_Light.png",
"34" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Quote_Key_Light.png",
"59" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Semicolon_Key_Light.png",
"4194325" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Shift_Key_Light.png",
"47" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Slash_Key_Light.png",
"4194434" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Slash_Key_Light.png",
"32" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Space_Key_Light.png",
"4194306" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Tab_Key_Light.png",
"126" = "res://XeluController&KeyPrompts/Keyboard & Mouse/Light/Tilda_Key_Light.png",
}
static var mouse_buttons: Dictionary = {
"1" = "res://KennyControllerPrompts/Mouse/mouse_left.png",
"3" = "res://KennyControllerPrompts/Mouse/mouse_scroll.png",
"2" = "res://KennyControllerPrompts/Mouse/mouse_right.png",
"4" = "res://KennyControllerPrompts/Mouse/mouse_scroll_up.png",
"5" = "res://KennyControllerPrompts/Mouse/mouse_scroll_down.png",
}

View File

@ -1,55 +1,120 @@
class_name Level extends GridMap
@export var enemy_pool: Array[Enemy]
@export var tower_path: Node
@export var player_spawns: Array[Node3D]
@export var enemy_spawns: Array[EnemySpawner]
@export var enemy_goals: Array[Node3D]
@export var corpses: Node3D
@export var a_star_graph_3d: AStarGraph3D
@export var flow_field: FlowField
@export var cinematic_cam: CinematicCamManager
@export var printer: CardPrinter
@export var shop: ShopStand
@export var obstacle_scenes: Array[PackedScene]
var walls: Dictionary[FlowNode, TowerBase] = {}
var wall_id: int = 0
var tower_base_scene: PackedScene = load("res://Scenes/TowerBase/tower_base.tscn")
var tower_frame_scene: PackedScene = load("res://Scenes/tower_frame.tscn")
var tower_frames: Dictionary[FlowNode, Node3D] = {}
func _ready() -> void:
flow_field.path_updated.connect(enemy_spawns[0].update_path)
for node: FlowNode in flow_field.nodes:
if node.buildable:
var frame: Node3D = tower_frame_scene.instantiate()
tower_frames[node] = frame
add_child(frame)
frame.global_position = node.global_position
func disable_all_tower_frames() -> void:
for node: FlowNode in tower_frames:
tower_frames[node].visible = false
func enable_non_path_tower_frames() -> void:
for node: FlowNode in tower_frames:
tower_frames[node].visible = true
disable_path_tower_frames()
func disable_path_tower_frames() -> void:
for node: FlowNode in tower_frames:
if !node.traversable and flow_field.traversable_after_blocking_point(node):
tower_frames[node].visible = true
func set_wall(point: FlowNode, caller_id: int) -> void:
point.traversable = false
flow_field.calculate()
flow_field.path_updated.emit()
if is_multiplayer_authority():
spawn_wall(point, wall_id, caller_id)
wall_id += 1
func remove_wall(point: FlowNode) -> void:
var wall: TowerBase = walls[point]
Game.connected_players_nodes[wall.owner_id].currency += Data.wall_cost
Game.connected_players_nodes[wall.owner_id].unready_self()
walls.erase(point)
wall.queue_free()
point.traversable = true
flow_field.calculate()
flow_field.path_updated.emit()
enable_non_path_tower_frames()
func spawn_wall(point: FlowNode, name_id: int, caller_id: int) -> void:
var base: TowerBase = tower_base_scene.instantiate() as TowerBase
base.position = point.global_position
base.name = "Wall" + str(name_id)
base.owner_id = caller_id
base.point = point
walls[point] = base
tower_path.add_child(base)
disable_path_tower_frames()
func generate_obstacles() -> void:
#print(str(multiplayer.get_unique_id()) + " spawning obstacles with seed: " + str(Game.rng.seed))
var obstacle_count: int = Game.randi_in_range(1, 0, 5)
obstacle_count = 0
for index: int in obstacle_count:
var x: int = Game.randi_in_range(10 * index, 1 - a_star_graph_3d.grid_size.x, a_star_graph_3d.grid_size.x - 1)
var y: int = Game.randi_in_range(32 * index, 1 - a_star_graph_3d.grid_size.y, a_star_graph_3d.grid_size.y - 1)
var chosen_obstacle: int = Game.randi_in_range(4 * index, 0, obstacle_scenes.size() - 1)
var obstacle: GridMap = obstacle_scenes[chosen_obstacle].instantiate() as GridMap
var orientations: Array[int] = [0, 90, 180, 270]
var chosen_orientation: int = Game.randi_in_range(15 * index, 0, orientations.size() - 1)
obstacle.position = Vector3(x, 0, y)
obstacle.set_rotation_degrees(Vector3(0, chosen_orientation, 0))
add_child(obstacle)
for cell: Vector3i in obstacle.get_used_cells():
var cell_coord: Vector3 = obstacle.to_global(obstacle.map_to_local(cell))
remove_world_tile(round(cell_coord.x), round(cell_coord.z))
obstacle.queue_free()
# for index: int in obstacle_count:
# #var x: int = Game.randi_in_range(10 * index, 1 - a_star_graph_3d.grid_size.x, a_star_graph_3d.grid_size.x - 1)
#var y: int = Game.randi_in_range(32 * index, 1 - a_star_graph_3d.grid_size.y, a_star_graph_3d.grid_size.y - 1)
# var chosen_obstacle: int = Game.randi_in_range(4 * index, 0, obstacle_scenes.size() - 1)
# var obstacle: GridMap = obstacle_scenes[chosen_obstacle].instantiate() as GridMap
# var orientations: Array[int] = [0, 90, 180, 270]
# var chosen_orientation: int = Game.randi_in_range(15 * index, 0, orientations.size() - 1)
# #obstacle.position = Vector3(x, 0, y)
# obstacle.set_rotation_degrees(Vector3(0, chosen_orientation, 0))
# add_child(obstacle)
# for cell: Vector3i in obstacle.get_used_cells():
# var cell_coord: Vector3 = obstacle.to_global(obstacle.map_to_local(cell))
# remove_world_tile(round(cell_coord.x), round(cell_coord.z))
# obstacle.queue_free()
func cell_coord_to_astar_point(x: int, y: int) -> int:
var center_point_x: int = floori(a_star_graph_3d.grid_size.x / 2.0) * a_star_graph_3d.grid_size.y
var center_point_y: int = floori(a_star_graph_3d.grid_size.y / 2.0)
return (center_point_x + (int(x / 2.0) * a_star_graph_3d.grid_size.y)) + (center_point_y + int(y / 2.0))
#func cell_coord_to_astar_point(x: int, y: int) -> int:
# var center_point_x: int = floori(a_star_graph_3d.grid_size.x / 2.0) * a_star_graph_3d.grid_size.y
# var center_point_y: int = floori(a_star_graph_3d.grid_size.y / 2.0)
# return (center_point_x + (int(x / 2.0) * a_star_graph_3d.grid_size.y)) + (center_point_y + int(y / 2.0))
func remove_world_tile(x: int, y: int) -> void:
if get_cell_item(Vector3i(x, 0, y)) != 1 or abs(x) >= a_star_graph_3d.grid_size.x or abs(y) >= a_star_graph_3d.grid_size.y:
return
set_cell_item(Vector3i(x, 0, y), INVALID_CELL_ITEM)
var point: int = cell_coord_to_astar_point(x, y)
var north_point: int = cell_coord_to_astar_point(x - 1, y)
var south_point: int = cell_coord_to_astar_point(x + 1, y)
var east_point: int = cell_coord_to_astar_point(x, y + 1)
var west_point: int = cell_coord_to_astar_point(x, y - 1)
if x % 2 == 0 and y % 2 == 0: #If the tile is on a point on the pathfinding grid
a_star_graph_3d.astar.set_point_disabled(point)
if x % 2 == 1 and y % 2 == 0: #If the cell breaks a north-south link
a_star_graph_3d.astar.disconnect_points(north_point, south_point)
if x % 2 == 0 and y % 2 == 1: #If the cell breaks a east-west link
a_star_graph_3d.astar.disconnect_points(east_point, west_point)
#func remove_world_tile(x: int, y: int) -> void:
# if get_cell_item(Vector3i(x, 0, y)) != 1 or abs(x) >= a_star_graph_3d.grid_size.x or abs(y) >= a_star_graph_3d.grid_size.y:
# return
# set_cell_item(Vector3i(x, 0, y), INVALID_CELL_ITEM)
# var point: int = cell_coord_to_astar_point(x, y)
# var north_point: int = cell_coord_to_astar_point(x - 1, y)
# var south_point: int = cell_coord_to_astar_point(x + 1, y)
# var east_point: int = cell_coord_to_astar_point(x, y + 1)
# var west_point: int = cell_coord_to_astar_point(x, y - 1)
# if x % 2 == 0 and y % 2 == 0: #If the tile is on a point on the pathfinding grid
# a_star_graph_3d.astar.set_point_disabled(point)
# if x % 2 == 1 and y % 2 == 0: #If the cell breaks a north-south link
# a_star_graph_3d.astar.disconnect_points(north_point, south_point)
# if x % 2 == 0 and y % 2 == 1: #If the cell breaks a east-west link
# a_star_graph_3d.astar.disconnect_points(east_point, west_point)

View File

@ -18,7 +18,7 @@ func to_dict() -> Dictionary:
enemy_count = group.enemy.epic_group
elif group.rarity == Data.Rarity.LEGENDARY:
enemy_count = group.enemy.legendary_group
if !dict.has(Data.enemies.find(group.enemy)):
dict[Data.enemies.find(group.enemy)] = 0
dict[Data.enemies.find(group.enemy)] += enemy_count
if !dict.has(group.enemy.title):
dict[group.enemy.title] = 0
dict[group.enemy.title] += enemy_count
return dict

View File

@ -33,6 +33,7 @@ static func generate_wave(spawn_power: int, spawn_pool: Array[Enemy], spawners:
var new_card: EnemyCard = EnemyCard.new()
#First, choose an enemy at random
#TODO: Use seeded random
new_card.enemy = spawn_pool.pick_random()
#Next, we have to figure out if we can actually buy that enemy
@ -61,10 +62,11 @@ static func generate_wave(spawn_power: int, spawn_pool: Array[Enemy], spawners:
#Even the common rarity was too expensive, so we have to choose
#a different enemy and try this process again
var enemy_id: int = spawn_pool.find(new_card.enemy)
enemy_id -= 1
if enemy_id <= 0:
new_card.enemy = spawn_pool[spawn_pool.size() - 1]
else:
new_card.enemy = spawn_pool[enemy_id - 1]
new_card.enemy = spawn_pool[enemy_id]
#Now that we know which rarities we could afford, lets just choose a
#random one

139
Shader/foliage.gdshader Normal file
View File

@ -0,0 +1,139 @@
shader_type spatial;
render_mode depth_draw_opaque, specular_schlick_ggx, depth_prepass_alpha ;
//render_mode blend_mix, cull_disabled, depth_draw_opaque, specular_disabled;
uniform vec4 TopColor : source_color = vec4(0.24, 0.47, 0.27, 1.0);
uniform vec4 BottomColor : source_color = vec4(0.13, 0.33, 0.25, 1.0);
uniform sampler2D Alpha;
uniform vec4 FresnelColor : source_color = vec4(0.58, 0.65, 0.33, 1.0);
uniform float WindScale : hint_range(1.0, 20.0) = 1.0;
uniform float WindSpeed : hint_range(0.0, 20.0) = 4.0;
uniform float WindStrength : hint_range(1.0, 20.0) = 5.0;
uniform float WindDensity : hint_range(1.0, 20.0) = 5.0;
uniform float ClampTop : hint_range(0.0, 1.0) = 1.0;
uniform float ClampBtm : hint_range(-1.0, 0.0) = 0.0;
uniform float MeshScale : hint_range(-5.0, 5.0) = -0.333;
uniform float ColorRamp : hint_range(0.05, 5.0) = 0.3;
uniform float FaceRoationVariation : hint_range(-3.0, 3.0) = 1.0;
uniform float FresnelStrength : hint_range(-2.0, 2.0) = 0.5;
uniform float FresnelBlend : hint_range(-1.0, 1.0) = 1.0;
uniform bool DeactivateGlobalVariation;
// Uniforms for wiggling
uniform sampler2D WiggleNoise : hint_default_black;
uniform float WiggleFrequency = 3.0;
uniform float WiggleStrength = 0.1;
uniform float WiggleSpeed = 1.0;
uniform float WiggleScale = 3.0;
uniform float DistanceScale : hint_range(0.0, 5.0) = 0.5;
uniform float DistanceStart = 0;
uniform float DistanceScaleRange = 70;
vec2 rotateUV(vec2 uv, float rotation, vec2 mid)
{
float cosAngle = cos(rotation);
float sinAngle = sin(rotation);
return vec2(
cosAngle * (uv.x - mid.x) + sinAngle * (uv.y - mid.y) + mid.x,
cosAngle * (uv.y - mid.y) - sinAngle * (uv.x - mid.x) + mid.y
);
}
varying vec3 obj_vertex;
void vertex()
{
float distanceScale = 1.0;
vec3 world_pos = (MODEL_MATRIX * vec4(VERTEX, 1.0)).xyz; //Generates world coordinates for vertecies
vec3 distance_vector = world_pos - (INV_VIEW_MATRIX * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
float square_distance = distance_vector.x * distance_vector.x + distance_vector.y * distance_vector.y + distance_vector.z * distance_vector.z;
float square_end = (DistanceScaleRange + DistanceStart) * (DistanceScaleRange + DistanceStart);
float square_start = DistanceStart * DistanceStart;
float square_range = square_end - square_start;
float distance_influence = clamp((square_distance - square_start) / square_range, 0.0, 1.0);
//Camera-Orientation based on https://www.youtube.com/watch?v=iASMFba7GeI
vec3 orient_2d = vec3(1.0, 1.0, 0.0) - vec3(UV.x, UV.y, 0.0);
orient_2d *= 2.0;
orient_2d -= vec3(1.0, 1.0, 0.0);
orient_2d *= -1.0;
orient_2d *= MeshScale;
orient_2d *= (1.0 + distance_influence * DistanceScale);
//random tilt
float angle = 6.248 * UV2.x * FaceRoationVariation;
float cos_ang = cos(angle);
float sin_ang = sin(angle);
mat3 rotation = mat3(vec3(cos_ang, -sin_ang, 0.0),vec3(sin_ang, cos_ang, 0.0),vec3(0.0, 0.0, 0.0));
orient_2d *= rotation;
vec3 oriented_offset = reflect((INV_VIEW_MATRIX * vec4(orient_2d, 0.0)).xyz,INV_VIEW_MATRIX[0].xyz);
//vec3 oriented_offset = (INV_VIEW_MATRIX * vec4(orient_2d, 0.0)).xyz;
vec3 obj_oriented_offset = (vec4(oriented_offset, 0.0) * MODEL_MATRIX).xyz;
//Wind-Effect
//adapted from: https://github.com/ruffiely/windshader_godot
float contribution = 1.0 * (1.0 - float(DeactivateGlobalVariation));
vec3 world_pos_eff = world_pos * contribution; //Generates world coordinates for vertecies
// Removed using world_position due to dragging bug
float positional_influence = -VERTEX.x + VERTEX.z -world_pos_eff.x + world_pos_eff.z;
float offset = fract(positional_influence * (1.0 / WindScale) + (TIME * WindScale/1000.0)); //Generates linear curve that slides along vertecies in world space
offset = min(1.0 - offset, offset); //Makes generated curve a smooth gradient
offset = (1.0 - offset) * offset * 2.0; //Smoothes gradient further
float t = TIME + sin(TIME + offset + cos(TIME + offset * WindStrength * 2.0) * WindStrength); //Generates noise in world space value
//float mask = fract(v.y * wind_density) * v.y; //Generates vertical mask, so leaves on top move further than leaves on bottom
//mask = clamp(mask, 0.0, 1.0); //Clamps mask
float mask = clamp(VERTEX.y* WindDensity, 0.0, 1.0) * (ClampTop - ClampBtm) + ClampBtm;
float si = sin(t) / 20.0 * WindStrength * offset; //Generates clamped noise, adds strength, applies gradient mask
float csi = cos(t)/ 20.0 * WindStrength * offset; //Generates clamped noise with offset, adds strength, applies gradient mask
vec3 wind_offset = vec3(VERTEX.x * si * mask, VERTEX.y * si * mask, VERTEX.z * csi * mask);
float col = VERTEX.y * ColorRamp;
COLOR = vec4(col, positional_influence, distance_influence, 1.0);
VERTEX += obj_oriented_offset + wind_offset;
obj_vertex = VERTEX;
}
void fragment()
{
float rate_col1 = clamp(COLOR.r,0.0, 1.0);
float rate_col2 = 1.0 - rate_col1;
float fresnel = pow(1.0 - clamp(dot(NORMAL, VIEW), 0.0, 1.0), 3.0);
float fresnel_rate = clamp(rate_col1,0.1,1);
vec3 albedo = TopColor.rgb* rate_col1 + BottomColor.rgb * rate_col2;
vec3 fres_col = albedo *(1.0 - FresnelStrength);
fres_col += FresnelColor.rgb * FresnelStrength;
fres_col *= fresnel;
fres_col *= fresnel_rate;
fres_col *= FresnelBlend;
//fres_col *= (1.0 - COLOR.b);
vec2 wiggle_uv = normalize(obj_vertex.xz) / WiggleScale;
float wiggle = texture(WiggleNoise, wiggle_uv + TIME * WiggleSpeed).r;
float wiggle_final_strength = wiggle * WiggleStrength;
wiggle_final_strength *= clamp(sin(TIME * WiggleFrequency + COLOR.g * 0.2), 0.0, 1.0);
vec2 uv = UV;
uv = rotateUV(uv, wiggle_final_strength, vec2(0.5));
uv = clamp(uv, 0.0, 1.0);
vec3 tex = texture(Alpha, uv.xy).rgb;
float x = COLOR.b;
float alpha = clamp(tex.r + tex.g * 2.0 * COLOR.b ,0.0, 1.0);
alpha = clamp((clamp(tex.g * 1.0 , 1.0 - x, 1.0) - (1.0 - x)) * 10.0 + tex.r, 0.0, 1.0);
//albedo = vec3(COLOR.b,COLOR.b,COLOR.b);
ALBEDO = albedo;
ALPHA = alpha;
EMISSION = fres_col;
}

View File

@ -0,0 +1 @@
uid://bjetf8dvc4ki3

BIN
Textures/Leaves001-03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cpaatg41nqqj3"
path.s3tc="res://.godot/imported/Leaves001-03.png-baa7e90c41173231ccdeec0adc6aa5cc.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Textures/Leaves001-03.png"
dest_files=["res://.godot/imported/Leaves001-03.png-baa7e90c41173231ccdeec0adc6aa5cc.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

BIN
Textures/Leaves001-04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

View File

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://me42hv1kdegm"
path.s3tc="res://.godot/imported/Leaves001-04.png-9b4dbb04a0a5d2a040de985a66b81170.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://Textures/Leaves001-04.png"
dest_files=["res://.godot/imported/Leaves001-04.png-9b4dbb04a0a5d2a040de985a66b81170.s3tc.ctex"]
[params]
compress/mode=2
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
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=0

View File

@ -0,0 +1,6 @@
class_name AchievementPopup extends PanelContainer
func set_achievement(text: String, sprite: Texture) -> void:
$HBoxContainer/Label.text = text
$HBoxContainer/TextureRect.texture = sprite

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=4 format=3 uid="uid://cmn22yceqewx1"]
[ext_resource type="Script" uid="uid://3n5mrdgjsn8e" path="res://achievement_popup.gd" id="1_ah4h2"]
[ext_resource type="Script" uid="uid://3n5mrdgjsn8e" path="res://UI/AchievementPopup/achievement_popup.gd" id="1_ah4h2"]
[ext_resource type="Texture2D" uid="uid://ctbi3gm1me1t5" path="res://Assets/Textures/unlock_mage_achievement.png" id="2_nbrip"]
[sub_resource type="AtlasTexture" id="AtlasTexture_um1rr"]

View File

@ -1,6 +1,6 @@
[gd_scene load_steps=6 format=3 uid="uid://d17c77pqsi8oy"]
[ext_resource type="Script" uid="uid://b8j7mw1xwisi" path="res://enemy_card_ui.gd" id="1_i1ei4"]
[ext_resource type="Script" uid="uid://b8j7mw1xwisi" path="res://UI/EnemyCard/enemy_card_ui.gd" id="1_i1ei4"]
[ext_resource type="Texture2D" uid="uid://g00wwrlxxdc5" path="res://Assets/Textures/icon_eye_dog.png" id="2_3r04h"]
[ext_resource type="Texture2D" uid="uid://c7tnda7he8u5l" path="res://Assets/Textures/stars_legendary-Sheet.png" id="3_uu1bb"]

View File

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 728 B

View File

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://gw2x6bjgny3d"
path="res://.godot/imported/mouse_left.png-18b9812901600e97610dc54a3c547462.ctex"
path="res://.godot/imported/mouse_left.png-b48f6f60f28824c34a34f4180779783c.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://KennyControllerPrompts/Mouse/mouse_left.png"
dest_files=["res://.godot/imported/mouse_left.png-18b9812901600e97610dc54a3c547462.ctex"]
source_file="res://UI/Keybinding/KennyControllerPrompts/Mouse/mouse_left.png"
dest_files=["res://.godot/imported/mouse_left.png-b48f6f60f28824c34a34f4180779783c.ctex"]
[params]

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c2e1jacw7iua6"
path="res://.godot/imported/mouse_move.png-27928c84bcd1ec79fda24626a793e774.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://UI/Keybinding/KennyControllerPrompts/Mouse/mouse_move.png"
dest_files=["res://.godot/imported/mouse_move.png-27928c84bcd1ec79fda24626a793e774.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

View File

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 725 B

View File

@ -3,15 +3,15 @@
importer="texture"
type="CompressedTexture2D"
uid="uid://cqligs870jt1d"
path="res://.godot/imported/mouse_right.png-a5355b7f11006c5b29339f9fd2b6c401.ctex"
path="res://.godot/imported/mouse_right.png-5b7bb56baa9fc3692e1582c22a7a93f4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://KennyControllerPrompts/Mouse/mouse_right.png"
dest_files=["res://.godot/imported/mouse_right.png-a5355b7f11006c5b29339f9fd2b6c401.ctex"]
source_file="res://UI/Keybinding/KennyControllerPrompts/Mouse/mouse_right.png"
dest_files=["res://.godot/imported/mouse_right.png-5b7bb56baa9fc3692e1582c22a7a93f4.ctex"]
[params]

View File

Before

Width:  |  Height:  |  Size: 729 B

After

Width:  |  Height:  |  Size: 729 B

Some files were not shown because too many files have changed in this diff Show More