added corpses and a wall building dissolve animation

This commit is contained in:
Lexi Quinn 2023-12-10 12:05:41 +11:00
parent adde9f5c3c
commit 046c4f5afb
39 changed files with 596 additions and 112 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 375 B

View File

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

After

Width:  |  Height:  |  Size: 296 B

View File

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

After

Width:  |  Height:  |  Size: 288 B

View File

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

After

Width:  |  Height:  |  Size: 296 B

View File

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

After

Width:  |  Height:  |  Size: 282 B

View File

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

After

Width:  |  Height:  |  Size: 315 B

View File

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

@ -17,6 +17,7 @@ class_name PlayerMovement
@export var max_height := 1.3 @export var max_height := 1.3
@export var time_to_peak := 0.5 @export var time_to_peak := 0.5
@export var time_to_floor := 0.35 @export var time_to_floor := 0.35
@onready var jump_velocity : float = (2 * max_height) / time_to_peak @onready var jump_velocity : float = (2 * max_height) / time_to_peak
@onready var jump_gravity : float = (-2 * max_height) / pow(time_to_peak, 2) @onready var jump_gravity : float = (-2 * max_height) / pow(time_to_peak, 2)
@onready var fall_gravity : float = (-2 * max_height) / pow(time_to_floor, 2) @onready var fall_gravity : float = (-2 * max_height) / pow(time_to_floor, 2)

25
Scenes/corpse.tscn Normal file
View File

