fixed the parity between air and land enemies. +added a lot of new cards
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=12 format=3 uid="uid://bjo2q6vca5qlv"]
|
||||
|
||||
[ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/air_enemy_controller.gd" id="1_lyo1o"]
|
||||
[ext_resource type="Resource" uid="uid://dsgkwh3opyqtx" path="res://Worlds/GreenPlanet/Enemies/airenemy.tres" id="2_6qx4a"]
|
||||
[ext_resource type="Script" path="res://Worlds/GreenPlanet/Enemies/enemy_controller.gd" id="1_m83kr"]
|
||||
[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"]
|
||||
@ -9,19 +8,21 @@
|
||||
[ext_resource type="Texture2D" uid="uid://r202vo47jw1q" path="res://Assets/Textures/enemyhealth.png" id="8_77uyi"]
|
||||
[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/beelining_controller.gd" id="9_cx8mv"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_21dgw"]
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_ss5ir"]
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[node name="Dog" type="CharacterBody3D" node_paths=PackedStringArray("status_manager") groups=["Enemies"]]
|
||||
[node name="Dog" type="CharacterBody3D" node_paths=PackedStringArray("status_manager", "movement_controller", "health") groups=["Enemies"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
motion_mode = 1
|
||||
script = ExtResource("1_lyo1o")
|
||||
stats = ExtResource("2_6qx4a")
|
||||
script = ExtResource("1_m83kr")
|
||||
status_manager = NodePath("StatusEffector")
|
||||
movement_controller = NodePath("BeeliningController")
|
||||
health = NodePath("Health")
|
||||
|
||||
[node name="Health" type="Node" parent="."]
|
||||
script = ExtResource("3_wiose")
|
||||
@ -32,7 +33,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.527022, 0)
|
||||
shape = SubResource("SphereShape3D_21dgw")
|
||||
script = ExtResource("5_433ie")
|
||||
|
||||
[node name="Sprite3D3" type="Sprite3D" parent="."]
|
||||
[node name="DirectionSprite" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(1.56, 0, 0, 0, 1.56, 0, 0, 0, 1.56, 0, 0.546419, 0)
|
||||
billboard = 1
|
||||
texture_filter = 0
|
||||
@ -51,9 +52,10 @@ layers = 4
|
||||
texture_filter = 0
|
||||
texture = ExtResource("9_7yfyh")
|
||||
|
||||
[node name="StatusEffector" type="Node3D" parent="." node_paths=PackedStringArray("hbox")]
|
||||
[node name="StatusEffector" type="Node3D" parent="." node_paths=PackedStringArray("hbox", "enemy")]
|
||||
script = ExtResource("9_7hati")
|
||||
hbox = NodePath("../SubViewport/HBoxContainer")
|
||||
enemy = NodePath("..")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
transparent_bg = true
|
||||
@ -80,6 +82,10 @@ 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_depleted" from="Health" to="." method="_on_health_health_depleted"]
|
||||
[connection signal="health_depleted" from="Health" to="." method="die"]
|
||||
[connection signal="took_damage" from="Hitbox" to="Health" method="take_damage"]
|
||||
|
@ -10,6 +10,7 @@ var alive = true
|
||||
@export var status_manager : StatusEffector
|
||||
|
||||
var movement_speed
|
||||
var movement_speed_penalty := 1.0
|
||||
var progress := 0.0
|
||||
var progress_ratio := 0.0
|
||||
var destination : Node3D
|
||||
@ -28,8 +29,8 @@ func damage(amount):
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
progress += movement_speed * delta
|
||||
velocity = global_position.direction_to(destination.global_position) * movement_speed
|
||||
progress += (movement_speed * clampf(movement_speed_penalty, 0.0, 1.0)) * delta
|
||||
velocity = global_position.direction_to(destination.global_position) * (movement_speed * clampf(movement_speed_penalty, 0.0, 1.0))
|
||||
move_and_slide()
|
||||
if global_position.distance_to(destination.global_position) <= 1.0:
|
||||
reached_goal.emit(stats, stats.penalty)
|
||||
|
@ -11,7 +11,7 @@ target_type = 2
|
||||
icon = ExtResource("1_57rr1")
|
||||
sprite = ExtResource("3_homny")
|
||||
spawn_power = 4
|
||||
health = 40
|
||||
health = 30
|
||||
penalty = 4
|
||||
movement_speed = 1.5
|
||||
spawn_cooldown = 0.5
|
||||
|
@ -10,8 +10,8 @@ title = "spike"
|
||||
target_type = 2
|
||||
icon = ExtResource("1_22o7e")
|
||||
sprite = ExtResource("3_tbb38")
|
||||
spawn_power = 8
|
||||
health = 100
|
||||
spawn_power = 6
|
||||
health = 90
|
||||
penalty = 7
|
||||
movement_speed = 1.0
|
||||
spawn_cooldown = 1.0
|
||||
|
@ -17,7 +17,7 @@ target_type = 1
|
||||
icon = ExtResource("1_es0ht")
|
||||
sprite = SubResource("AtlasTexture_n6kdu")
|
||||
spawn_power = 10
|
||||
health = 200
|
||||
health = 180
|
||||
penalty = 10
|
||||
movement_speed = 1.2
|
||||
spawn_cooldown = 1.2
|
||||
|
@ -11,7 +11,7 @@ target_type = 1
|
||||
icon = ExtResource("1_lck53")
|
||||
sprite = ExtResource("2_7nc4x")
|
||||
spawn_power = 14
|
||||
health = 400
|
||||
health = 350
|
||||
penalty = 10
|
||||
movement_speed = 0.8
|
||||
spawn_cooldown = 2.0
|
||||
|
@ -1,48 +1,48 @@
|
||||
extends PathFollow3D
|
||||
extends CharacterBody3D
|
||||
class_name EnemyController
|
||||
|
||||
signal reached_goal(enemy, penalty)
|
||||
signal died(enemy)
|
||||
|
||||
var alive = true
|
||||
|
||||
@export var stats : Enemy
|
||||
@export var status_manager : StatusEffector
|
||||
@export var movement_controller : EnemyMovement
|
||||
@export var health : Health
|
||||
|
||||
var movement_speed
|
||||
var movement_speed_penalty := 1.0
|
||||
var alive = true
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
$Dog/Health.max_health = stats.health
|
||||
$Dog/Health.current_health = stats.health
|
||||
$Dog/SubViewport/ProgressBar.max_value = stats.health
|
||||
$Dog/SubViewport/ProgressBar.value = stats.health
|
||||
$Dog/DirectionSprite.texture = stats.sprite.duplicate()
|
||||
health.max_health = stats.health
|
||||
health.current_health = stats.health
|
||||
$SubViewport/ProgressBar.max_value = stats.health
|
||||
$SubViewport/ProgressBar.value = stats.health
|
||||
$DirectionSprite.texture = stats.sprite.duplicate()
|
||||
movement_speed = stats.movement_speed
|
||||
|
||||
|
||||
func damage(amount):
|
||||
$Dog/Hitbox.damage(amount)
|
||||
$Hitbox.damage(amount)
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
progress += movement_speed * delta
|
||||
if progress_ratio >= 1:
|
||||
func goal_entered():
|
||||
if alive:
|
||||
alive = false
|
||||
reached_goal.emit(stats, stats.penalty)
|
||||
queue_free()
|
||||
|
||||
|
||||
func die():
|
||||
died.emit(stats)
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_health_health_depleted() -> void:
|
||||
if alive:
|
||||
alive = false
|
||||
die()
|
||||
died.emit(stats)
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_health_health_changed(health) -> void:
|
||||
$Dog/SubViewport/ProgressBar.value = health
|
||||
var percent = float($Dog/Health.current_health) / float($Dog/Health.max_health)
|
||||
$Dog/SubViewport/ProgressBar.tint_progress = Color(1 - percent, percent, 0.0)
|
||||
$Dog/SubViewport/ProgressBar.set_visible(true)
|
||||
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 = Color(1 - percent, percent, 0.0)
|
||||
$SubViewport/ProgressBar.set_visible(true)
|
||||
|
@ -3,79 +3,78 @@
|
||||
[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="PackedScene" uid="uid://ri8r03wqy80t" path="res://Scenes/8_direction_sprite.tscn" id="2_o7jmg"]
|
||||
[ext_resource type="Resource" uid="uid://8eba45hql7bo" path="res://Worlds/GreenPlanet/Enemies/dog.tres" id="2_sswqn"]
|
||||
[ext_resource type="Script" path="res://Scripts/health.gd" id="2_swu53"]
|
||||
[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/pathing_controller.gd" id="10_gljle"]
|
||||
[ext_resource type="Script" path="res://Scripts/StatusEffector.gd" id="10_txouh"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_21dgw"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_75ly7"]
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_73qac"]
|
||||
resource_local_to_scene = true
|
||||
atlas = ExtResource("3_naknq")
|
||||
region = Rect2(0, 0, 32, 32)
|
||||
|
||||
[sub_resource type="ViewportTexture" id="ViewportTexture_4tj6k"]
|
||||
viewport_path = NodePath("Dog/SubViewport")
|
||||
viewport_path = NodePath("SubViewport")
|
||||
|
||||
[node name="PathFollow3D" type="PathFollow3D" node_paths=PackedStringArray("status_manager") groups=["Enemies"]]
|
||||
loop = false
|
||||
script = ExtResource("1_fwsjt")
|
||||
stats = ExtResource("2_sswqn")
|
||||
status_manager = NodePath("Dog/StatusEffector")
|
||||
|
||||
[node name="Dog" type="CharacterBody3D" parent="."]
|
||||
[node name="Dog" type="CharacterBody3D" node_paths=PackedStringArray("status_manager", "movement_controller", "health") groups=["Enemies"]]
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
script = ExtResource("1_fwsjt")
|
||||
status_manager = NodePath("StatusEffector")
|
||||
movement_controller = NodePath("PathingController")
|
||||
health = NodePath("Health")
|
||||
|
||||
[node name="Health" type="Node" parent="Dog"]
|
||||
[node name="Health" type="Node" parent="."]
|
||||
script = ExtResource("2_swu53")
|
||||
damage_particle_scene = ExtResource("4_tn1tu")
|
||||
|
||||
[node name="Hitbox" type="CollisionShape3D" parent="Dog"]
|
||||
[node name="Hitbox" type="CollisionShape3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.527022, 0)
|
||||
shape = SubResource("SphereShape3D_21dgw")
|
||||
script = ExtResource("2_j8yin")
|
||||
|
||||
[node name="DirectionSprite" parent="Dog" instance=ExtResource("2_o7jmg")]
|
||||
[node name="DirectionSprite" parent="." instance=ExtResource("2_o7jmg")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.642479, 0)
|
||||
pixel_size = 0.04
|
||||
texture = SubResource("AtlasTexture_75ly7")
|
||||
texture = SubResource("AtlasTexture_73qac")
|
||||
|
||||
[node name="Sprite3D" type="Sprite3D" parent="Dog"]
|
||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(0.2, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0, 1.20821, 0)
|
||||
pixel_size = 0.02
|
||||
billboard = 1
|
||||
texture_filter = 0
|
||||
texture = SubResource("ViewportTexture_4tj6k")
|
||||
|
||||
[node name="Sprite3D2" type="Sprite3D" parent="Dog"]
|
||||
[node name="Sprite3D2" type="Sprite3D" parent="."]
|
||||
transform = Transform3D(2, 0, 0, 0, -8.74228e-08, 2, 0, -2, -8.74228e-08, 0, 1.40824, 0)
|
||||
layers = 4
|
||||
texture_filter = 0
|
||||
texture = ExtResource("9_f8btv")
|
||||
|
||||
[node name="StatusEffector" type="Node3D" parent="Dog" node_paths=PackedStringArray("hbox")]
|
||||
[node name="StatusEffector" type="Node3D" parent="." node_paths=PackedStringArray("hbox", "enemy")]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.18114, 0)
|
||||
script = ExtResource("10_txouh")
|
||||
hbox = NodePath("../SubViewport/HBoxContainer")
|
||||
enemy = NodePath("..")
|
||||
|
||||
[node name="SubViewport" type="SubViewport" parent="Dog"]
|
||||
[node name="SubViewport" type="SubViewport" parent="."]
|
||||
transparent_bg = true
|
||||
size = Vector2i(200, 55)
|
||||
render_target_update_mode = 4
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Dog/SubViewport"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="SubViewport"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 32.0
|
||||
grow_horizontal = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="ProgressBar" type="TextureProgressBar" parent="Dog/SubViewport"]
|
||||
[node name="ProgressBar" type="TextureProgressBar" parent="SubViewport"]
|
||||
visible = false
|
||||
offset_top = 36.0
|
||||
offset_right = 200.0
|
||||
@ -88,6 +87,10 @@ fill_mode = 6
|
||||
texture_progress = ExtResource("8_5ba7s")
|
||||
tint_progress = Color(0, 1, 0, 1)
|
||||
|
||||
[connection signal="health_changed" from="Dog/Health" to="." method="_on_health_health_changed"]
|
||||
[connection signal="health_depleted" from="Dog/Health" to="." method="_on_health_health_depleted"]
|
||||
[connection signal="took_damage" from="Dog/Hitbox" to="Dog/Health" method="take_damage"]
|
||||
[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_depleted" from="Health" to="." method="die"]
|
||||
[connection signal="took_damage" from="Hitbox" to="Health" method="take_damage"]
|
||||
|
Reference in New Issue
Block a user