more fixes and new footstep sound

godot-4.1.1
John Montagu, the 4th Earl of Sandvich 2023-07-24 00:56:01 -07:00
parent 47f5c6869b
commit c2a4385deb
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
5 changed files with 31 additions and 2 deletions

Binary file not shown.

View File

@ -292,4 +292,9 @@ public partial class Character : CharacterBody2D, IFaction
.EmitOneShot(); .EmitOneShot();
} }
} }
public virtual void Footstep()
{
throw new System.NotImplementedException();
}
} }

View File

@ -2,6 +2,7 @@ using Godot;
using GodotUtilities; using GodotUtilities;
using SupaLidlGame.Utils; using SupaLidlGame.Utils;
using SupaLidlGame.BoundingBoxes; using SupaLidlGame.BoundingBoxes;
using SupaLidlGame.Extensions;
namespace SupaLidlGame.Characters; namespace SupaLidlGame.Characters;
@ -102,4 +103,12 @@ public sealed partial class Player : Character
.DirectionTo(GetGlobalMousePosition()) .DirectionTo(GetGlobalMousePosition())
.Angle(); .Angle();
} }
public override void Footstep()
{
GetNode<AudioStreamPlayer2D>("Effects/Footstep")
.OnWorld()
.WithPitchDeviation(0.125f)
.Play();
}
} }

View File

@ -90,6 +90,23 @@ tracks/0/keys = {
"update": 1, "update": 1,
"values": [2, 3, 4, 5, 6, 7] "values": [2, 3, 4, 5, 6, 7]
} }
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("..")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.2, 0.5),
"transitions": PackedFloat32Array(1, 1),
"values": [{
"args": [],
"method": &"Footstep"
}, {
"args": [],
"method": &"Footstep"
}]
}
[sub_resource type="Animation" id="Animation_vobpw"] [sub_resource type="Animation" id="Animation_vobpw"]
resource_name = "roll" resource_name = "roll"

View File

@ -23,8 +23,6 @@ public partial class DocShungiteDartState : DocAttackState
public override NPCState Enter(IState<NPCState> nextState) public override NPCState Enter(IState<NPCState> nextState)
{ {
Doc.CanAttack = true;
Doc.ShouldMove = true;
return base.Enter(nextState); return base.Enter(nextState);
} }