@ -0,0 +1,25 @@
[gd_scene load_steps=4 format=3 uid="uid://canrxnpxcugc2"]
[ext_resource type="Script" path="res://corpse.gd" id="1_hdqtp"]
[ext_resource type="Texture2D" uid="uid://cdnhe2mi5c5ln" path="res://Assets/Textures/dead_eye_dog.png" id="2_6ext7"]
[sub_resource type="SphereShape3D" id="SphereShape3D_shai7"]
[node name="Node3D" type="RigidBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
collision_layer = 0
max_contacts_reported = 1
contact_monitor = true
script = ExtResource("1_hdqtp")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_shai7")
[node name="Sprite3D" type="Sprite3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.355108, 0)
pixel_size = 0.04
billboard = 1
texture_filter = 0
texture = ExtResource("2_6ext7")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]

30
Scenes/health_bar.tscn Normal file
View File

@ -0,0 +1,30 @@
[gd_scene load_steps=4 format=3 uid="uid://hjq3nrnumklp"]
[ext_resource type="Texture2D" uid="uid://r202vo47jw1q" path="res://Assets/Textures/enemyhealth.png" id="1_x8m88"]
[ext_resource type="Script" path="res://Scripts/health_bar.gd" id="2_m8c1f"]
[ext_resource type="Gradient" uid="uid://dx7auy3oqw82t" path="res://health_bar_gradient.tres" id="3_dpmma"]
[node name="HealthBar" type="TextureProgressBar"]
offset_right = 200.0
offset_bottom = 200.0
grow_horizontal = 2
grow_vertical = 2
step = 0.0
value = 100.0
fill_mode = 6
texture_progress = ExtResource("1_x8m88")
tint_progress = Color(0, 1, 0, 1)
script = ExtResource("2_m8c1f")
health_bar_gradient = ExtResource("3_dpmma")
[node name="PreviousHealthBar" type="TextureProgressBar" parent="."]
z_index = -1
layout_mode = 0
offset_right = 200.0
offset_bottom = 200.0
grow_horizontal = 2
grow_vertical = 2
step = 0.0
value = 100.0
fill_mode = 6
texture_progress = ExtResource("1_x8m88")

View File

@ -21,11 +21,6 @@ var enemy_names = []
@export var pickup_notif_scene : PackedScene @export var pickup_notif_scene : PackedScene
@export var wave_start_label : Label @export var wave_start_label : Label
var wave_start_label_shrinking := false
var wave_start_label_growing := false
var wave_start_label_ease_time := 1.0
var wave_start_label_ease_progress := 0.0
func set_energy_visible(value): func set_energy_visible(value):
weapon_energy_bar.set_visible(value) weapon_energy_bar.set_visible(value)
@ -35,40 +30,29 @@ func set_offhand_energy_visible(value):
offhand_energy_bar.set_visible(value) offhand_energy_bar.set_visible(value)
func ease_in_out_quart(x : float) -> float:
return 8.0 * x * x * x * x if x < 0.5 else 1 - pow(-2.0 * x + 2.0, 4) / 2.0
func _process(delta: float) -> void: func _process(delta: float) -> void:
fps_label.text = "FPS: " + str(Engine.get_frames_per_second()) fps_label.text = "FPS: " + str(Engine.get_frames_per_second())
wave_start_label.text = "Press [" + Data.player_keymap.ready.as_text_key_label() + "] to start wave" wave_start_label.text = "Press [" + Data.player_keymap.ready.as_text_key_label() + "] to start wave"
if wave_start_label_growing or wave_start_label_shrinking:
wave_start_label_ease_progress += delta
if wave_start_label_growing:
wave_start_label.set_visible(true)
wave_start_label.offset_left = lerp(0.0, -300.0, ease_in_out_quart(wave_start_label_ease_progress / wave_start_label_ease_time))
wave_start_label.offset_right = lerp(0.0, 300.0, ease_in_out_quart(wave_start_label_ease_progress / wave_start_label_ease_time))
if wave_start_label_ease_progress >= wave_start_label_ease_time:
wave_start_label_growing = false
wave_start_label_ease_progress = 0.0
elif wave_start_label_shrinking:
wave_start_label.offset_left = lerp(-300.0, 0.0, ease_in_out_quart(wave_start_label_ease_progress / wave_start_label_ease_time))
wave_start_label.offset_right = lerp(300.0, 0.0, ease_in_out_quart(wave_start_label_ease_progress / wave_start_label_ease_time))
if wave_start_label_ease_progress >= wave_start_label_ease_time:
wave_start_label.set_visible(false)
wave_start_label_shrinking = false
wave_start_label_ease_progress = 0.0
func grow_wave_start_label(): func grow_wave_start_label():
wave_start_label_growing = true tween_label(300.0)
wave_start_label_shrinking = false
func shrink_wave_start_label(): func shrink_wave_start_label():
wave_start_label_shrinking = true tween_label(0.0)
wave_start_label_growing = false
func tween_label(x: float) -> void:
var tween = create_tween()
tween.set_ease(Tween.EASE_IN_OUT)
tween.set_trans(Tween.TRANS_QUAD)
if x > 0.0:
tween.tween_callback(wave_start_label.set_visible.bind(true))
tween.parallel().tween_property(wave_start_label, "offset_left", -x, 0.6)
tween.parallel().tween_property(wave_start_label, "offset_right", x, 0.6)
if x <= 0.0:
tween.tween_callback(wave_start_label.set_visible.bind(false))
func set_hover_text(text): func set_hover_text(text):

View File

@ -1,12 +1,13 @@
extends Resource extends Resource
class_name Enemy class_name Enemy
@export var title = "dog" @export var title := "dog"
@export var target_type : Data.EnemyType @export var target_type: Data.EnemyType
@export var icon : Texture @export var icon: Texture
@export var sprite : AtlasTexture @export var death_sprite: Texture
@export var spawn_power := 10 @export var sprite: AtlasTexture
@export var health = 100 @export var spawn_power:= 10
@export var penalty = 10 @export var health := 100
@export var movement_speed = 0.5 @export var penalty := 10
@export var spawn_cooldown = 1.0 @export var movement_speed := 0.5
@export var spawn_cooldown := 1.0

View File

@ -5,7 +5,6 @@ class_name EditTool
@export var inventory : Inventory @export var inventory : Inventory
@export var ray : RayCast3D @export var ray : RayCast3D
@export var wall_preview : TowerBase @export var wall_preview : TowerBase
@export var build_preview_material : StandardMaterial3D
@export var progress_bar : TextureProgressBar @export var progress_bar : TextureProgressBar
var enabled := true var enabled := true
@ -27,9 +26,10 @@ var interact_hold_time := 0.4
func _ready() -> void: func _ready() -> void:
wall_preview.set_material(build_preview_material) var c = Color.GREEN
build_preview_material.albedo_color = Color.GREEN c.a = 0.8
build_preview_material.albedo_color.a = 0.8 wall_preview.set_color(c)
wall_preview.set_float(0.0)
wall_preview.toggle_collision() wall_preview.toggle_collision()
@ -39,13 +39,14 @@ func _process(delta: float) -> void:
ray_point = null ray_point = null
wall_preview.set_visible(false) wall_preview.set_visible(false)
if is_instance_valid(last_collider): if is_instance_valid(last_collider):
Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_material(null) Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_float(1.0)
last_collider = null last_collider = null
return 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): 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 interact_held_time += delta
set_progress_percent(interact_held_time / interact_hold_time) 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: if interact_held_time >= interact_hold_time:
set_progress_percent(0) set_progress_percent(0)
interacted_once = true interacted_once = true
@ -61,6 +62,7 @@ func _process(delta: float) -> void:
interact_held_time = 0.0 interact_held_time = 0.0
interacted_once = false interacted_once = false
set_progress_percent(0) set_progress_percent(0)
wall_preview.set_float(0.0)
point_id = -1 point_id = -1
if !interacted_once and ray.is_colliding(): if !interacted_once and ray.is_colliding():
@ -76,21 +78,20 @@ func _process(delta: float) -> void:
if obstacle_last_point != point_id: if obstacle_last_point != point_id:
obstacle_last_point = point_id obstacle_last_point = point_id
if is_instance_valid(last_collider): if is_instance_valid(last_collider):
Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_material(null) Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_float(1.0)
last_collider = null last_collider = null
if tower_preview: if tower_preview:
delete_tower_preview() delete_tower_preview()
wall_preview.set_visible(false) wall_preview.set_visible(false)
last_collider = ray_collider last_collider = ray_collider
ray_collider.set_material(build_preview_material) ray_collider.set_color(Color.RED)
build_preview_material.albedo_color = Color.RED ray_collider.set_float(0.0)
build_preview_material.albedo_color.a = 1.0
if inventory.contents.size() > 0 and !ray_collider.has_card: if inventory.contents.size() > 0 and !ray_collider.has_card:
if ray_collider != last_tower_base or inventory.selected_item != last_card: if ray_collider != last_tower_base or inventory.selected_item != last_card:
spawn_tower_preview() spawn_tower_preview()
elif Game.level: elif Game.level:
if is_instance_valid(last_collider): if is_instance_valid(last_collider):
Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_material(null) Game.level.a_star_graph_3d.tower_base_ids[last_collider.point_id].set_float(1.0)
last_collider = null last_collider = null
if tower_preview: if tower_preview:
delete_tower_preview() delete_tower_preview()
@ -104,8 +105,10 @@ func _process(delta: float) -> void:
if obstacle_last_point != point_id: if obstacle_last_point != point_id:
obstacle_last_point = point_id obstacle_last_point = point_id
if Game.level.a_star_graph_3d.test_path_if_point_toggled(point_id): if Game.level.a_star_graph_3d.test_path_if_point_toggled(point_id):
build_preview_material.albedo_color = Color.GREEN var c = Color.GREEN
build_preview_material.albedo_color.a = 0.8 c.a = 0.8
wall_preview.set_color(c)
wall_preview.set_float(0.0)
valid_point = true valid_point = true
else: else:
#build_preview_material.albedo_color = Color.RED #build_preview_material.albedo_color = Color.RED

