diff --git a/dungeon_test/Camera3d.cs b/dungeon_test/Camera3d.cs deleted file mode 100644 index 425cd499..00000000 --- a/dungeon_test/Camera3d.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Godot; -using System; - -public partial class Camera3d : Node3D -{ - public override void _Process(double delta) - { - this.RotateY((float)delta); - } -} diff --git a/dungeon_test/camera.tscn b/dungeon_test/camera.tscn deleted file mode 100644 index 1e6cf4cc..00000000 --- a/dungeon_test/camera.tscn +++ /dev/null @@ -1,31 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://ccnks05btp3f1"] - -[ext_resource type="PackedScene" uid="uid://dcgj5i52i76gj" path="res://src/enemy/enemy_types/michael/Michael.tscn" id="1_1iqeh"] -[ext_resource type="Script" path="res://src/enemy/enemy_types/michael/RotationTest.cs" id="2_c7eon"] -[ext_resource type="Script" path="res://dungeon_test/Camera3d.cs" id="3_ddadm"] - -[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4ork2"] -albedo_color = Color(0.282353, 0.172549, 0.521569, 1) - -[node name="Node3D" type="Node3D"] - -[node name="Michael" parent="." instance=ExtResource("1_1iqeh")] -script = ExtResource("2_c7eon") - -[node name="CurrentFrameLabel" type="Label" parent="Michael"] -unique_name_in_owner = true -offset_left = 467.0 -offset_top = 71.0 -offset_right = 1081.0 -offset_bottom = 291.0 - -[node name="CSGBox3D" type="CSGBox3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.962679, 0) -material_override = SubResource("StandardMaterial3D_4ork2") - -[node name="CamBase" type="Node3D" parent="."] -script = ExtResource("3_ddadm") - -[node name="TestCamera" type="Camera3D" parent="CamBase"] -unique_name_in_owner = true -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.357711, 2.14968) diff --git a/src/dialog/DialogueTest.tscn b/src/dialog/DialogueTest.tscn deleted file mode 100644 index a3fd6d2b..00000000 --- a/src/dialog/DialogueTest.tscn +++ /dev/null @@ -1,9 +0,0 @@ -[gd_scene format=3 uid="uid://b8n8hbe4kdyfw"] - -[node name="DialogueTest" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 diff --git a/src/enemy/Enemy.cs b/src/enemy/Enemy.cs index 14f65d22..6682a1c9 100644 --- a/src/enemy/Enemy.cs +++ b/src/enemy/Enemy.cs @@ -89,16 +89,22 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide EnemyBinding .Handle((in EnemyLogic.Output.MovementComputed output) => { + if (AnimationPlayer.CurrentAnimation != "hit" && AnimationPlayer.CurrentAnimation != "attack") + RotateEnemy(-GameRepo.PlayerGlobalTransform.Value.Basis.Z); MoveAndSlide(); }) .Handle((in EnemyLogic.Output.HitByPlayer output) => { - if (CurrentHP.Value > 0) - AnimationPlayer.Play("hit"); + AnimationPlayer.Stop(); + AnimationPlayer.Play("hit"); // TODO: Make this an event to notify game that player hit someone if (GameRepo.PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.WeaponTags.Contains(WeaponTag.SelfDamage)) GameRepo.PlayerData.SetCurrentHP(GameRepo.PlayerData.CurrentHP.Value - 5); }) + .Handle((in EnemyLogic.Output.Attack _) => + { + AnimationPlayer.Play("attack"); + }) .Handle((in EnemyLogic.Output.Defeated output) => { AnimationPlayer.Play("defeated"); @@ -130,13 +136,12 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide rng.Randomize(); var randomizedSpot = new Vector3(rng.RandfRange(-7.0f, 7.0f), 0, rng.RandfRange(-7.0f, 7.0f)); EnemyLogic.Input(new EnemyLogic.Input.PatrolToRandomSpot(GlobalPosition + randomizedSpot)); - PatrolTimer.WaitTime = rng.RandfRange(7.0f, 15.0f); + PatrolTimer.WaitTime = rng.RandfRange(1.0f, 3.0f); } public void OnPhysicsProcess(double delta) { EnemyLogic.Input(new EnemyLogic.Input.PhysicsTick(delta)); - RotateEnemy(-GameRepo.PlayerGlobalTransform.Value.Basis.Z); } public void OnPlayerHitboxEntered(Area3D body) @@ -201,17 +206,17 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide // Check if forward facing. If the dot product is -1, the enemy is facing the camera. if (forwardDotProduct < -rotateUpperThreshold) - AnimatedSprite.Play("idle_front_walk"); + AnimationPlayer.Play("idle_front_walk"); // Check if backward facing. If the dot product is 1, the enemy is facing the same direction as the camera. else if (forwardDotProduct > rotateUpperThreshold) - AnimatedSprite.Play("idle_back_walk"); + AnimationPlayer.Play("idle_back_walk"); else { // If the dot product of the perpendicular dot product is positive (up to 1), the enemy is facing to the left (since it's mirrored). AnimatedSprite.FlipH = leftDotProduct > 0; // Check is side facing. If the dot product is close to zero in the positive or negative direction, its close to the threshold for turning. if (Mathf.Abs(forwardDotProduct) < rotateLowerThreshold) - AnimatedSprite.Play("idle_left_walk"); + AnimationPlayer.Play("idle_left_walk"); } } diff --git a/src/enemy/EnemyDatabase.tscn b/src/enemy/EnemyDatabase.tscn index f27c0517..afde1c75 100644 --- a/src/enemy/EnemyDatabase.tscn +++ b/src/enemy/EnemyDatabase.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://dbvr8ewajja6a"] [ext_resource type="Script" path="res://src/enemy/EnemyDatabase.cs" id="1_ywy58"] -[ext_resource type="PackedScene" uid="uid://dcgj5i52i76gj" path="res://src/enemy/enemy_types/michael/Michael.tscn" id="2_8cbrh"] +[ext_resource type="PackedScene" uid="uid://dcgj5i52i76gj" path="res://src/enemy/enemy_types/BaseEnemy.tscn" id="2_8cbrh"] [node name="EnemyDatabase" type="Node"] script = ExtResource("1_ywy58") diff --git a/src/enemy/animations/Die.res b/src/enemy/animations/Die.res deleted file mode 100644 index 85fdea74..00000000 Binary files a/src/enemy/animations/Die.res and /dev/null differ diff --git a/src/enemy/animations/EnemyAnimations.res b/src/enemy/animations/EnemyAnimations.res deleted file mode 100644 index a9d23155..00000000 Binary files a/src/enemy/animations/EnemyAnimations.res and /dev/null differ diff --git a/src/enemy/animations/Hit.res b/src/enemy/animations/Hit.res deleted file mode 100644 index 8a86ad22..00000000 Binary files a/src/enemy/animations/Hit.res and /dev/null differ diff --git a/src/enemy/enemy_types/BaseEnemy.tscn b/src/enemy/enemy_types/BaseEnemy.tscn new file mode 100644 index 00000000..e8c863cc --- /dev/null +++ b/src/enemy/enemy_types/BaseEnemy.tscn @@ -0,0 +1,90 @@ +[gd_scene load_steps=8 format=3 uid="uid://dcgj5i52i76gj"] + +[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_e15u8"] +[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_7jlxu"] +[ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="6_3xvg5"] + +[sub_resource type="Resource" id="Resource_rxw8v"] +script = ExtResource("2_7jlxu") +CurrentHP = 45.0 +MaximumHP = 45.0 +CurrentAttack = 3 +CurrentDefense = 2 +MaxAttack = 3 +MaxDefense = 2 +Luck = 0.05 +TelluricResistance = null +AeolicResistance = null +HydricResistance = null +IgneousResistance = null +FerrumResistance = null +TelluricDamageBonus = null +AeolicDamageBonus = null +BaseHydricDamageBonus = null +IgneousDamageBonus = null +FerrumDamageBonus = null + +[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"] +height = 3.0 +radius = 1.0 + +[sub_resource type="BoxShape3D" id="BoxShape3D_0yire"] +size = Vector3(1, 0.564941, 1.14453) + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"] +height = 1.0 + +[node name="BaseEnemy" type="CharacterBody3D"] +process_mode = 1 +collision_layer = 10 +collision_mask = 11 +axis_lock_linear_y = true +script = ExtResource("1_e15u8") +EnemyStatResource = SubResource("Resource_rxw8v") + +[node name="LineOfSight" type="Area3D" parent="."] +unique_name_in_owner = true +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) +collision_layer = 2 +collision_mask = 2 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="LineOfSight"] +transform = Transform3D(1, 0, 0, 0, 0.0745088, 0.99722, 0, -0.99722, 0.0745088, 0, 0, -1.46944) +shape = SubResource("CylinderShape3D_jbgmx") + +[node name="PatrolTimer" type="Timer" parent="."] +unique_name_in_owner = true +wait_time = 10.0 +autostart = true + +[node name="AttackTimer" type="Timer" parent="."] +unique_name_in_owner = true +wait_time = 1.8 +autostart = true + +[node name="Hitbox" type="Area3D" parent="."] +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) +collision_layer = 64 +collision_mask = 64 +script = ExtResource("6_3xvg5") + +[node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -0.78415) +shape = SubResource("BoxShape3D_0yire") +disabled = true + +[node name="Raycast" type="RayCast3D" parent="."] +unique_name_in_owner = true +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) +target_position = Vector3(0, 0, -3) +collision_mask = 3 + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) +shape = SubResource("CapsuleShape3D_cwfph") + +[node name="NavAgent" type="NavigationAgent3D" parent="."] +unique_name_in_owner = true +avoidance_enabled = true +debug_enabled = true +debug_path_custom_color = Color(1, 0, 0, 1) diff --git a/src/enemy/enemy_types/michael/Michael.tscn b/src/enemy/enemy_types/michael/Michael.tscn index f71a4f33..37f1c882 100644 --- a/src/enemy/enemy_types/michael/Michael.tscn +++ b/src/enemy/enemy_types/michael/Michael.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=87 format=3 uid="uid://dcgj5i52i76gj"] +[gd_scene load_steps=90 format=3 uid="uid://b0gwivt7cw7nd"] [ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_a6wro"] [ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_x4pjh"] @@ -6,8 +6,8 @@ [ext_resource type="Shader" path="res://src/vfx/shaders/DamageHit.gdshader" id="3_ekj3e"] [ext_resource type="Material" uid="uid://c0gpeve05njqq" path="res://src/vfx/shaders/DamageHit.tres" id="4_01npl"] [ext_resource type="Texture2D" uid="uid://clpqh2pyqljkn" path="res://src/enemy/enemy_types/michael/animations/IDLE_WALK/BACK/Michael_Walk_Idle_Back (1).png" id="4_7kurm"] +[ext_resource type="Shader" path="res://src/vfx/shaders/PixelMelt.gdshader" id="4_h4oxj"] [ext_resource type="Texture2D" uid="uid://b0dec8ak2bo5t" path="res://src/enemy/enemy_types/michael/animations/IDLE_WALK/BACK/Michael_Walk_Idle_Back (2).png" id="5_1a1hr"] -[ext_resource type="Shader" path="res://src/vfx/shaders/PixelMelt.gdshader" id="5_lw20o"] [ext_resource type="Texture2D" uid="uid://tnmyksd68vmv" path="res://src/enemy/enemy_types/michael/animations/IDLE_WALK/BACK/Michael_Walk_Idle_Back (3).png" id="6_p47tl"] [ext_resource type="Texture2D" uid="uid://duwipvc2kl6xa" path="res://src/enemy/enemy_types/michael/animations/IDLE_WALK/BACK/Michael_Walk_Idle_Back (4).png" id="7_efmib"] [ext_resource type="Texture2D" uid="uid://dcd4v7jjxr8x2" path="res://src/enemy/enemy_types/michael/animations/IDLE_WALK/BACK/Michael_Walk_Idle_Back (5).png" id="8_ujyav"] @@ -85,182 +85,243 @@ CurrentDefense = 2 MaxAttack = 3 MaxDefense = 2 Luck = 0.05 -TelluricResistance = null -AeolicResistance = null -HydricResistance = null -IgneousResistance = null -FerrumResistance = null -TelluricDamageBonus = null -AeolicDamageBonus = null -BaseHydricDamageBonus = null -IgneousDamageBonus = null -FerrumDamageBonus = null +TelluricResistance = 0.0 +AeolicResistance = 0.0 +HydricResistance = 0.0 +IgneousResistance = 0.0 +FerrumResistance = 0.0 +TelluricDamageBonus = 0.0 +AeolicDamageBonus = 0.0 +BaseHydricDamageBonus = 0.0 +IgneousDamageBonus = 0.0 +FerrumDamageBonus = 0.0 [sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"] height = 3.0 radius = 1.0 -[sub_resource type="Animation" id="Animation_kr7ax"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Hitbox/CollisionShape3D:disabled") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [true] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [null] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [ExtResource("3_ekj3e")] -} -tracks/3/type = "value" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [-1.0] -} - -[sub_resource type="Animation" id="Animation_ce86e"] -resource_name = "attack" -length = 0.7 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Hitbox/CollisionShape3D:disabled") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.3, 0.5), -"transitions": PackedFloat32Array(1, 1, 1), -"update": 1, -"values": [true, false, true] -} - -[sub_resource type="Animation" id="Animation_8p0l1"] -resource_name = "defeated" -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [ExtResource("4_01npl")] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [ExtResource("5_lw20o")] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [0.0, 1.0] -} - -[sub_resource type="Animation" id="Animation_swr3w"] -resource_name = "hit" -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [ExtResource("4_01npl"), ExtResource("4_01npl")] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 1, -"values": [ExtResource("3_ekj3e"), null] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(0, 1), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [0.0, 1.0] -} - -[sub_resource type="AnimationLibrary" id="AnimationLibrary_346xs"] -_data = { -"RESET": SubResource("Animation_kr7ax"), -"attack": SubResource("Animation_ce86e"), -"defeated": SubResource("Animation_8p0l1"), -"hit": SubResource("Animation_swr3w") -} - [sub_resource type="BoxShape3D" id="BoxShape3D_0yire"] size = Vector3(1, 0.564941, 1.14453) [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"] height = 1.0 +[sub_resource type="Animation" id="Animation_41ppy"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:material:shader") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [null] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:material:shader_parameter/progress") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [-1.0] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:animation") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_front_walk"] +} +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:frame") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + +[sub_resource type="Animation" id="Animation_0k3e8"] +resource_name = "attack" +step = 0.0833333 + +[sub_resource type="Animation" id="Animation_htxsv"] +resource_name = "defeated" +length = 1.00001 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:material:shader") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [ExtResource("4_h4oxj")] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:material:shader_parameter/progress") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, 1.0] +} + +[sub_resource type="Animation" id="Animation_fjkm0"] +resource_name = "hit" +length = 0.666675 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:material:shader") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.666667), +"transitions": PackedFloat32Array(1, 1), +"update": 1, +"values": [ExtResource("3_ekj3e"), null] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:material:shader_parameter/progress") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.666667), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [-1.0, 1.0] +} + +[sub_resource type="Animation" id="Animation_3dffb"] +resource_name = "idle_front_walk" +length = 1.91667 +loop_mode = 1 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_front_walk"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667, 1.25, 1.33333, 1.41667, 1.5, 1.58333, 1.66667, 1.75, 1.83333), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] +} + +[sub_resource type="Animation" id="Animation_0qxqf"] +resource_name = "idle_left_walk" +length = 1.91667 +loop_mode = 1 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_left_walk"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667, 1.25, 1.33333, 1.41667, 1.5, 1.58333, 1.66667, 1.75, 1.83333), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] +} + +[sub_resource type="Animation" id="Animation_ppbeh"] +resource_name = "idle_back_walk" +length = 1.91667 +loop_mode = 1 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_back_walk"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Michael/Sprite/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75, 0.833333, 0.916666, 1, 1.08333, 1.16667, 1.25, 1.33333, 1.41667, 1.5, 1.58333, 1.66667, 1.75, 1.83333), +"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1), +"update": 1, +"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_346xs"] +_data = { +"RESET": SubResource("Animation_41ppy"), +"attack": SubResource("Animation_0k3e8"), +"defeated": SubResource("Animation_htxsv"), +"hit": SubResource("Animation_fjkm0"), +"idle_back_walk": SubResource("Animation_ppbeh"), +"idle_front_walk": SubResource("Animation_3dffb"), +"idle_left_walk": SubResource("Animation_0qxqf") +} + [sub_resource type="ViewportTexture" id="ViewportTexture_57rcc"] -viewport_path = NodePath("Sprite3D/SubViewport") +viewport_path = NodePath("Sprite/SubViewport") [sub_resource type="SpriteFrames" id="SpriteFrames_8xwq0"] animations = [{ @@ -515,12 +576,6 @@ unique_name_in_owner = true wait_time = 1.8 autostart = true -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -unique_name_in_owner = true -libraries = { -"": SubResource("AnimationLibrary_346xs") -} - [node name="Hitbox" type="Area3D" parent="."] transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0) collision_layer = 64 @@ -548,16 +603,24 @@ avoidance_enabled = true debug_enabled = true debug_path_custom_color = Color(1, 0, 0, 1) -[node name="Sprite3D" type="Sprite3D" parent="."] +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +unique_name_in_owner = true +root_node = NodePath("../..") +libraries = { +"": SubResource("AnimationLibrary_346xs") +} + +[node name="Sprite" type="Sprite3D" parent="."] billboard = 2 texture = SubResource("ViewportTexture_57rcc") -[node name="SubViewport" type="SubViewport" parent="Sprite3D"] +[node name="SubViewport" type="SubViewport" parent="Sprite"] transparent_bg = true size = Vector2i(95, 95) -[node name="AnimatedSprite" type="AnimatedSprite2D" parent="Sprite3D/SubViewport"] +[node name="AnimatedSprite" type="AnimatedSprite2D" parent="Sprite/SubViewport"] unique_name_in_owner = true +material = ExtResource("4_01npl") position = Vector2(45, 45) sprite_frames = SubResource("SpriteFrames_8xwq0") animation = &"idle_front_walk" diff --git a/src/enemy/enemy_types/michael/RotationTest.cs b/src/enemy/enemy_types/michael/RotationTest.cs deleted file mode 100644 index 8dbb31f5..00000000 --- a/src/enemy/enemy_types/michael/RotationTest.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Godot; - -public partial class RotationTest : CharacterBody3D -{ - private Camera3D _camera; - private AnimatedSprite3D _sprite; - private Label _frameLabel; - - private float _rotateUpperThreshold = 0.85f; - private float _rotateLowerThreshold = 0.3f; - - public override void _Ready() - { - _camera = GetParent().GetNode("%TestCamera"); - _sprite = GetNode("%AnimatedSprite"); - _frameLabel = GetNode