Not perfect but enemies move/attack with animation
@@ -1,10 +0,0 @@
|
|||||||
using Godot;
|
|
||||||
using System;
|
|
||||||
|
|
||||||
public partial class Camera3d : Node3D
|
|
||||||
{
|
|
||||||
public override void _Process(double delta)
|
|
||||||
{
|
|
||||||
this.RotateY((float)delta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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)
|
|
||||||
@@ -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
|
|
||||||
@@ -89,16 +89,22 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
|||||||
EnemyBinding
|
EnemyBinding
|
||||||
.Handle((in EnemyLogic.Output.MovementComputed output) =>
|
.Handle((in EnemyLogic.Output.MovementComputed output) =>
|
||||||
{
|
{
|
||||||
|
if (AnimationPlayer.CurrentAnimation != "hit" && AnimationPlayer.CurrentAnimation != "attack")
|
||||||
|
RotateEnemy(-GameRepo.PlayerGlobalTransform.Value.Basis.Z);
|
||||||
MoveAndSlide();
|
MoveAndSlide();
|
||||||
})
|
})
|
||||||
.Handle((in EnemyLogic.Output.HitByPlayer output) =>
|
.Handle((in EnemyLogic.Output.HitByPlayer output) =>
|
||||||
{
|
{
|
||||||
if (CurrentHP.Value > 0)
|
AnimationPlayer.Stop();
|
||||||
AnimationPlayer.Play("hit");
|
AnimationPlayer.Play("hit");
|
||||||
// TODO: Make this an event to notify game that player hit someone
|
// TODO: Make this an event to notify game that player hit someone
|
||||||
if (GameRepo.PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.WeaponTags.Contains(WeaponTag.SelfDamage))
|
if (GameRepo.PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.WeaponTags.Contains(WeaponTag.SelfDamage))
|
||||||
GameRepo.PlayerData.SetCurrentHP(GameRepo.PlayerData.CurrentHP.Value - 5);
|
GameRepo.PlayerData.SetCurrentHP(GameRepo.PlayerData.CurrentHP.Value - 5);
|
||||||
})
|
})
|
||||||
|
.Handle((in EnemyLogic.Output.Attack _) =>
|
||||||
|
{
|
||||||
|
AnimationPlayer.Play("attack");
|
||||||
|
})
|
||||||
.Handle((in EnemyLogic.Output.Defeated output) =>
|
.Handle((in EnemyLogic.Output.Defeated output) =>
|
||||||
{
|
{
|
||||||
AnimationPlayer.Play("defeated");
|
AnimationPlayer.Play("defeated");
|
||||||
@@ -130,13 +136,12 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
|||||||
rng.Randomize();
|
rng.Randomize();
|
||||||
var randomizedSpot = new Vector3(rng.RandfRange(-7.0f, 7.0f), 0, rng.RandfRange(-7.0f, 7.0f));
|
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));
|
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)
|
public void OnPhysicsProcess(double delta)
|
||||||
{
|
{
|
||||||
EnemyLogic.Input(new EnemyLogic.Input.PhysicsTick(delta));
|
EnemyLogic.Input(new EnemyLogic.Input.PhysicsTick(delta));
|
||||||
RotateEnemy(-GameRepo.PlayerGlobalTransform.Value.Basis.Z);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnPlayerHitboxEntered(Area3D body)
|
public void OnPlayerHitboxEntered(Area3D body)
|
||||||
@@ -201,17 +206,17 @@ public partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLogic>
|
|||||||
|
|
||||||
// Check if forward facing. If the dot product is -1, the enemy is facing the camera.
|
// Check if forward facing. If the dot product is -1, the enemy is facing the camera.
|
||||||
if (forwardDotProduct < -rotateUpperThreshold)
|
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.
|
// Check if backward facing. If the dot product is 1, the enemy is facing the same direction as the camera.
|
||||||
else if (forwardDotProduct > rotateUpperThreshold)
|
else if (forwardDotProduct > rotateUpperThreshold)
|
||||||
AnimatedSprite.Play("idle_back_walk");
|
AnimationPlayer.Play("idle_back_walk");
|
||||||
else
|
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).
|
// 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;
|
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.
|
// 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)
|
if (Mathf.Abs(forwardDotProduct) < rotateLowerThreshold)
|
||||||
AnimatedSprite.Play("idle_left_walk");
|
AnimationPlayer.Play("idle_left_walk");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://dbvr8ewajja6a"]
|
[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="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"]
|
[node name="EnemyDatabase" type="Node"]
|
||||||
script = ExtResource("1_ywy58")
|
script = ExtResource("1_ywy58")
|
||||||
|
|||||||
90
src/enemy/enemy_types/BaseEnemy.tscn
Normal file
@@ -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)
|
||||||
@@ -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/Enemy.cs" id="1_a6wro"]
|
||||||
[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_x4pjh"]
|
[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="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="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="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="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://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://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"]
|
[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
|
MaxAttack = 3
|
||||||
MaxDefense = 2
|
MaxDefense = 2
|
||||||
Luck = 0.05
|
Luck = 0.05
|
||||||
TelluricResistance = null
|
TelluricResistance = 0.0
|
||||||
AeolicResistance = null
|
AeolicResistance = 0.0
|
||||||
HydricResistance = null
|
HydricResistance = 0.0
|
||||||
IgneousResistance = null
|
IgneousResistance = 0.0
|
||||||
FerrumResistance = null
|
FerrumResistance = 0.0
|
||||||
TelluricDamageBonus = null
|
TelluricDamageBonus = 0.0
|
||||||
AeolicDamageBonus = null
|
AeolicDamageBonus = 0.0
|
||||||
BaseHydricDamageBonus = null
|
BaseHydricDamageBonus = 0.0
|
||||||
IgneousDamageBonus = null
|
IgneousDamageBonus = 0.0
|
||||||
FerrumDamageBonus = null
|
FerrumDamageBonus = 0.0
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"]
|
||||||
height = 3.0
|
height = 3.0
|
||||||
radius = 1.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"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_0yire"]
|
||||||
size = Vector3(1, 0.564941, 1.14453)
|
size = Vector3(1, 0.564941, 1.14453)
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"]
|
||||||
height = 1.0
|
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"]
|
[sub_resource type="ViewportTexture" id="ViewportTexture_57rcc"]
|
||||||
viewport_path = NodePath("Sprite3D/SubViewport")
|
viewport_path = NodePath("Sprite/SubViewport")
|
||||||
|
|
||||||
[sub_resource type="SpriteFrames" id="SpriteFrames_8xwq0"]
|
[sub_resource type="SpriteFrames" id="SpriteFrames_8xwq0"]
|
||||||
animations = [{
|
animations = [{
|
||||||
@@ -515,12 +576,6 @@ unique_name_in_owner = true
|
|||||||
wait_time = 1.8
|
wait_time = 1.8
|
||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
libraries = {
|
|
||||||
"": SubResource("AnimationLibrary_346xs")
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="Hitbox" type="Area3D" parent="."]
|
[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)
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0)
|
||||||
collision_layer = 64
|
collision_layer = 64
|
||||||
@@ -548,16 +603,24 @@ avoidance_enabled = true
|
|||||||
debug_enabled = true
|
debug_enabled = true
|
||||||
debug_path_custom_color = Color(1, 0, 0, 1)
|
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
|
billboard = 2
|
||||||
texture = SubResource("ViewportTexture_57rcc")
|
texture = SubResource("ViewportTexture_57rcc")
|
||||||
|
|
||||||
[node name="SubViewport" type="SubViewport" parent="Sprite3D"]
|
[node name="SubViewport" type="SubViewport" parent="Sprite"]
|
||||||
transparent_bg = true
|
transparent_bg = true
|
||||||
size = Vector2i(95, 95)
|
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
|
unique_name_in_owner = true
|
||||||
|
material = ExtResource("4_01npl")
|
||||||
position = Vector2(45, 45)
|
position = Vector2(45, 45)
|
||||||
sprite_frames = SubResource("SpriteFrames_8xwq0")
|
sprite_frames = SubResource("SpriteFrames_8xwq0")
|
||||||
animation = &"idle_front_walk"
|
animation = &"idle_front_walk"
|
||||||
|
|||||||
@@ -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<Camera3D>("%TestCamera");
|
|
||||||
_sprite = GetNode<AnimatedSprite3D>("%AnimatedSprite");
|
|
||||||
_frameLabel = GetNode<Label>("%CurrentFrameLabel");
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void _Process(double delta)
|
|
||||||
{
|
|
||||||
RotateEnemy(_camera.GlobalTransform.Basis.Z);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RotateEnemy(Vector3 cameraDirection)
|
|
||||||
{
|
|
||||||
var enemyForwardDirection = GlobalTransform.Basis.Z;
|
|
||||||
var enemyLeftDirection = GlobalTransform.Basis.X;
|
|
||||||
|
|
||||||
var leftDotProduct = enemyLeftDirection.Dot(cameraDirection);
|
|
||||||
var forwardDotProduct = enemyForwardDirection.Dot(cameraDirection);
|
|
||||||
|
|
||||||
// Check if forward facing. If the dot product is -1, the enemy is facing the camera.
|
|
||||||
if (forwardDotProduct < -_rotateUpperThreshold)
|
|
||||||
_sprite.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)
|
|
||||||
_sprite.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).
|
|
||||||
_sprite.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)
|
|
||||||
_sprite.Play("idle_left_walk");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=63 format=3 uid="uid://bksq62muhk3h5"]
|
[gd_scene load_steps=76 format=3 uid="uid://bksq62muhk3h5"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_7tinp"]
|
[ext_resource type="Script" path="res://src/enemy/Enemy.cs" id="1_7tinp"]
|
||||||
[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_j3knd"]
|
[ext_resource type="Script" path="res://src/enemy/EnemyStatResource.cs" id="2_j3knd"]
|
||||||
@@ -41,16 +41,26 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://bkhn4ck7bx6tt" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 5.png" id="48_864dg"]
|
[ext_resource type="Texture2D" uid="uid://bkhn4ck7bx6tt" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 5.png" id="48_864dg"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c8uw6qdsi1720" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 6.png" id="49_2r4d5"]
|
[ext_resource type="Texture2D" uid="uid://c8uw6qdsi1720" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 6.png" id="49_2r4d5"]
|
||||||
[ext_resource type="Shader" path="res://src/vfx/shaders/DamageHit.gdshader" id="49_mrxyf"]
|
[ext_resource type="Shader" path="res://src/vfx/shaders/DamageHit.gdshader" id="49_mrxyf"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://dd0ia6isdqg61" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 1.png" id="50_fxgra"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cnoouhy7p3gi3" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 7.png" id="50_m33xn"]
|
[ext_resource type="Texture2D" uid="uid://cnoouhy7p3gi3" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 7.png" id="50_m33xn"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b1xldymngql00" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 8.png" id="51_68cc3"]
|
[ext_resource type="Texture2D" uid="uid://b1xldymngql00" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 8.png" id="51_68cc3"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bs4ico5ouo5d3" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 2.png" id="51_ebmer"]
|
||||||
[ext_resource type="Shader" path="res://src/vfx/shaders/PixelMelt.gdshader" id="51_y2own"]
|
[ext_resource type="Shader" path="res://src/vfx/shaders/PixelMelt.gdshader" id="51_y2own"]
|
||||||
[ext_resource type="Texture2D" uid="uid://btuxhmmb6ikvf" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 9.png" id="52_2xmc3"]
|
[ext_resource type="Texture2D" uid="uid://btuxhmmb6ikvf" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 9.png" id="52_2xmc3"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://85ki5mc4h0vs" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 3.png" id="52_y2cis"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://bwt1m2frb3r0e" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 4.png" id="53_7t81a"]
|
||||||
[ext_resource type="Texture2D" uid="uid://dlrn3cbdubg5s" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 10.png" id="53_bgv07"]
|
[ext_resource type="Texture2D" uid="uid://dlrn3cbdubg5s" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 10.png" id="53_bgv07"]
|
||||||
[ext_resource type="Texture2D" uid="uid://oukshrxpgscg" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 11.png" id="54_7gaxo"]
|
[ext_resource type="Texture2D" uid="uid://oukshrxpgscg" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 11.png" id="54_7gaxo"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://ckssl1np6vnlu" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 5.png" id="54_xg1s7"]
|
||||||
[ext_resource type="Texture2D" uid="uid://buk3stdgcg44w" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 12.png" id="55_6460k"]
|
[ext_resource type="Texture2D" uid="uid://buk3stdgcg44w" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 12.png" id="55_6460k"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c4sqc6i3xcfac" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 6.png" id="55_e0qrl"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b3gndmrlrvexy" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 13.png" id="56_4pv43"]
|
[ext_resource type="Texture2D" uid="uid://b3gndmrlrvexy" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 13.png" id="56_4pv43"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cawexe4wkosc8" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 7.png" id="56_eeb3j"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d0j1vrx7xdnxl" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 8.png" id="57_p183w"]
|
||||||
[ext_resource type="Texture2D" uid="uid://b1cmx8l4ia3fv" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 14.png" id="57_tbahh"]
|
[ext_resource type="Texture2D" uid="uid://b1cmx8l4ia3fv" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 14.png" id="57_tbahh"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c7t4626rox02s" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 15.png" id="58_dftc5"]
|
[ext_resource type="Texture2D" uid="uid://c7t4626rox02s" path="res://src/enemy/enemy_types/sproingy/animations/IDLE_WALK_SIDE/Layer 15.png" id="58_dftc5"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://d0qhndaukki7c" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 9.png" id="58_lhas6"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cnd08q34wa7ww" path="res://src/enemy/enemy_types/sproingy/animations/ATTACK/Layer 10.png" id="59_nlkte"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_rxw8v"]
|
[sub_resource type="Resource" id="Resource_rxw8v"]
|
||||||
script = ExtResource("2_j3knd")
|
script = ExtResource("2_j3knd")
|
||||||
@@ -61,19 +71,19 @@ CurrentDefense = 2
|
|||||||
MaxAttack = 3
|
MaxAttack = 3
|
||||||
MaxDefense = 2
|
MaxDefense = 2
|
||||||
Luck = 0.05
|
Luck = 0.05
|
||||||
TelluricResistance = null
|
TelluricResistance = 0.0
|
||||||
AeolicResistance = null
|
AeolicResistance = 0.0
|
||||||
HydricResistance = null
|
HydricResistance = 0.0
|
||||||
IgneousResistance = null
|
IgneousResistance = 0.0
|
||||||
FerrumResistance = null
|
FerrumResistance = 0.0
|
||||||
TelluricDamageBonus = null
|
TelluricDamageBonus = 0.0
|
||||||
AeolicDamageBonus = null
|
AeolicDamageBonus = 0.0
|
||||||
BaseHydricDamageBonus = null
|
BaseHydricDamageBonus = 0.0
|
||||||
IgneousDamageBonus = null
|
IgneousDamageBonus = 0.0
|
||||||
FerrumDamageBonus = null
|
FerrumDamageBonus = 0.0
|
||||||
|
|
||||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"]
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"]
|
||||||
height = 1.0
|
radius = 1.0
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_jbgmx"]
|
||||||
height = 3.0
|
height = 3.0
|
||||||
@@ -89,6 +99,41 @@ viewport_path = NodePath("Sprite3D/SubViewport")
|
|||||||
animations = [{
|
animations = [{
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("50_fxgra")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("51_ebmer")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("52_y2cis")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("53_7t81a")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("54_xg1s7")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("55_e0qrl")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("56_eeb3j")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("57_p183w")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("58_lhas6")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": ExtResource("59_nlkte")
|
||||||
|
}],
|
||||||
|
"loop": false,
|
||||||
|
"name": &"attack",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
"texture": ExtResource("14_xn75i")
|
"texture": ExtResource("14_xn75i")
|
||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
@@ -238,157 +283,243 @@ animations = [{
|
|||||||
"speed": 12.0
|
"speed": 12.0
|
||||||
}]
|
}]
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_kr7ax"]
|
[sub_resource type="Animation" id="Animation_ch8ic"]
|
||||||
length = 0.001
|
length = 0.001
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("Hitbox/CollisionShape3D:disabled")
|
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 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]
|
"values": [null]
|
||||||
}
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Sprite3D/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": [0.0]
|
||||||
|
}
|
||||||
tracks/2/type = "value"
|
tracks/2/type = "value"
|
||||||
tracks/2/imported = false
|
tracks/2/imported = false
|
||||||
tracks/2/enabled = true
|
tracks/2/enabled = true
|
||||||
tracks/2/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader")
|
tracks/2/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame")
|
||||||
tracks/2/interp = 1
|
tracks/2/interp = 1
|
||||||
tracks/2/loop_wrap = true
|
tracks/2/loop_wrap = true
|
||||||
tracks/2/keys = {
|
tracks/2/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ExtResource("49_mrxyf")]
|
"values": [0]
|
||||||
}
|
}
|
||||||
tracks/3/type = "value"
|
tracks/3/type = "value"
|
||||||
tracks/3/imported = false
|
tracks/3/imported = false
|
||||||
tracks/3/enabled = true
|
tracks/3/enabled = true
|
||||||
tracks/3/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress")
|
tracks/3/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:animation")
|
||||||
tracks/3/interp = 1
|
tracks/3/interp = 1
|
||||||
tracks/3/loop_wrap = true
|
tracks/3/loop_wrap = true
|
||||||
tracks/3/keys = {
|
tracks/3/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"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,
|
"update": 1,
|
||||||
"values": [true, false, true]
|
"values": [&"idle_left_walk"]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_8p0l1"]
|
[sub_resource type="Animation" id="Animation_lkjbu"]
|
||||||
resource_name = "defeated"
|
resource_name = "defeated"
|
||||||
|
length = 1.00001
|
||||||
|
step = 0.0833333
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material")
|
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0),
|
"times": PackedFloat32Array(0),
|
||||||
"transitions": PackedFloat32Array(1),
|
"transitions": PackedFloat32Array(1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ExtResource("4_0urvb")]
|
|
||||||
}
|
|
||||||
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("51_y2own")]
|
"values": [ExtResource("51_y2own")]
|
||||||
}
|
}
|
||||||
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_0urvb"), ExtResource("4_0urvb")]
|
|
||||||
}
|
|
||||||
tracks/1/type = "value"
|
tracks/1/type = "value"
|
||||||
tracks/1/imported = false
|
tracks/1/imported = false
|
||||||
tracks/1/enabled = true
|
tracks/1/enabled = true
|
||||||
tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader")
|
tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress")
|
||||||
tracks/1/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/1/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/1/keys = {
|
tracks/1/keys = {
|
||||||
"times": PackedFloat32Array(0, 1),
|
"times": PackedFloat32Array(0, 1),
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [0.0, 1.0]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_03gvk"]
|
||||||
|
resource_name = "hit"
|
||||||
|
length = 0.500008
|
||||||
|
step = 0.0833333
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.5),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [ExtResource("49_mrxyf"), null]
|
"values": [ExtResource("49_mrxyf"), null]
|
||||||
}
|
}
|
||||||
tracks/2/type = "value"
|
tracks/1/type = "value"
|
||||||
tracks/2/imported = false
|
tracks/1/imported = false
|
||||||
tracks/2/enabled = true
|
tracks/1/enabled = true
|
||||||
tracks/2/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress")
|
tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:material:shader_parameter/progress")
|
||||||
tracks/2/interp = 1
|
tracks/1/interp = 1
|
||||||
tracks/2/loop_wrap = true
|
tracks/1/loop_wrap = true
|
||||||
tracks/2/keys = {
|
tracks/1/keys = {
|
||||||
"times": PackedFloat32Array(0, 1),
|
"times": PackedFloat32Array(0, 0.5),
|
||||||
"transitions": PackedFloat32Array(1, 1),
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [0.0, 1.0]
|
"values": [0.0, 1.0]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_346xs"]
|
[sub_resource type="Animation" id="Animation_ruc6s"]
|
||||||
|
resource_name = "attack"
|
||||||
|
length = 0.750008
|
||||||
|
step = 0.0833333
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666666, 0.75),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:animation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [&"attack"]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_31nry"]
|
||||||
|
resource_name = "idle_front_walk"
|
||||||
|
length = 1.25001
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.0833333
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 0.0833333, 0.166667, 0.25, 0.333333, 0.416667, 0.5, 0.583333, 0.666667, 0.75, 0.833333, 0.916667, 1, 1.08333, 1.16667),
|
||||||
|
"transitions": PackedFloat32Array(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]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:animation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [&"idle_front_walk"]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_1870e"]
|
||||||
|
resource_name = "idle_left_walk"
|
||||||
|
length = 1.25001
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.0833333
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite3D/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("Sprite3D/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),
|
||||||
|
"transitions": PackedFloat32Array(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]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_1tda5"]
|
||||||
|
resource_name = "idle_back_walk"
|
||||||
|
length = 1.25001
|
||||||
|
loop_mode = 1
|
||||||
|
step = 0.0833333
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:frame")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/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),
|
||||||
|
"transitions": PackedFloat32Array(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]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Sprite3D/SubViewport/AnimatedSprite:animation")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [&"idle_back_walk"]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_6tj5r"]
|
||||||
_data = {
|
_data = {
|
||||||
"RESET": SubResource("Animation_kr7ax"),
|
"RESET": SubResource("Animation_ch8ic"),
|
||||||
"attack": SubResource("Animation_ce86e"),
|
"attack": SubResource("Animation_ruc6s"),
|
||||||
"defeated": SubResource("Animation_8p0l1"),
|
"defeated": SubResource("Animation_lkjbu"),
|
||||||
"hit": SubResource("Animation_swr3w")
|
"hit": SubResource("Animation_03gvk"),
|
||||||
|
"idle_back_walk": SubResource("Animation_1tda5"),
|
||||||
|
"idle_front_walk": SubResource("Animation_31nry"),
|
||||||
|
"idle_left_walk": SubResource("Animation_1870e")
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Sproingy" type="CharacterBody3D"]
|
[node name="Sproingy" type="CharacterBody3D"]
|
||||||
@@ -399,16 +530,16 @@ axis_lock_linear_y = true
|
|||||||
script = ExtResource("1_7tinp")
|
script = ExtResource("1_7tinp")
|
||||||
EnemyStatResource = SubResource("Resource_rxw8v")
|
EnemyStatResource = SubResource("Resource_rxw8v")
|
||||||
|
|
||||||
|
[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="."]
|
[node name="NavAgent" type="NavigationAgent3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
avoidance_enabled = true
|
avoidance_enabled = true
|
||||||
debug_enabled = true
|
debug_enabled = true
|
||||||
debug_path_custom_color = Color(1, 0, 0, 1)
|
debug_path_custom_color = Color(1, 0, 0, 1)
|
||||||
|
|
||||||
[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="LineOfSight" type="Area3D" parent="."]
|
[node name="LineOfSight" type="Area3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||||
@@ -430,42 +561,41 @@ wait_time = 1.8
|
|||||||
autostart = true
|
autostart = true
|
||||||
|
|
||||||
[node name="Hitbox" type="Area3D" parent="."]
|
[node name="Hitbox" type="Area3D" parent="."]
|
||||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -0.152949, 0, 0)
|
||||||
collision_layer = 64
|
collision_layer = 64
|
||||||
collision_mask = 64
|
collision_mask = 64
|
||||||
script = ExtResource("3_usw2d")
|
script = ExtResource("3_usw2d")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0470563, 0.217529, -0.78415)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.189337, 0.217529, -0.78415)
|
||||||
shape = SubResource("BoxShape3D_0yire")
|
shape = SubResource("BoxShape3D_0yire")
|
||||||
disabled = true
|
disabled = true
|
||||||
|
|
||||||
[node name="Raycast" type="RayCast3D" parent="."]
|
[node name="Raycast" type="RayCast3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
|
||||||
visible = false
|
|
||||||
target_position = Vector3(0, 0, -3)
|
target_position = Vector3(0, 0, -3)
|
||||||
collision_mask = 3
|
collision_mask = 3
|
||||||
|
|
||||||
[node name="Sprite3D" type="Sprite3D" parent="."]
|
[node name="Sprite3D" type="Sprite3D" parent="."]
|
||||||
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0)
|
transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0)
|
||||||
flip_v = true
|
|
||||||
billboard = 2
|
billboard = 2
|
||||||
texture = SubResource("ViewportTexture_moptw")
|
texture = SubResource("ViewportTexture_moptw")
|
||||||
|
|
||||||
[node name="SubViewport" type="SubViewport" parent="Sprite3D"]
|
[node name="SubViewport" type="SubViewport" parent="Sprite3D"]
|
||||||
|
disable_3d = true
|
||||||
transparent_bg = true
|
transparent_bg = true
|
||||||
size = Vector2i(95, 95)
|
size = Vector2i(95, 95)
|
||||||
|
|
||||||
[node name="AnimatedSprite" type="AnimatedSprite2D" parent="Sprite3D/SubViewport"]
|
[node name="AnimatedSprite" type="AnimatedSprite2D" parent="Sprite3D/SubViewport"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
material = ExtResource("4_0urvb")
|
||||||
position = Vector2(45, 45)
|
position = Vector2(45, 45)
|
||||||
sprite_frames = SubResource("SpriteFrames_mi16l")
|
sprite_frames = SubResource("SpriteFrames_mi16l")
|
||||||
animation = &"idle_left_walk"
|
animation = &"idle_left_walk"
|
||||||
flip_v = true
|
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
libraries = {
|
libraries = {
|
||||||
"": SubResource("AnimationLibrary_346xs")
|
"": SubResource("AnimationLibrary_6tj5r")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ namespace GameJamDungeon
|
|||||||
|
|
||||||
public readonly record struct HitByPlayer(double CurrentHP);
|
public readonly record struct HitByPlayer(double CurrentHP);
|
||||||
|
|
||||||
|
public readonly record struct Attack();
|
||||||
|
|
||||||
public readonly record struct Defeated();
|
public readonly record struct Defeated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
@startuml EnemyLogic
|
@startuml EnemyLogic
|
||||||
state "EnemyLogic State" as GameJamDungeon_EnemyLogic_State {
|
state "EnemyLogic State" as GameJamDungeon_EnemyLogic_State {
|
||||||
state "Alive" as GameJamDungeon_EnemyLogic_State_Alive {
|
state "Alive" as GameJamDungeon_EnemyLogic_State_Alive {
|
||||||
state "Attack" as GameJamDungeon_EnemyLogic_State_Attack
|
|
||||||
state "FollowPlayer" as GameJamDungeon_EnemyLogic_State_FollowPlayer
|
state "FollowPlayer" as GameJamDungeon_EnemyLogic_State_FollowPlayer
|
||||||
state "Idle" as GameJamDungeon_EnemyLogic_State_Idle
|
state "Idle" as GameJamDungeon_EnemyLogic_State_Idle
|
||||||
}
|
}
|
||||||
|
state "Defeated" as GameJamDungeon_EnemyLogic_State_Defeated
|
||||||
}
|
}
|
||||||
|
|
||||||
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Alive : EnemyDefeated
|
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Alive : AttackTimer
|
||||||
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Alive : HitByPlayer
|
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Alive : HitByPlayer
|
||||||
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Attack : AttackTimer
|
GameJamDungeon_EnemyLogic_State_Alive --> GameJamDungeon_EnemyLogic_State_Defeated : EnemyDefeated
|
||||||
GameJamDungeon_EnemyLogic_State_Attack --> GameJamDungeon_EnemyLogic_State_FollowPlayer : Alerted
|
|
||||||
GameJamDungeon_EnemyLogic_State_FollowPlayer --> GameJamDungeon_EnemyLogic_State_FollowPlayer : PhysicsTick
|
GameJamDungeon_EnemyLogic_State_FollowPlayer --> GameJamDungeon_EnemyLogic_State_FollowPlayer : PhysicsTick
|
||||||
GameJamDungeon_EnemyLogic_State_FollowPlayer --> GameJamDungeon_EnemyLogic_State_Idle : LostPlayer
|
GameJamDungeon_EnemyLogic_State_FollowPlayer --> GameJamDungeon_EnemyLogic_State_Idle : LostPlayer
|
||||||
GameJamDungeon_EnemyLogic_State_Idle --> GameJamDungeon_EnemyLogic_State_FollowPlayer : Alerted
|
GameJamDungeon_EnemyLogic_State_Idle --> GameJamDungeon_EnemyLogic_State_FollowPlayer : Alerted
|
||||||
GameJamDungeon_EnemyLogic_State_Idle --> GameJamDungeon_EnemyLogic_State_Idle : PatrolToRandomSpot
|
GameJamDungeon_EnemyLogic_State_Idle --> GameJamDungeon_EnemyLogic_State_Idle : PatrolToRandomSpot
|
||||||
GameJamDungeon_EnemyLogic_State_Idle --> GameJamDungeon_EnemyLogic_State_Idle : PhysicsTick
|
GameJamDungeon_EnemyLogic_State_Idle --> GameJamDungeon_EnemyLogic_State_Idle : PhysicsTick
|
||||||
|
|
||||||
|
GameJamDungeon_EnemyLogic_State_Alive : OnAttackTimer → Attack
|
||||||
GameJamDungeon_EnemyLogic_State_Alive : OnEnemyDefeated → Defeated
|
GameJamDungeon_EnemyLogic_State_Alive : OnEnemyDefeated → Defeated
|
||||||
GameJamDungeon_EnemyLogic_State_Alive : OnHitByPlayer → HitByPlayer
|
GameJamDungeon_EnemyLogic_State_Alive : OnHitByPlayer → HitByPlayer
|
||||||
|
GameJamDungeon_EnemyLogic_State_FollowPlayer : OnPhysicsTick → MovementComputed
|
||||||
GameJamDungeon_EnemyLogic_State_Idle : OnPhysicsTick → MovementComputed
|
GameJamDungeon_EnemyLogic_State_Idle : OnPhysicsTick → MovementComputed
|
||||||
|
|
||||||
[*] --> GameJamDungeon_EnemyLogic_State_Idle
|
[*] --> GameJamDungeon_EnemyLogic_State_Idle
|
||||||
|
|||||||
@@ -24,13 +24,14 @@ namespace GameJamDungeon
|
|||||||
|
|
||||||
public Transition On(in Input.AttackTimer input)
|
public Transition On(in Input.AttackTimer input)
|
||||||
{
|
{
|
||||||
return To<Attack>();
|
Output(new Output.Attack());
|
||||||
|
return ToSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Transition On(in Input.EnemyDefeated input)
|
public Transition On(in Input.EnemyDefeated input)
|
||||||
{
|
{
|
||||||
Output(new Output.Defeated());
|
Output(new Output.Defeated());
|
||||||
return ToSelf();
|
return To<Defeated>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
using Chickensoft.GodotNodeInterfaces;
|
|
||||||
using Chickensoft.Introspection;
|
|
||||||
using Chickensoft.LogicBlocks;
|
|
||||||
using Godot;
|
|
||||||
|
|
||||||
namespace GameJamDungeon
|
|
||||||
{
|
|
||||||
public partial class EnemyLogic
|
|
||||||
{
|
|
||||||
public partial record State
|
|
||||||
{
|
|
||||||
[Meta, Id("enemy_logic_state_attack")]
|
|
||||||
public partial record Attack : Alive, IGet<Input.Alerted>
|
|
||||||
{
|
|
||||||
public Attack()
|
|
||||||
{
|
|
||||||
this.OnEnter(() =>
|
|
||||||
{
|
|
||||||
});
|
|
||||||
this.OnExit(() =>
|
|
||||||
{
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public Transition On(in Input.Alerted input)
|
|
||||||
{
|
|
||||||
return To<FollowPlayer>();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AnimationPlayer_AnimationFinished(StringName animName)
|
|
||||||
{
|
|
||||||
Get<IEnemy>().EnemyLogic.Input(new Input.Alerted());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
15
src/enemy/state/states/EnemyLogic.State.Defeated.cs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
using Chickensoft.Introspection;
|
||||||
|
using static GameJamDungeon.EnemyLogic.Input;
|
||||||
|
|
||||||
|
namespace GameJamDungeon;
|
||||||
|
|
||||||
|
public partial class EnemyLogic
|
||||||
|
{
|
||||||
|
public partial record State
|
||||||
|
{
|
||||||
|
[Meta, Id("enemy_logic_state_defeated")]
|
||||||
|
public partial record Defeated : State
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,29 +12,17 @@ namespace GameJamDungeon
|
|||||||
{
|
{
|
||||||
public Transition On(in Input.PhysicsTick input)
|
public Transition On(in Input.PhysicsTick input)
|
||||||
{
|
{
|
||||||
//var delta = input.Delta;
|
var delta = input.Delta;
|
||||||
//var gameRepo = Get<IGameRepo>();
|
var enemy = Get<IEnemy>();
|
||||||
//var enemy = Get<IEnemy>();
|
var gameRepo = Get<IGameRepo>();
|
||||||
|
var target = gameRepo.PlayerGlobalPosition.Value;
|
||||||
|
enemy.NavAgent.TargetPosition = target;
|
||||||
|
var targetPosition = enemy.NavAgent.GetNextPathPosition();
|
||||||
|
|
||||||
//if (enemy.GlobalPosition.DistanceTo(gameRepo.PlayerGlobalPosition.Value) <= 2.5f)
|
enemy.Velocity = (targetPosition - enemy.GlobalTransform.Origin).Normalized() * 2f;
|
||||||
//{
|
enemy.Rotation = new Vector3(0, (float)Mathf.LerpAngle(enemy.Rotation.Y, Mathf.Atan2(enemy.Velocity.X, enemy.Velocity.Z), delta * 10.0), 0);
|
||||||
// //enemy.LookAt(-new Vector3(gameRepo.PlayerGlobalPosition.Value.X, enemy.GlobalPosition.Y, gameRepo.PlayerGlobalPosition.Value.Z), Vector3.Back);
|
|
||||||
// return ToSelf();
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (enemy.GlobalPosition.DistanceTo(gameRepo.PlayerGlobalPosition.Value) > 20f)
|
|
||||||
// return To<Idle>();
|
|
||||||
|
|
||||||
//enemy.NavAgent.TargetPosition = gameRepo.PlayerGlobalPosition.Value;
|
|
||||||
//var nextPosition = enemy.NavAgent.GetNextPathPosition();
|
|
||||||
//var lookAtPos = enemy.NavAgent.GetNextPathPosition();
|
|
||||||
////enemy.LookAt(-new Vector3(lookAtPos.X, enemy.GlobalPosition.Y, lookAtPos.Z), Vector3.Back);
|
|
||||||
|
|
||||||
//var direction = enemy.NavAgent.GetNextPathPosition() - enemy.GlobalPosition;
|
|
||||||
//enemy.Velocity = enemy.Velocity.MoveToward(direction.Normalized() * 0.01f, (float)delta);
|
|
||||||
|
|
||||||
//Output(new Output.MovementComputed(enemy.Velocity));
|
|
||||||
|
|
||||||
|
Output(new Output.MovementComputed());
|
||||||
return ToSelf();
|
return ToSelf();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ public partial class EnemyLogic
|
|||||||
var delta = input.Delta;
|
var delta = input.Delta;
|
||||||
var enemy = Get<IEnemy>();
|
var enemy = Get<IEnemy>();
|
||||||
var targetPosition = enemy.NavAgent.GetNextPathPosition();
|
var targetPosition = enemy.NavAgent.GetNextPathPosition();
|
||||||
|
var velocity = (targetPosition - enemy.GlobalPosition).Normalized() * 3.0f;
|
||||||
enemy.Velocity = (targetPosition - enemy.GlobalTransform.Origin).Normalized() * 3.0f;
|
enemy.Velocity = velocity;
|
||||||
enemy.Rotation = new Vector3(0, (float)Mathf.LerpAngle(enemy.Rotation.Y, Mathf.Atan2(enemy.Velocity.X, enemy.Velocity.Z), delta * 10.0), 0);
|
enemy.Rotation = new Vector3(0, (float)Mathf.LerpAngle(enemy.Rotation.Y, Mathf.Atan2(enemy.Velocity.X, enemy.Velocity.Z), delta * 10.0), 0);
|
||||||
|
|
||||||
Output(new Output.MovementComputed());
|
Output(new Output.MovementComputed());
|
||||||
|
|||||||
@@ -1,9 +1,7 @@
|
|||||||
[gd_scene load_steps=6 format=3 uid="uid://by67pn7fdsg1m"]
|
[gd_scene load_steps=4 format=3 uid="uid://by67pn7fdsg1m"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://dvnc26rebk6o0" path="res://src/map/overworld/Overworld.tscn" id="1_ope1x"]
|
[ext_resource type="PackedScene" uid="uid://dvnc26rebk6o0" path="res://src/map/overworld/Overworld.tscn" id="1_ope1x"]
|
||||||
[ext_resource type="PackedScene" uid="uid://bc1sp6xwe0j65" path="res://src/map/dungeon/floors/Floor1.tscn" id="2_merfv"]
|
[ext_resource type="PackedScene" uid="uid://bc1sp6xwe0j65" path="res://src/map/dungeon/floors/Floor1.tscn" id="2_merfv"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dcgj5i52i76gj" path="res://src/enemy/enemy_types/michael/Michael.tscn" id="4_d4sw2"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bksq62muhk3h5" path="res://src/enemy/enemy_types/sproingy/Sproingy.tscn" id="5_cvt4a"]
|
|
||||||
[ext_resource type="PackedScene" uid="uid://bjqgl5u05ia04" path="res://src/map/dungeon/Teleport.tscn" id="5_jiohg"]
|
[ext_resource type="PackedScene" uid="uid://bjqgl5u05ia04" path="res://src/map/dungeon/Teleport.tscn" id="5_jiohg"]
|
||||||
|
|
||||||
[node name="Map" type="Node3D"]
|
[node name="Map" type="Node3D"]
|
||||||
@@ -25,9 +23,3 @@ unique_name_in_owner = true
|
|||||||
process_mode = 3
|
process_mode = 3
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 900, 900, 900)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 900, 900, 900)
|
||||||
disable_mode = 2
|
disable_mode = 2
|
||||||
|
|
||||||
[node name="Michael" parent="." instance=ExtResource("4_d4sw2")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.75859, 2.28929, -4.31558)
|
|
||||||
|
|
||||||
[node name="Sproingy" parent="." instance=ExtResource("5_cvt4a")]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.56057, 0)
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
[gd_scene load_steps=76 format=4 uid="uid://dpec2lbt83dhe"]
|
[gd_scene load_steps=80 format=4 uid="uid://dpec2lbt83dhe"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_ho6e8"]
|
[ext_resource type="Script" path="res://addons/SimpleDungeons/DungeonRoom3D.gd" id="1_ho6e8"]
|
||||||
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_iwuh7"]
|
[ext_resource type="Script" path="res://src/map/dungeon/code/DungeonRoom.cs" id="2_iwuh7"]
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
[ext_resource type="Texture2D" uid="uid://dn3c4nfpobdcs" path="res://src/map/dungeon/models/test/V2 Test1_CHAIN_TEX_13.png" id="16_lp3wx"]
|
[ext_resource type="Texture2D" uid="uid://dn3c4nfpobdcs" path="res://src/map/dungeon/models/test/V2 Test1_CHAIN_TEX_13.png" id="16_lp3wx"]
|
||||||
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="17_25wvm"]
|
[ext_resource type="PackedScene" uid="uid://twrj4wixcbu7" path="res://src/items/ItemDatabase.tscn" id="17_25wvm"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="18_v6hub"]
|
[ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="18_v6hub"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://0idh4qh35cp7" path="res://src/map/dungeon/corridor/CORRIDOR test_FLOOR1.jpg" id="19_06gih"]
|
||||||
|
|
||||||
[sub_resource type="NavigationMesh" id="NavigationMesh_2x5qh"]
|
[sub_resource type="NavigationMesh" id="NavigationMesh_2x5qh"]
|
||||||
cell_size = 0.15
|
cell_size = 0.15
|
||||||
@@ -1024,6 +1025,15 @@ shadow_mesh = SubResource("ArrayMesh_oxoef")
|
|||||||
[sub_resource type="PlaneMesh" id="PlaneMesh_bbi7v"]
|
[sub_resource type="PlaneMesh" id="PlaneMesh_bbi7v"]
|
||||||
size = Vector2(35, 30)
|
size = Vector2(35, 30)
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_51rrf"]
|
||||||
|
albedo_texture = ExtResource("19_06gih")
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_alrge"]
|
||||||
|
albedo_texture = ExtResource("19_06gih")
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_x3ul8"]
|
||||||
|
albedo_texture = ExtResource("19_06gih")
|
||||||
|
|
||||||
[node name="Antechamber" type="Node3D"]
|
[node name="Antechamber" type="Node3D"]
|
||||||
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.73082, 0, -1.86841)
|
transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 1.73082, 0, -1.86841)
|
||||||
script = ExtResource("1_ho6e8")
|
script = ExtResource("1_ho6e8")
|
||||||
@@ -1299,11 +1309,28 @@ SpawnRate = PackedFloat32Array(1)
|
|||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 29.876, -4.13235, -18.2257)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 29.876, -4.13235, -18.2257)
|
||||||
|
|
||||||
[node name="DOOR1" type="Marker3D" parent="Room"]
|
[node name="DOOR?2" type="Marker3D" parent="Room"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 34.8732, -2.45415, -21.4188)
|
|
||||||
|
|
||||||
[node name="DOOR3" type="Marker3D" parent="Room"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 34.8732, -2.84773, -6.49106)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 34.8732, -2.84773, -6.49106)
|
||||||
|
|
||||||
[node name="DOOR2" type="Marker3D" parent="Room"]
|
[node name="DOOR?3" type="Marker3D" parent="Room"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.7784, -2.45185, -14.7063)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 10.7784, -2.45185, -14.7063)
|
||||||
|
|
||||||
|
[node name="CSGBox" type="CSGBox3D" parent="."]
|
||||||
|
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 12.1009, 0.134912, -8.06366)
|
||||||
|
size = Vector3(4, 4, 0.5)
|
||||||
|
material = SubResource("StandardMaterial3D_51rrf")
|
||||||
|
|
||||||
|
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGBox"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1527)
|
||||||
|
visible = false
|
||||||
|
material_override = SubResource("StandardMaterial3D_alrge")
|
||||||
|
operation = 2
|
||||||
|
size = Vector3(4, 4, 0.5)
|
||||||
|
|
||||||
|
[node name="DOOR?1" type="CSGBox3D" parent="CSGBox"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.0686455)
|
||||||
|
visible = false
|
||||||
|
material_override = SubResource("StandardMaterial3D_alrge")
|
||||||
|
operation = 2
|
||||||
|
size = Vector3(4, 4, 2)
|
||||||
|
material = SubResource("StandardMaterial3D_x3ul8")
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@@ -2,27 +2,26 @@
|
|||||||
|
|
||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://t7fbfplu2js7"
|
uid="uid://xuftapgcwb7n"
|
||||||
path.s3tc="res://.godot/imported/ROYAL_RAT_PRINCEP.png-e4eeb4a5bba938a6dc238bcabe55375f.s3tc.ctex"
|
path="res://.godot/imported/ROYAL_RAT_PRINCEP.png-1c9df65d820f661e93d90926b6a342f0.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"imported_formats": ["s3tc_bptc"],
|
"vram_texture": false
|
||||||
"vram_texture": true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://src/npc/rat/ROYAL_RAT_PRINCEP.png"
|
source_file="res://src/npc/ROYAL_RAT_PRINCEP.png"
|
||||||
dest_files=["res://.godot/imported/ROYAL_RAT_PRINCEP.png-e4eeb4a5bba938a6dc238bcabe55375f.s3tc.ctex"]
|
dest_files=["res://.godot/imported/ROYAL_RAT_PRINCEP.png-1c9df65d820f661e93d90926b6a342f0.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
compress/mode=2
|
compress/mode=0
|
||||||
compress/high_quality=false
|
compress/high_quality=false
|
||||||
compress/lossy_quality=0.7
|
compress/lossy_quality=0.7
|
||||||
compress/hdr_compression=1
|
compress/hdr_compression=1
|
||||||
compress/normal_map=0
|
compress/normal_map=0
|
||||||
compress/channel_pack=0
|
compress/channel_pack=0
|
||||||
mipmaps/generate=true
|
mipmaps/generate=false
|
||||||
mipmaps/limit=-1
|
mipmaps/limit=-1
|
||||||
roughness/mode=0
|
roughness/mode=0
|
||||||
roughness/src_normal=""
|
roughness/src_normal=""
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
[gd_scene load_steps=7 format=3 uid="uid://d4l4qutp8x40c"]
|
[gd_scene load_steps=7 format=3 uid="uid://d4l4qutp8x40c"]
|
||||||
|
|
||||||
[ext_resource type="Texture2D" uid="uid://t7fbfplu2js7" path="res://src/npc/rat/ROYAL_RAT_PRINCEP.png" id="1_0r0wh"]
|
|
||||||
[ext_resource type="Script" path="res://src/npc/Npc.cs" id="1_cpdf2"]
|
[ext_resource type="Script" path="res://src/npc/Npc.cs" id="1_cpdf2"]
|
||||||
[ext_resource type="Resource" uid="uid://cf7ycgdiihyh" path="res://src/npc/rat/ratdialogue.dialogue" id="2_uo38w"]
|
[ext_resource type="Resource" uid="uid://cf7ycgdiihyh" path="res://src/npc/rat/ratdialogue.dialogue" id="2_uo38w"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://xuftapgcwb7n" path="res://src/npc/ROYAL_RAT_PRINCEP.png" id="3_p4ckb"]
|
||||||
|
|
||||||
[sub_resource type="CylinderShape3D" id="CylinderShape3D_wfhgc"]
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_wfhgc"]
|
||||||
radius = 3.0
|
radius = 3.0
|
||||||
@@ -26,7 +26,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.1, 0)
|
|||||||
gi_mode = 0
|
gi_mode = 0
|
||||||
billboard = 2
|
billboard = 2
|
||||||
texture_filter = 0
|
texture_filter = 0
|
||||||
texture = ExtResource("1_0r0wh")
|
texture = ExtResource("3_p4ckb")
|
||||||
|
|
||||||
[node name="DialogueZone" type="Area3D" parent="."]
|
[node name="DialogueZone" type="Area3D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ namespace GameJamDungeon
|
|||||||
|
|
||||||
private PlayerData PlayerData { get; set; } = default!;
|
private PlayerData PlayerData { get; set; } = default!;
|
||||||
|
|
||||||
|
private bool flipAttack = false;
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
AnimationPlayer.AnimationFinished += OnAnimationFinished;
|
AnimationPlayer.AnimationFinished += OnAnimationFinished;
|
||||||
@@ -120,8 +122,8 @@ namespace GameJamDungeon
|
|||||||
{
|
{
|
||||||
var attackSpeed = PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.AttackSpeed;
|
var attackSpeed = PlayerData.Inventory.EquippedWeapon.Value.WeaponStats.AttackSpeed;
|
||||||
AnimationPlayer.SetSpeedScale((float)attackSpeed);
|
AnimationPlayer.SetSpeedScale((float)attackSpeed);
|
||||||
|
|
||||||
AnimationPlayer.Play("attack");
|
AnimationPlayer.Play("attack");
|
||||||
SwordSlashAnimation.Play("attack");
|
|
||||||
})
|
})
|
||||||
.Handle((in PlayerLogic.Output.ThrowItem output) =>
|
.Handle((in PlayerLogic.Output.ThrowItem output) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
[gd_scene load_steps=34 format=3 uid="uid://cfecvvav8kkp6"]
|
[gd_scene load_steps=46 format=3 uid="uid://cfecvvav8kkp6"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://src/player/Player.cs" id="1_xcol5"]
|
[ext_resource type="Script" path="res://src/player/Player.cs" id="1_xcol5"]
|
||||||
[ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="2_lb3qc"]
|
[ext_resource type="Script" path="res://src/hitbox/Hitbox.cs" id="2_lb3qc"]
|
||||||
[ext_resource type="Script" path="res://src/player/PlayerStatResource.cs" id="2_xq68d"]
|
[ext_resource type="Script" path="res://src/player/PlayerStatResource.cs" id="2_xq68d"]
|
||||||
[ext_resource type="Texture2D" uid="uid://c6r3dhnkuw22w" path="res://src/vfx/Weapon Strikes/FIRE_STRIKE_1.0.png" id="5_wr6lo"]
|
[ext_resource type="Texture2D" uid="uid://c6r3dhnkuw22w" path="res://src/vfx/hit_effects/FIRE_STRIKE_1.0.png" id="5_wr6lo"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b5qjlbcesth53" path="res://src/vfx/Weapon Strikes/NON ELEMENTAL SLASH.png" id="6_p34sl"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ctwtksu2406c" path="res://src/player/dont_look_in_here/player_model.tscn" id="10_prmgx"]
|
[ext_resource type="PackedScene" uid="uid://ctwtksu2406c" path="res://src/player/dont_look_in_here/player_model.tscn" id="10_prmgx"]
|
||||||
|
|
||||||
[sub_resource type="Resource" id="Resource_btp2w"]
|
[sub_resource type="Resource" id="Resource_btp2w"]
|
||||||
@@ -48,10 +49,23 @@ tracks/0/keys = {
|
|||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [true]
|
"values": [true]
|
||||||
}
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("SwordSlashAnimation:frame")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [0]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_0jjwv"]
|
[sub_resource type="Animation" id="Animation_0jjwv"]
|
||||||
resource_name = "attack"
|
resource_name = "attack"
|
||||||
length = 0.7
|
length = 0.916675
|
||||||
|
step = 0.0833333
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
@@ -59,18 +73,76 @@ tracks/0/path = NodePath("Hitbox/HitboxCollision:disabled")
|
|||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
tracks/0/loop_wrap = true
|
tracks/0/loop_wrap = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PackedFloat32Array(0, 0.1667, 0.3333),
|
"times": PackedFloat32Array(0, 0.0833333, 0.333333),
|
||||||
"transitions": PackedFloat32Array(1, 1, 1),
|
"transitions": PackedFloat32Array(1, 1, 1),
|
||||||
"update": 1,
|
"update": 1,
|
||||||
"values": [true, false, true]
|
"values": [true, false, true]
|
||||||
}
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("SwordSlashAnimation: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.666667, 0.75, 0.833333, 0.916666),
|
||||||
|
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_uxo8q"]
|
||||||
|
resource_name = "explosion"
|
||||||
|
length = 3.66668
|
||||||
|
step = 0.0833333
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_w8l8m"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_w8l8m"]
|
||||||
_data = {
|
_data = {
|
||||||
"RESET": SubResource("Animation_hcjph"),
|
"RESET": SubResource("Animation_hcjph"),
|
||||||
"attack": SubResource("Animation_0jjwv")
|
"attack": SubResource("Animation_0jjwv"),
|
||||||
|
"explosion": SubResource("Animation_uxo8q")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_irupf"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(300, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_63m7j"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(600, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_1ypgu"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(900, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_d7qd7"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(1200, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_7heog"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(1500, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_x4mbv"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(1800, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_f7ysd"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(2100, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_i2p57"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(2400, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_tfnlg"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(2700, 0, 300, 300)
|
||||||
|
|
||||||
|
[sub_resource type="AtlasTexture" id="AtlasTexture_gvgtb"]
|
||||||
|
atlas = ExtResource("6_p34sl")
|
||||||
|
region = Rect2(3000, 0, 300, 300)
|
||||||
|
|
||||||
[sub_resource type="AtlasTexture" id="AtlasTexture_fha34"]
|
[sub_resource type="AtlasTexture" id="AtlasTexture_fha34"]
|
||||||
atlas = ExtResource("5_wr6lo")
|
atlas = ExtResource("5_wr6lo")
|
||||||
region = Rect2(0, 0, 450, 450)
|
region = Rect2(0, 0, 450, 450)
|
||||||
@@ -155,6 +227,47 @@ region = Rect2(1800, 450, 450, 450)
|
|||||||
animations = [{
|
animations = [{
|
||||||
"frames": [{
|
"frames": [{
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
|
"texture": null
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_irupf")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_63m7j")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_1ypgu")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_d7qd7")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_7heog")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_x4mbv")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_f7ysd")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_i2p57")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_tfnlg")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": SubResource("AtlasTexture_gvgtb")
|
||||||
|
}, {
|
||||||
|
"duration": 1.0,
|
||||||
|
"texture": null
|
||||||
|
}],
|
||||||
|
"loop": false,
|
||||||
|
"name": &"attack",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [{
|
||||||
|
"duration": 1.0,
|
||||||
"texture": SubResource("AtlasTexture_fha34")
|
"texture": SubResource("AtlasTexture_fha34")
|
||||||
}, {
|
}, {
|
||||||
"duration": 1.0,
|
"duration": 1.0,
|
||||||
@@ -218,7 +331,12 @@ animations = [{
|
|||||||
"texture": null
|
"texture": null
|
||||||
}],
|
}],
|
||||||
"loop": false,
|
"loop": false,
|
||||||
"name": &"attack",
|
"name": &"attack_fire",
|
||||||
|
"speed": 12.0
|
||||||
|
}, {
|
||||||
|
"frames": [],
|
||||||
|
"loop": true,
|
||||||
|
"name": &"attack_water",
|
||||||
"speed": 12.0
|
"speed": 12.0
|
||||||
}]
|
}]
|
||||||
|
|
||||||
@@ -281,7 +399,9 @@ visible = false
|
|||||||
[node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."]
|
[node name="SwordSlashAnimation" type="AnimatedSprite2D" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
texture_filter = 1
|
texture_filter = 1
|
||||||
position = Vector2(900, 565)
|
position = Vector2(983, 555)
|
||||||
scale = Vector2(1.8, 1.8)
|
scale = Vector2(3, 3)
|
||||||
sprite_frames = SubResource("SpriteFrames_ywvvo")
|
sprite_frames = SubResource("SpriteFrames_ywvvo")
|
||||||
animation = &"attack"
|
animation = &"attack"
|
||||||
|
flip_h = true
|
||||||
|
flip_v = true
|
||||||
|
|||||||
BIN
src/vfx/Weapon Strikes/NON ELEMENTAL SLASH.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
34
src/vfx/Weapon Strikes/NON ELEMENTAL SLASH.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b5qjlbcesth53"
|
||||||
|
path="res://.godot/imported/NON ELEMENTAL SLASH.png-1bf909eeddb451e3f6e33c698e2e53e1.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://src/vfx/Weapon Strikes/NON ELEMENTAL SLASH.png"
|
||||||
|
dest_files=["res://.godot/imported/NON ELEMENTAL SLASH.png-1bf909eeddb451e3f6e33c698e2e53e1.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
|
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 452 KiB |
@@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://c6r3dhnkuw22w"
|
uid="uid://c6r3dhnkuw22w"
|
||||||
path="res://.godot/imported/FIRE_STRIKE_1.0.png-99f3e00032e79a9fb3eea29378859d3a.ctex"
|
path="res://.godot/imported/FIRE_STRIKE_1.0.png-559ebdca8bed9db1db96b1d1b2d8f353.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://src/vfx/Weapon Strikes/FIRE_STRIKE_1.0.png"
|
source_file="res://src/vfx/hit_effects/FIRE_STRIKE_1.0.png"
|
||||||
dest_files=["res://.godot/imported/FIRE_STRIKE_1.0.png-99f3e00032e79a9fb3eea29378859d3a.ctex"]
|
dest_files=["res://.godot/imported/FIRE_STRIKE_1.0.png-559ebdca8bed9db1db96b1d1b2d8f353.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 652 KiB After Width: | Height: | Size: 652 KiB |
@@ -3,15 +3,15 @@
|
|||||||
importer="texture"
|
importer="texture"
|
||||||
type="CompressedTexture2D"
|
type="CompressedTexture2D"
|
||||||
uid="uid://dw41v352onc0a"
|
uid="uid://dw41v352onc0a"
|
||||||
path="res://.godot/imported/WATER_STRIKE_1.0.png-a6edb07d301bc64df48872862f6459ee.ctex"
|
path="res://.godot/imported/WATER_STRIKE_1.0.png-e7137b942ece3c27aab46a2703843a54.ctex"
|
||||||
metadata={
|
metadata={
|
||||||
"vram_texture": false
|
"vram_texture": false
|
||||||
}
|
}
|
||||||
|
|
||||||
[deps]
|
[deps]
|
||||||
|
|
||||||
source_file="res://src/vfx/Weapon Strikes/WATER_STRIKE_1.0.png"
|
source_file="res://src/vfx/hit_effects/WATER_STRIKE_1.0.png"
|
||||||
dest_files=["res://.godot/imported/WATER_STRIKE_1.0.png-a6edb07d301bc64df48872862f6459ee.ctex"]
|
dest_files=["res://.godot/imported/WATER_STRIKE_1.0.png-e7137b942ece3c27aab46a2703843a54.ctex"]
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
|
|
||||||
BIN
src/vfx/hit_effects/explosion.png
Normal file
|
After Width: | Height: | Size: 488 KiB |
34
src/vfx/hit_effects/explosion.png.import
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://npwcgmo2hi1t"
|
||||||
|
path="res://.godot/imported/explosion.png-8174f81734413e849902e37c0ddda01d.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://src/vfx/hit_effects/explosion.png"
|
||||||
|
dest_files=["res://.godot/imported/explosion.png-8174f81734413e849902e37c0ddda01d.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=0
|
||||||
@@ -1,8 +1,3 @@
|
|||||||
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://c0gpeve05njqq"]
|
[gd_resource type="ShaderMaterial" format=3 uid="uid://c0gpeve05njqq"]
|
||||||
|
|
||||||
[ext_resource type="Shader" path="res://src/vfx/shaders/PixelMelt.gdshader" id="1_uy7cv"]
|
|
||||||
|
|
||||||
[resource]
|
[resource]
|
||||||
shader = ExtResource("1_uy7cv")
|
|
||||||
shader_parameter/progress = 0.0
|
|
||||||
shader_parameter/meltiness = 1.0
|
|
||||||
|
|||||||