27
Scripts/health_bar.gd Normal file
View File

@ -0,0 +1,27 @@
extends TextureProgressBar
@export var health_bar_gradient: Gradient
@onready var prev_bar = $PreviousHealthBar
func setup(health: float):
max_value = health
value = health
prev_bar.max_value = health
prev_bar.value = health
func on_health_changed(health: float):
set_visible(true)
var health_went_down = true if health < value else false
value = health
tint_progress = health_bar_gradient.sample(value / max_value)
if health_went_down:
var tween = create_tween()
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_QUINT)
tween.tween_interval(0.3)
tween.tween_property(prev_bar, "value", value, 0.7)
else:
prev_bar.value = value

View File

@ -5,6 +5,7 @@ class_name Level
@export var player_spawns : Array[Node3D] = [] @export var player_spawns : Array[Node3D] = []
@export var enemy_spawns : Array[Node3D] = [] @export var enemy_spawns : Array[Node3D] = []
@export var enemy_goals : Array[Node3D] = [] @export var enemy_goals : Array[Node3D] = []
@export var corpses: Node3D
@export var a_star_graph_3d : AStarGraph3D @export var a_star_graph_3d : AStarGraph3D
@export var cinematic_cam : CinematicCamManager @export var cinematic_cam : CinematicCamManager
@export var printer : CardPrinter @export var printer : CardPrinter

View File

@ -14,6 +14,7 @@ func _ready() -> void:
bg_level.a_star_graph_3d.build_random_maze(50) bg_level.a_star_graph_3d.build_random_maze(50)
bg_level.a_star_graph_3d.place_random_towers(20) bg_level.a_star_graph_3d.place_random_towers(20)
bg_level.a_star_graph_3d.disable_all_tower_frames() bg_level.a_star_graph_3d.disable_all_tower_frames()
Game.level = bg_level
var new_wave = WaveManager.generate_wave(400, bg_level.enemy_pool) var new_wave = WaveManager.generate_wave(400, bg_level.enemy_pool)
for spawn in bg_level.enemy_spawns: for spawn in bg_level.enemy_spawns:
spawn.signal_for_after_enemy_died = enemy_died spawn.signal_for_after_enemy_died = enemy_died

View File

@ -28,6 +28,14 @@ var has_card : bool :
return inventory.contents.size() != 0 return inventory.contents.size() != 0
func set_color(color: Color):
$MeshInstance3D.set_instance_shader_parameter("Color", color)
func set_float(value: float):
$MeshInstance3D.set_instance_shader_parameter("Float", value)
func add_card(card: Card, caller_id: int) -> bool: func add_card(card: Card, caller_id: int) -> bool:
var result = inventory.add(card) var result = inventory.add(card)
if result: if result:
@ -40,10 +48,6 @@ func remove_card():
networked_remove_tower.rpc() networked_remove_tower.rpc()
func set_material(value: StandardMaterial3D):
block.material_override = value
func toggle_collision(): func toggle_collision():
collider.disabled = !collider.disabled collider.disabled = !collider.disabled

View File

