added corpses and a wall building dissolve animation

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

View File

@ -1,12 +1,12 @@
[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="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="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="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="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"]
@ -25,7 +25,7 @@ status_manager = NodePath("StatusEffector")
movement_controller = NodePath("BeeliningController")
health = NodePath("Health")
sprite = NodePath("DirectionSprite")
health_bar_gradient = ExtResource("2_ql1oc")
corpse_scene = ExtResource("2_aed6c")
[node name="Health" type="Node" parent="."]
script = ExtResource("3_wiose")
@ -73,23 +73,15 @@ offset_bottom = 32.0
grow_horizontal = 2
alignment = 1
[node name="ProgressBar" type="TextureProgressBar" parent="SubViewport"]
[node name="HealthBar" parent="SubViewport" instance=ExtResource("9_4xla1")]
visible = false
offset_top = 36.0
offset_right = 200.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")]
script = ExtResource("9_cx8mv")
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="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://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="Texture2D" uid="uid://d0vafwv4lhjji" path="res://Assets/TextureAtlases/bubble.tres" id="3_homny"]
@ -9,6 +10,7 @@ script = ExtResource("1_wjbfx")
title = "bubble"
target_type = 2
icon = ExtResource("1_57rr1")
death_sprite = ExtResource("1_ioqxi")
sprite = ExtResource("3_homny")
spawn_power = 4
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="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"]
@ -9,6 +10,7 @@ script = ExtResource("1_q5r05")
title = "spike"
target_type = 2
icon = ExtResource("1_22o7e")
death_sprite = ExtResource("1_1js8q")
sprite = ExtResource("3_tbb38")
spawn_power = 6
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="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"]
[sub_resource type="AtlasTexture" id="AtlasTexture_n6kdu"]
@ -15,6 +16,7 @@ script = ExtResource("1_2lqbg")
title = "dog"
target_type = 1
icon = ExtResource("1_es0ht")
death_sprite = ExtResource("1_w6c0l")
sprite = SubResource("AtlasTexture_n6kdu")
spawn_power = 10
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://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="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"
target_type = 1
icon = ExtResource("1_2o720")
death_sprite = ExtResource("1_5xm32")
sprite = ExtResource("2_1m62w")
spawn_power = 100
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="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"]
[resource]
@ -9,6 +10,7 @@ script = ExtResource("1_k5sd1")
title = "fast dog"
target_type = 1
icon = ExtResource("1_xgen5")
death_sprite = ExtResource("1_yj87d")
sprite = ExtResource("2_mkbm6")
spawn_power = 16
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="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"]
[resource]
@ -9,6 +10,7 @@ script = ExtResource("1_q48il")
title = "heavy dog"
target_type = 1
icon = ExtResource("1_lck53")
death_sprite = ExtResource("1_qveaa")
sprite = ExtResource("2_7nc4x")
spawn_power = 14
health = 350

View File

@ -4,14 +4,14 @@ class_name EnemyController
signal reached_goal(enemy, penalty)
signal died(enemy)
@export var stats : Enemy
@export var status_manager : StatusEffector
@export var movement_controller : EnemyMovement
@export var health : Health
@export var sprite : Sprite3D
@export var health_bar_gradient : Gradient
@export var stats: Enemy
@export var status_manager: StatusEffector
@export var movement_controller: EnemyMovement
@export var health: Health
@export var sprite: Sprite3D
@export var corpse_scene: PackedScene
var movement_speed
var movement_speed: float
var movement_speed_penalty := 1.0
var alive = true
@ -19,8 +19,7 @@ var alive = true
func _ready() -> void:
health.max_health = stats.health
health.current_health = stats.health
$SubViewport/ProgressBar.max_value = stats.health
$SubViewport/ProgressBar.value = stats.health
$SubViewport/HealthBar.setup(stats.health)
sprite.texture = stats.sprite.duplicate()
movement_speed = stats.movement_speed
@ -40,11 +39,8 @@ func die():
if alive:
alive = false
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()
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://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="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="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="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"]
[sub_resource type="SphereShape3D" id="SphereShape3D_21dgw"]
@ -30,7 +30,7 @@ status_manager = NodePath("StatusEffector")
movement_controller = NodePath("PathingController")
health = NodePath("Health")
sprite = NodePath("DirectionSprite")
health_bar_gradient = ExtResource("2_jn5to")
corpse_scene = ExtResource("2_y7h25")
[node name="Health" type="Node" parent="."]
script = ExtResource("2_swu53")
@ -78,23 +78,15 @@ offset_bottom = 32.0
grow_horizontal = 2
alignment = 1
[node name="ProgressBar" type="TextureProgressBar" parent="SubViewport"]
[node name="HealthBar" parent="SubViewport" instance=ExtResource("10_or8n6")]
visible = false
offset_top = 36.0
offset_right = 200.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")]
script = ExtResource("10_gljle")
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="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"]
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")
cell_size = Vector3(1, 1, 1)
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")]
enemy_spawns = [NodePath("GroundSpawn"), NodePath("AirSpawn")]
enemy_goals = [NodePath("EnemyGoal")]
corpses = NodePath("Corpses")
a_star_graph_3d = NodePath("AStarGraph3D")
cinematic_cam = NodePath("CinemaCam")
printer = NodePath("CardPrinter")
@ -1112,4 +1113,6 @@ layers = 4
modulate = Color(0.32549, 0.25098, 0.180392, 1)
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"]

File diff suppressed because one or more lines are too long