@ -1,12 +1,12 @@
[gd_scene load_steps=13 format=3 uid="uid://bjo2q6vca5qlv"] [gd_scene load_steps=13 format=3 uid="uid://bjo2q6vca5qlv"]
[ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_m83kr"] [ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_m83kr"]
[ext_resource type="Gradient" uid="uid://dx7auy3oqw82t" path="res://health_bar_gradient.tres" id="2_ql1oc"] [ext_resource type="PackedScene" uid="uid://canrxnpxcugc2" path="res://Scenes/corpse.tscn" id="2_aed6c"]
[ext_resource type="Script" path="res://Scripts/health.gd" id="3_wiose"] [ext_resource type="Script" path="res://Scripts/health.gd" id="3_wiose"]
[ext_resource type="PackedScene" uid="uid://cqtew0t8sttpm" path="res://Scenes/damage_particle.tscn" id="4_mhq3m"] [ext_resource type="PackedScene" uid="uid://cqtew0t8sttpm" path="res://Scenes/damage_particle.tscn" id="4_mhq3m"]
[ext_resource type="Script" path="res://Scripts/hitbox.gd" id="5_433ie"] [ext_resource type="Script" path="res://Scripts/hitbox.gd" id="5_433ie"]
[ext_resource type="Texture2D" uid="uid://chhmkmlfrobhu" path="res://Assets/Textures/bubble.png" id="6_ke2c8"] [ext_resource type="Texture2D" uid="uid://chhmkmlfrobhu" path="res://Assets/Textures/bubble.png" id="6_ke2c8"]
[ext_resource type="Texture2D" uid="uid://r202vo47jw1q" path="res://Assets/Textures/enemyhealth.png" id="8_77uyi"] [ext_resource type="PackedScene" uid="uid://hjq3nrnumklp" path="res://Scenes/health_bar.tscn" id="9_4xla1"]
[ext_resource type="Script" path="res://Scripts/StatusEffector.gd" id="9_7hati"] [ext_resource type="Script" path="res://Scripts/StatusEffector.gd" id="9_7hati"]
[ext_resource type="Texture2D" uid="uid://b1fn60m6xfcsq" path="res://Assets/Textures/minimap_enemy.png" id="9_7yfyh"] [ext_resource type="Texture2D" uid="uid://b1fn60m6xfcsq" path="res://Assets/Textures/minimap_enemy.png" id="9_7yfyh"]
[ext_resource type="Script" path="res://Scripts/EnemyAI/beelining_controller.gd" id="9_cx8mv"] [ext_resource type="Script" path="res://Scripts/EnemyAI/beelining_controller.gd" id="9_cx8mv"]
@ -25,7 +25,7 @@ status_manager = NodePath("StatusEffector")
movement_controller = NodePath("BeeliningController") movement_controller = NodePath("BeeliningController")
health = NodePath("Health") health = NodePath("Health")
sprite = NodePath("DirectionSprite") sprite = NodePath("DirectionSprite")
health_bar_gradient = ExtResource("2_ql1oc") corpse_scene = ExtResource("2_aed6c")
[node name="Health" type="Node" parent="."] [node name="Health" type="Node" parent="."]
script = ExtResource("3_wiose") script = ExtResource("3_wiose")
@ -73,23 +73,15 @@ offset_bottom = 32.0
grow_horizontal = 2 grow_horizontal = 2
alignment = 1 alignment = 1
[node name="ProgressBar" type="TextureProgressBar" parent="SubViewport"] [node name="HealthBar" parent="SubViewport" instance=ExtResource("9_4xla1")]
visible = false visible = false
offset_top = 36.0 offset_top = 36.0
offset_right = 200.0
offset_bottom = 236.0 offset_bottom = 236.0
grow_horizontal = 2
grow_vertical = 2
step = 0.0
value = 100.0
fill_mode = 6
texture_progress = ExtResource("8_77uyi")
tint_progress = Color(0, 1, 0, 1)
[node name="BeeliningController" type="Node" parent="." node_paths=PackedStringArray("character")] [node name="BeeliningController" type="Node" parent="." node_paths=PackedStringArray("character")]
script = ExtResource("9_cx8mv") script = ExtResource("9_cx8mv")
character = NodePath("..") character = NodePath("..")
[connection signal="health_changed" from="Health" to="." method="_on_health_health_changed"] [connection signal="health_changed" from="Health" to="SubViewport/HealthBar" method="on_health_changed"]
[connection signal="health_depleted" from="Health" to="." method="die"] [connection signal="health_depleted" from="Health" to="." method="die"]
[connection signal="took_damage" from="Hitbox" to="Health" method="take_damage"] [connection signal="took_damage" from="Hitbox" to="Health" method="take_damage"]

View File

@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=4 format=3 uid="uid://dsgkwh3opyqtx"] [gd_resource type="Resource" script_class="Enemy" load_steps=5 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://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" path="res://Scripts/Resources/enemy.gd" id="1_wjbfx"] [ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_wjbfx"]
[ext_resource type="Texture2D" uid="uid://d0vafwv4lhjji" path="res://Assets/TextureAtlases/bubble.tres" id="3_homny"] [ext_resource type="Texture2D" uid="uid://d0vafwv4lhjji" path="res://Assets/TextureAtlases/bubble.tres" id="3_homny"]
@ -9,6 +10,7 @@ script = ExtResource("1_wjbfx")
title = "bubble" title = "bubble"
target_type = 2 target_type = 2
icon = ExtResource("1_57rr1") icon = ExtResource("1_57rr1")
death_sprite = ExtResource("1_ioqxi")
sprite = ExtResource("3_homny") sprite = ExtResource("3_homny")
spawn_power = 4 spawn_power = 4
health = 30 health = 30

View File

@ -1,5 +1,6 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=4 format=3 uid="uid://bffhb5krs5elm"] [gd_resource type="Resource" script_class="Enemy" load_steps=5 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="Texture2D" uid="uid://duywsy7jmh4u" path="res://Assets/Textures/spike.png" id="1_22o7e"]
[ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_q5r05"] [ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_q5r05"]
[ext_resource type="Texture2D" uid="uid://sybn6bjbj5fh" path="res://Assets/TextureAtlases/spike.tres" id="3_tbb38"] [ext_resource type="Texture2D" uid="uid://sybn6bjbj5fh" path="res://Assets/TextureAtlases/spike.tres" id="3_tbb38"]
@ -9,6 +10,7 @@ script = ExtResource("1_q5r05")
title = "spike" title = "spike"
target_type = 2 target_type = 2
icon = ExtResource("1_22o7e") icon = ExtResource("1_22o7e")
death_sprite = ExtResource("1_1js8q")
sprite = ExtResource("3_tbb38") sprite = ExtResource("3_tbb38")
spawn_power = 6 spawn_power = 6
health = 90 health = 90

View File

@ -1,7 +1,8 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://8eba45hql7bo"] [gd_resource type="Resource" script_class="Enemy" load_steps=6 format=3 uid="uid://8eba45hql7bo"]
[ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_2lqbg"] [ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_2lqbg"]
[ext_resource type="Texture2D" uid="uid://g00wwrlxxdc5" path="res://Assets/Textures/icon_eye_dog.png" id="1_es0ht"] [ext_resource type="Texture2D" uid="uid://g00wwrlxxdc5" path="res://Assets/Textures/icon_eye_dog.png" id="1_es0ht"]
[ext_resource type="Texture2D" uid="uid://cdnhe2mi5c5ln" path="res://Assets/Textures/dead_eye_dog.png" id="1_w6c0l"]
[ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="2_vgx18"] [ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="2_vgx18"]
[sub_resource type="AtlasTexture" id="AtlasTexture_n6kdu"] [sub_resource type="AtlasTexture" id="AtlasTexture_n6kdu"]
@ -15,6 +16,7 @@ script = ExtResource("1_2lqbg")
title = "dog" title = "dog"
target_type = 1 target_type = 1
icon = ExtResource("1_es0ht") icon = ExtResource("1_es0ht")
death_sprite = ExtResource("1_w6c0l")
sprite = SubResource("AtlasTexture_n6kdu") sprite = SubResource("AtlasTexture_n6kdu")
spawn_power = 10 spawn_power = 10
health = 180 health = 180

View File

@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=4 format=3 uid="uid://boik1gnpl4v0a"] [gd_resource type="Resource" script_class="Enemy" load_steps=5 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://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" path="res://Scripts/Resources/enemy.gd" id="1_euaab"] [ext_resource type="Script" 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="Texture2D" uid="uid://ff3cys53p37j" path="res://Assets/TextureAtlases/dog_fast_boss.tres" id="2_1m62w"]
@ -9,6 +10,7 @@ script = ExtResource("1_euaab")
title = "boss dog" title = "boss dog"
target_type = 1 target_type = 1
icon = ExtResource("1_2o720") icon = ExtResource("1_2o720")
death_sprite = ExtResource("1_5xm32")
sprite = ExtResource("2_1m62w") sprite = ExtResource("2_1m62w")
spawn_power = 100 spawn_power = 100
health = 1000 health = 1000

View File

@ -1,7 +1,8 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=4 format=3 uid="uid://cvehqh4tt28g7"] [gd_resource type="Resource" script_class="Enemy" load_steps=5 format=3 uid="uid://cvehqh4tt28g7"]
[ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_k5sd1"] [ext_resource type="Script" 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://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="Texture2D" uid="uid://dd212gh03wloa" path="res://Assets/TextureAtlases/dog_fast.tres" id="2_mkbm6"]
[resource] [resource]
@ -9,6 +10,7 @@ script = ExtResource("1_k5sd1")
title = "fast dog" title = "fast dog"
target_type = 1 target_type = 1
icon = ExtResource("1_xgen5") icon = ExtResource("1_xgen5")
death_sprite = ExtResource("1_yj87d")
sprite = ExtResource("2_mkbm6") sprite = ExtResource("2_mkbm6")
spawn_power = 16 spawn_power = 16
health = 100 health = 100

View File

@ -1,7 +1,8 @@
[gd_resource type="Resource" script_class="Enemy" load_steps=4 format=3 uid="uid://dxi17xvdlhkvc"] [gd_resource type="Resource" script_class="Enemy" load_steps=5 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="Texture2D" uid="uid://08n5jvq5tptf" path="res://Assets/Textures/icon_eye_dog_heavy.png" id="1_lck53"]
[ext_resource type="Script" path="res://Scripts/Resources/enemy.gd" id="1_q48il"] [ext_resource type="Script" 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="Texture2D" uid="uid://c0543ucoalwmi" path="res://Assets/TextureAtlases/dog_fast_heavy.tres" id="2_7nc4x"]
[resource] [resource]
@ -9,6 +10,7 @@ script = ExtResource("1_q48il")
title = "heavy dog" title = "heavy dog"
target_type = 1 target_type = 1
icon = ExtResource("1_lck53") icon = ExtResource("1_lck53")
death_sprite = ExtResource("1_qveaa")
sprite = ExtResource("2_7nc4x") sprite = ExtResource("2_7nc4x")
spawn_power = 14 spawn_power = 14
health = 350 health = 350

View File

@ -4,14 +4,14 @@ class_name EnemyController
signal reached_goal(enemy, penalty) signal reached_goal(enemy, penalty)
signal died(enemy) signal died(enemy)
@export var stats : Enemy @export var stats: Enemy
@export var status_manager : StatusEffector @export var status_manager: StatusEffector
@export var movement_controller : EnemyMovement @export var movement_controller: EnemyMovement
@export var health : Health @export var health: Health
@export var sprite : Sprite3D @export var sprite: Sprite3D
@export var health_bar_gradient : Gradient @export var corpse_scene: PackedScene
var movement_speed var movement_speed: float
var movement_speed_penalty := 1.0 var movement_speed_penalty := 1.0
var alive = true var alive = true
@ -19,8 +19,7 @@ var alive = true
func _ready() -> void: func _ready() -> void:
health.max_health = stats.health health.max_health = stats.health
health.current_health = stats.health health.current_health = stats.health
$SubViewport/ProgressBar.max_value = stats.health $SubViewport/HealthBar.setup(stats.health)
$SubViewport/ProgressBar.value = stats.health
sprite.texture = stats.sprite.duplicate() sprite.texture = stats.sprite.duplicate()
movement_speed = stats.movement_speed movement_speed = stats.movement_speed
@ -40,11 +39,8 @@ func die():
if alive: if alive:
alive = false alive = false
died.emit(stats) died.emit(stats)
var corpse = corpse_scene.instantiate()
corpse.set_sprite(stats.death_sprite)
corpse.position = global_position
Game.level.corpses.add_child(corpse)
queue_free() queue_free()
func _on_health_health_changed(value) -> void:
$SubViewport/ProgressBar.value = value
var percent = float(health.current_health) / float(health.max_health)
$SubViewport/ProgressBar.tint_progress = health_bar_gradient.sample(percent)
$SubViewport/ProgressBar.set_visible(true)

View File

@ -2,14 +2,14 @@
[ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_fwsjt"] [ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_fwsjt"]
[ext_resource type="Script" path="res://Scripts/hitbox.gd" id="2_j8yin"] [ext_resource type="Script" path="res://Scripts/hitbox.gd" id="2_j8yin"]
[ext_resource type="Gradient" uid="uid://dx7auy3oqw82t" path="res://health_bar_gradient.tres" id="2_jn5to"]
[ext_resource type="PackedScene" uid="uid://ri8r03wqy80t" path="res://Scenes/8_direction_sprite.tscn" id="2_o7jmg"] [ext_resource type="PackedScene" uid="uid://ri8r03wqy80t" path="res://Scenes/8_direction_sprite.tscn" id="2_o7jmg"]
[ext_resource type="Script" path="res://Scripts/health.gd" id="2_swu53"] [ext_resource type="Script" path="res://Scripts/health.gd" id="2_swu53"]
[ext_resource type="PackedScene" uid="uid://canrxnpxcugc2" path="res://Scenes/corpse.tscn" id="2_y7h25"]
[ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="3_naknq"] [ext_resource type="Texture2D" uid="uid://dj13g1w14mekw" path="res://Assets/Textures/eye_dog.png" id="3_naknq"]
[ext_resource type="PackedScene" uid="uid://cqtew0t8sttpm" path="res://Scenes/damage_particle.tscn" id="4_tn1tu"] [ext_resource type="PackedScene" uid="uid://cqtew0t8sttpm" path="res://Scenes/damage_particle.tscn" id="4_tn1tu"]
[ext_resource type="Texture2D" uid="uid://r202vo47jw1q" path="res://Assets/Textures/enemyhealth.png" id="8_5ba7s"]
[ext_resource type="Texture2D" uid="uid://b1fn60m6xfcsq" path="res://Assets/Textures/minimap_enemy.png" id="9_f8btv"] [ext_resource type="Texture2D" uid="uid://b1fn60m6xfcsq" path="res://Assets/Textures/minimap_enemy.png" id="9_f8btv"]
[ext_resource type="Script" path="res://Scripts/EnemyAI/pathing_controller.gd" id="10_gljle"] [ext_resource type="Script" path="res://Scripts/EnemyAI/pathing_controller.gd" id="10_gljle"]
[ext_resource type="PackedScene" uid="uid://hjq3nrnumklp" path="res://Scenes/health_bar.tscn" id="10_or8n6"]
[ext_resource type="Script" path="res://Scripts/StatusEffector.gd" id="10_txouh"] [ext_resource type="Script" path="res://Scripts/StatusEffector.gd" id="10_txouh"]
[sub_resource type="SphereShape3D" id="SphereShape3D_21dgw"] [sub_resource type="SphereShape3D" id="SphereShape3D_21dgw"]
@ -30,7 +30,7 @@ status_manager = NodePath("StatusEffector")
movement_controller = NodePath("PathingController") movement_controller = NodePath("PathingController")
health = NodePath("Health") health = NodePath("Health")
sprite = NodePath("DirectionSprite") sprite = NodePath("DirectionSprite")
health_bar_gradient = ExtResource("2_jn5to") corpse_scene = ExtResource("2_y7h25")
[node name="Health" type="Node" parent="."] [node name="Health" type="Node" parent="."]
script = ExtResource("2_swu53") script = ExtResource("2_swu53")
@ -78,23 +78,15 @@ offset_bottom = 32.0
grow_horizontal = 2 grow_horizontal = 2
alignment = 1 alignment = 1
[node name="ProgressBar" type="TextureProgressBar" parent="SubViewport"] [node name="HealthBar" parent="SubViewport" instance=ExtResource("10_or8n6")]
visible = false visible = false
offset_top = 36.0 offset_top = 36.0
offset_right = 200.0
offset_bottom = 236.0 offset_bottom = 236.0
grow_horizontal = 2
grow_vertical = 2
step = 0.0
value = 100.0
fill_mode = 6
texture_progress = ExtResource("8_5ba7s")
tint_progress = Color(0, 1, 0, 1)
[node name="PathingController" type="Node" parent="." node_paths=PackedStringArray("character")] [node name="PathingController" type="Node" parent="." node_paths=PackedStringArray("character")]
script = ExtResource("10_gljle") script = ExtResource("10_gljle")
character = NodePath("..") character = NodePath("..")
[connection signal="health_changed" from="Health" to="." method="_on_health_health_changed"] [connection signal="health_changed" from="Health" to="SubViewport/HealthBar" method="on_health_changed"]
[connection signal="health_depleted" from="Health" to="." method="die"] [connection signal="health_depleted" from="Health" to="." method="die"]
[connection signal="took_damage" from="Hitbox" to="Health" method="take_damage"] [connection signal="took_damage" from="Hitbox" to="Health" method="take_damage"]

View File

@ -117,7 +117,7 @@ texture_filter = 0
[sub_resource type="QuadMesh" id="QuadMesh_dyydf"] [sub_resource type="QuadMesh" id="QuadMesh_dyydf"]
material = SubResource("StandardMaterial3D_sugxr") material = SubResource("StandardMaterial3D_sugxr")
[node name="GridMap" type="GridMap" node_paths=PackedStringArray("player_spawns", "enemy_spawns", "enemy_goals", "a_star_graph_3d", "cinematic_cam", "printer", "shop")] [node name="GridMap" type="GridMap" node_paths=PackedStringArray("player_spawns", "enemy_spawns", "enemy_goals", "corpses", "a_star_graph_3d", "cinematic_cam", "printer", "shop")]
mesh_library = ExtResource("12_ywwug") mesh_library = ExtResource("12_ywwug")
cell_size = Vector3(1, 1, 1) cell_size = Vector3(1, 1, 1)
cell_center_x = false cell_center_x = false
@ -130,6 +130,7 @@ enemy_pool = Array[Resource("res://Scripts/Resources/enemy.gd")]([ExtResource("3
player_spawns = [NodePath("PlayerSpawnLocations/PlayerSpawn1"), NodePath("PlayerSpawnLocations/PlayerSpawn2"), NodePath("PlayerSpawnLocations/PlayerSpawn3"), NodePath("PlayerSpawnLocations/PlayerSpawn4")] player_spawns = [NodePath("PlayerSpawnLocations/PlayerSpawn1"), NodePath("PlayerSpawnLocations/PlayerSpawn2"), NodePath("PlayerSpawnLocations/PlayerSpawn3"), NodePath("PlayerSpawnLocations/PlayerSpawn4")]
enemy_spawns = [NodePath("GroundSpawn"), NodePath("AirSpawn")] enemy_spawns = [NodePath("GroundSpawn"), NodePath("AirSpawn")]
enemy_goals = [NodePath("EnemyGoal")] enemy_goals = [NodePath("EnemyGoal")]
corpses = NodePath("Corpses")
a_star_graph_3d = NodePath("AStarGraph3D") a_star_graph_3d = NodePath("AStarGraph3D")
cinematic_cam = NodePath("CinemaCam") cinematic_cam = NodePath("CinemaCam")
printer = NodePath("CardPrinter") printer = NodePath("CardPrinter")
@ -1112,4 +1113,6 @@ layers = 4
modulate = Color(0.32549, 0.25098, 0.180392, 1) modulate = Color(0.32549, 0.25098, 0.180392, 1)
texture = ExtResource("21_flsqn") texture = ExtResource("21_flsqn")
[node name="Corpses" type="Node3D" parent="."]
[connection signal="body_entered" from="EnemyGoal/Area3D" to="EnemyGoal" method="_on_area_3d_body_entered"] [connection signal="body_entered" from="EnemyGoal/Area3D" to="EnemyGoal" method="_on_area_3d_body_entered"]

File diff suppressed because one or more lines are too long

16
corpse.gd Normal file
View File

@ -0,0 +1,16 @@
extends RigidBody3D
func set_sprite(tex: Texture):
$Sprite3D.texture = tex
func _ready() -> void:
var tween = create_tween()
tween.tween_interval(15.0)
tween.tween_property($Sprite3D, "modulate", Color(1.0, 1.0, 1.0, 0.0), 4.0)
tween.tween_callback(queue_free)
func _on_body_entered(body: Node) -> void:
freeze = true

182
dissolve.tres Normal file
View File

@ -0,0 +1,182 @@
[gd_resource type="VisualShader" load_steps=17 format=3 uid="uid://dsi0ofa74tfc4"]
[ext_resource type="Texture2D" uid="uid://bmor4v4j7krgh" path="res://funboxtex.png" id="1_h83w8"]
[ext_resource type="Texture2D" uid="uid://c4ytjp05u7auv" path="res://noisetex.tres" id="2_pgkht"]
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_ugjxq"]
source = 5
texture = ExtResource("1_h83w8")
[sub_resource type="VisualShaderNodeTexture2DParameter" id="VisualShaderNodeTexture2DParameter_hqcdo"]
parameter_name = "Texture2DParameter"
qualifier = 2
texture_type = 1
texture_filter = 1
[sub_resource type="VisualShaderNodeColorParameter" id="VisualShaderNodeColorParameter_rwgpq"]
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)
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_g2jnk"]
output_port_for_preview = 0
default_input_values = [0, Quaternion(0, 0, 0, 0), 1, Quaternion(0, 0, 0, 0)]
op_type = 2
operator = 2
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_ddxtc"]
default_input_values = [0, Quaternion(0, 0, 0, 0), 1, Quaternion(0, 0, 0, 0)]
expanded_output_ports = [0]
op_type = 2
operator = 2
[sub_resource type="VisualShaderNodeInput" id="VisualShaderNodeInput_nxokf"]
output_port_for_preview = 0
input_name = "uv"
[sub_resource type="VisualShaderNodeVectorFunc" id="VisualShaderNodeVectorFunc_lymyr"]
output_port_for_preview = 0
default_input_values = [0, Quaternion(0, 0, 0, 0)]
op_type = 2
function = 32
[sub_resource type="VisualShaderNodeVectorOp" id="VisualShaderNodeVectorOp_s08rr"]
output_port_for_preview = 4
default_input_values = [0, Quaternion(0, 0, 0, 0), 1, Quaternion(0, 0, 0, 0)]
expanded_output_ports = [0]
op_type = 2
[sub_resource type="VisualShaderNodeFloatParameter" id="VisualShaderNodeFloatParameter_8utgl"]
parameter_name = "Float"
qualifier = 2
default_value_enabled = true
default_value = 1.0
[sub_resource type="VisualShaderNodeFloatFunc" id="VisualShaderNodeFloatFunc_pyn4g"]
function = 31
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_pw0qj"]
default_input_values = [0, 0.0, 1, 0.5]
operator = 1
[sub_resource type="VisualShaderNodeTexture" id="VisualShaderNodeTexture_4c6mr"]
output_port_for_preview = 0
texture = ExtResource("2_pgkht")
[sub_resource type="VisualShaderNodeFloatOp" id="VisualShaderNodeFloatOp_v8kd6"]
output_port_for_preview = 0
operator = 1
[sub_resource type="VisualShaderNodeFloatFunc" id="VisualShaderNodeFloatFunc_h0gpf"]
output_port_for_preview = 0
function = 15
[resource]
code = "shader_type spatial;
render_mode blend_mix, depth_draw_always, cull_back, diffuse_lambert, specular_schlick_ggx, depth_prepass_alpha;
uniform sampler2D Texture2DParameter : source_color, filter_nearest;
uniform sampler2D tex_frg_7;
instance uniform float Float = 1;
instance uniform vec4 Color : source_color = vec4(0.000000, 1.000000, 0.000000, 0.752941);
void fragment() {
vec4 n_out13p0;
// Texture2D:13
n_out13p0 = texture(Texture2DParameter, UV);
// Input:2
vec2 n_out2p0 = UV;
// Texture2D:7
vec4 n_out7p0 = texture(tex_frg_7, n_out2p0);
// FloatParameter:23
float n_out23p0 = Float;
// FloatFunc:24
float n_out24p0 = 1.0 - n_out23p0;
// FloatOp:5
float n_in5p1 = 0.50000;
float n_out5p0 = n_out24p0 - n_in5p1;
// FloatOp:8
float n_out8p0 = n_out7p0.x - n_out5p0;
// FloatFunc:9
float n_out9p0 = round(n_out8p0);
// VectorOp:18
vec4 n_out18p0 = n_out13p0 * vec4(n_out9p0);
// VectorFunc:21
vec4 n_out21p0 = vec4(1.0) - vec4(n_out9p0);
// ColorParameter:15
vec4 n_out15p0 = Color;
// VectorOp:19
vec4 n_out19p0 = n_out21p0 * n_out15p0;
// VectorOp:22
vec4 n_out22p0 = n_out18p0 + n_out19p0;
float n_out22p4 = n_out22p0.a;
// Output:0
ALBEDO = vec3(n_out22p0.xyz);
ALPHA = n_out22p4;
}
"
modes/depth_draw = 1
flags/depth_prepass_alpha = true
nodes/fragment/0/position = Vector2(1220, 280)
nodes/fragment/2/node = SubResource("VisualShaderNodeInput_nxokf")
nodes/fragment/2/position = Vector2(-580, 180)
nodes/fragment/5/node = SubResource("VisualShaderNodeFloatOp_pw0qj")
nodes/fragment/5/position = Vector2(-500, 440)
nodes/fragment/7/node = SubResource("VisualShaderNodeTexture_4c6mr")
nodes/fragment/7/position = Vector2(-280, 20)
nodes/fragment/8/node = SubResource("VisualShaderNodeFloatOp_v8kd6")
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/14/node = SubResource("VisualShaderNodeTexture2DParameter_hqcdo")
nodes/fragment/14/position = Vector2(-60, 0)
nodes/fragment/15/node = SubResource("VisualShaderNodeColorParameter_rwgpq")
nodes/fragment/15/position = Vector2(40, 940)
nodes/fragment/18/node = SubResource("VisualShaderNodeVectorOp_g2jnk")
nodes/fragment/18/position = Vector2(500, 340)
nodes/fragment/19/node = SubResource("VisualShaderNodeVectorOp_ddxtc")
nodes/fragment/19/position = Vector2(600, 740)
nodes/fragment/21/node = SubResource("VisualShaderNodeVectorFunc_lymyr")
nodes/fragment/21/position = Vector2(360, 660)
nodes/fragment/22/node = SubResource("VisualShaderNodeVectorOp_s08rr")
nodes/fragment/22/position = Vector2(900.954, 607.998)
nodes/fragment/23/node = SubResource("VisualShaderNodeFloatParameter_8utgl")
nodes/fragment/23/position = Vector2(-1000, 460)
nodes/fragment/24/node = SubResource("VisualShaderNodeFloatFunc_pyn4g")
nodes/fragment/24/position = Vector2(-700, 460)
nodes/fragment/connections = PackedInt32Array(2, 0, 7, 0, 14, 0, 13, 2, 8, 0, 9, 0, 9, 0, 18, 1, 9, 0, 21, 0, 15, 0, 19, 1, 21, 0, 19, 0, 18, 0, 22, 0, 19, 0, 22, 1, 22, 0, 0, 0, 22, 4, 0, 1, 13, 0, 18, 0, 7, 0, 8, 0, 5, 0, 8, 1, 23, 0, 24, 0, 24, 0, 5, 0)

View File

@ -2,5 +2,5 @@
[resource] [resource]
interpolation_color_space = 2 interpolation_color_space = 2
offsets = PackedFloat32Array(0, 0.131148, 0.409836, 1) offsets = PackedFloat32Array(0, 0.131148, 0.357143, 0.758242, 1)
colors = PackedColorArray(0.788235, 0, 0, 1, 0.818896, 0.282651, 0.000353087, 1, 0.839216, 0.847059, 0, 1, 0, 0.917647, 0, 1) colors = PackedColorArray(0.788235, 0, 0, 1, 0.818896, 0.282651, 0.000353087, 1, 0.945098, 1, 0, 1, 0.259747, 0.912524, 6.85382e-05, 1, 0, 0.917647, 0, 1)

10
noisetex.tres Normal file
View File

@ -0,0 +1,10 @@
[gd_resource type="NoiseTexture2D" load_steps=2 format=3 uid="uid://c4ytjp05u7auv"]
[sub_resource type="FastNoiseLite" id="FastNoiseLite_enb3d"]
frequency = 0.05
[resource]
width = 128
height = 128
generate_mipmaps = false
noise = SubResource("FastNoiseLite_enb3d")

Binary file not shown.