diff --git a/Assets/Sounds/footstep-tile.wav b/Assets/Sounds/footstep-tile.wav new file mode 100644 index 0000000..6d554be Binary files /dev/null and b/Assets/Sounds/footstep-tile.wav differ diff --git a/Assets/Sounds/footstep-tile.wav.import b/Assets/Sounds/footstep-tile.wav.import new file mode 100644 index 0000000..5e8b587 --- /dev/null +++ b/Assets/Sounds/footstep-tile.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://cruylv4pu2fo1" +path="res://.godot/imported/footstep-tile.wav-b55127987c6e71b547f30bc975847978.sample" + +[deps] + +source_file="res://Assets/Sounds/footstep-tile.wav" +dest_files=["res://.godot/imported/footstep-tile.wav-b55127987c6e71b547f30bc975847978.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/Characters/Player.tscn b/Characters/Player.tscn index 0aa2306..18f7943 100644 --- a/Characters/Player.tscn +++ b/Characters/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=58 format=3 uid="uid://b2254pup8k161"] +[gd_scene load_steps=59 format=3 uid="uid://b2254pup8k161"] [ext_resource type="Script" path="res://Characters/Player.cs" id="1_flygr"] [ext_resource type="Shader" path="res://Shaders/Flash.gdshader" id="2_ngsgt"] @@ -18,6 +18,7 @@ [ext_resource type="Material" uid="uid://ra02tvwd5o5g" path="res://Assets/Sprites/Particles/PlayerDeathProcessMaterial.tres" id="10_agw51"] [ext_resource type="AudioStream" uid="uid://bbqdpexvknma2" path="res://Assets/Sounds/never-lucky.mp3" id="12_vd7j4"] [ext_resource type="AudioStream" uid="uid://bkeyg8weaqnuu" path="res://Assets/Sounds/splat-player.ogg" id="12_vvem5"] +[ext_resource type="AudioStream" uid="uid://cruylv4pu2fo1" path="res://Assets/Sounds/footstep-tile.wav" id="13_bxguv"] [ext_resource type="Script" path="res://BoundingBoxes/InteractionRay.cs" id="13_hs3u1"] [ext_resource type="PackedScene" uid="uid://p7oijq6dbvvk" path="res://Items/Weapons/DocLance.tscn" id="14_bj0lo"] [ext_resource type="Texture2D" uid="uid://d1ukste16yq6v" path="res://Assets/Sprites/Particles/player-light.png" id="15_3hahh"] @@ -232,6 +233,60 @@ tracks/4/keys = { "values": [false] } +[sub_resource type="Animation" id="Animation_vtf8v"] +resource_name = "death" +length = 3.0 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprites/Node2D/Character:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 0.1, 0.2, 0.3), +"transitions": PackedFloat32Array(1, 1, 1, 1), +"update": 1, +"values": [11, 15, 16, 17] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Effects/DeathParticles:emitting") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(1), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [true] +} +tracks/2/type = "value" +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/path = NodePath(".:material:shader_parameter/alpha_modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/keys = { +"times": PackedFloat32Array(1, 1.2), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.0, 0.0] +} +tracks/3/type = "method" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath("Effects/DeathCry") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0.3), +"transitions": PackedFloat32Array(1), +"values": [{ +"args": [0.0], +"method": &"play" +}] +} + [sub_resource type="Animation" id="Animation_dxevc"] resource_name = "hurt" length = 0.2 @@ -304,60 +359,6 @@ tracks/0/keys = { "values": [0.0, 1.0, 0.0] } -[sub_resource type="Animation" id="Animation_vtf8v"] -resource_name = "death" -length = 3.0 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("Sprites/Node2D/Character:frame") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0, 0.1, 0.2, 0.3), -"transitions": PackedFloat32Array(1, 1, 1, 1), -"update": 1, -"values": [11, 15, 16, 17] -} -tracks/1/type = "value" -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/path = NodePath("Effects/DeathParticles:emitting") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/keys = { -"times": PackedFloat32Array(1), -"transitions": PackedFloat32Array(1), -"update": 1, -"values": [true] -} -tracks/2/type = "value" -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/path = NodePath(".:material:shader_parameter/alpha_modulate") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/keys = { -"times": PackedFloat32Array(1, 1.2), -"transitions": PackedFloat32Array(1, 1), -"update": 0, -"values": [1.0, 0.0] -} -tracks/3/type = "method" -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/path = NodePath("Effects/DeathCry") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/keys = { -"times": PackedFloat32Array(0.3), -"transitions": PackedFloat32Array(1), -"values": [{ -"args": [0.0], -"method": &"play" -}] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_xe5eq"] _data = { "RESET": SubResource("Animation_k6l16"), @@ -535,6 +536,7 @@ amount = 32 process_material = ExtResource("10_agw51") texture = SubResource("CanvasTexture_pited") lifetime = 2.0 +one_shot = true preprocess = 0.1 explosiveness = 0.9 @@ -552,6 +554,9 @@ explosiveness = 0.9 stream = ExtResource("12_vd7j4") volume_db = 2.0 +[node name="Footstep" type="AudioStreamPlayer2D" parent="Effects"] +stream = ExtResource("13_bxguv") + [node name="Camera2D" parent="." instance=ExtResource("4_ym125")] limit_left = -256 limit_top = -256 diff --git a/Extensions/Node2DExtensions.cs b/Extensions/Node2DExtensions.cs index c62366e..ab70549 100644 --- a/Extensions/Node2DExtensions.cs +++ b/Extensions/Node2DExtensions.cs @@ -30,7 +30,6 @@ public static class Node2DExtensions var clone = node.Duplicate() as T; world.AddChild(clone); clone.GlobalPosition = node.GlobalPosition; - GD.Print("clone on world: " + clone.GlobalPosition); return clone; } diff --git a/Scenes/Level.tscn b/Scenes/Level.tscn index 72688fd..863d4a0 100644 --- a/Scenes/Level.tscn +++ b/Scenes/Level.tscn @@ -6,10 +6,11 @@ [ext_resource type="Script" path="res://UI/UIController.cs" id="3_fe62s"] [ext_resource type="PackedScene" uid="uid://01d24ij5av1y" path="res://UI/BossBar.tscn" id="5_8njq4"] -[node name="World" type="Node2D" node_paths=PackedStringArray("UIController")] +[node name="World" type="Node2D" node_paths=PackedStringArray("UIController", "MusicPlayer")] script = ExtResource("1_1k6ew") StartingArea = ExtResource("2_avsrq") UIController = NodePath("CanvasLayer/UI") +MusicPlayer = NodePath("MusicPlayer") [node name="CanvasLayer" type="CanvasLayer" parent="."] @@ -56,3 +57,5 @@ alignment = 1 [node name="BossBar" parent="CanvasLayer/UI/Bottom" instance=ExtResource("5_8njq4")] visible = false layout_mode = 2 + +[node name="MusicPlayer" type="AudioStreamPlayer" parent="."] diff --git a/State/Character/NPCMoveState.cs b/State/Character/NPCMoveState.cs index b428d72..9dc57af 100644 --- a/State/Character/NPCMoveState.cs +++ b/State/Character/NPCMoveState.cs @@ -20,6 +20,7 @@ public partial class NPCMoveState : NPCState public override IState Enter(IState prev) { Character.MovementAnimation.Play("move"); + GD.Print("playing anim " + Character.MovementAnimation.CurrentAnimation); return base.Enter(prev); } } diff --git a/State/NPC/Doc/DocShungiteDartState.cs b/State/NPC/Doc/DocShungiteDartState.cs index f7515f6..18ae6af 100644 --- a/State/NPC/Doc/DocShungiteDartState.cs +++ b/State/NPC/Doc/DocShungiteDartState.cs @@ -21,8 +21,11 @@ public partial class DocShungiteDartState : DocAttackState [Export] public Characters.Doc Doc { get; set; } - public override void Exit(IState nextState) + public override NPCState Enter(IState nextState) { + Doc.CanAttack = true; + Doc.ShouldMove = true; + return base.Enter(nextState); } protected virtual Projectile SpawnProjectile( diff --git a/State/NPC/Doc/DocShungiteSpikeState.cs b/State/NPC/Doc/DocShungiteSpikeState.cs index c28f4ea..f216365 100644 --- a/State/NPC/Doc/DocShungiteSpikeState.cs +++ b/State/NPC/Doc/DocShungiteSpikeState.cs @@ -16,13 +16,15 @@ public partial class DocShungiteSpikeState : DocShungiteDartState } _currentAttacks = 0; _currentAttackDuration = 1; - Doc.ShouldMove = true; - Doc.CanAttack = true; + Doc.ShouldMove = false; + Doc.CanAttack = false; return base.Enter(previous); } public override void Exit(IState nextState) { + Doc.ShouldMove = true; + Doc.CanAttack = true; //Doc.TelegraphAnimation.Stop(); //Doc.TelegraphAnimation.Stop(); } diff --git a/State/NPC/Doc/DocUnwantedFrequencyState.cs b/State/NPC/Doc/DocUnwantedFrequencyState.cs index f65d405..ea0e85f 100644 --- a/State/NPC/Doc/DocUnwantedFrequencyState.cs +++ b/State/NPC/Doc/DocUnwantedFrequencyState.cs @@ -15,7 +15,6 @@ public partial class DocUnwantedFrequencyState : DocShungiteSpikeState { GetNode("../../Effects/UnwantedFrequenciesParticles") .Emitting = false; - GD.Print("Exit unwanted frequency"); base.Exit(nextState); } @@ -34,7 +33,6 @@ public partial class DocUnwantedFrequencyState : DocShungiteSpikeState protected override void Attack() { Doc.TelegraphAnimation.Play("unwanted_frequencies"); - GD.Print("unwanted frequency"); var player = _world.CurrentPlayer; var playerPos = player.GlobalPosition; var docPos = NPC.GlobalPosition; diff --git a/Utils/World.cs b/Utils/World.cs index 740b3d0..367c489 100644 --- a/Utils/World.cs +++ b/Utils/World.cs @@ -20,6 +20,9 @@ public partial class World : Node2D [Export] public UI.UIController UIController { get; set; } + [Export] + public AudioStreamPlayer MusicPlayer { get; set; } + private Dictionary _maps; private string _currentConnector; @@ -72,6 +75,8 @@ public partial class World : Node2D public void RegisterBoss(Boss boss) { UIController.BossBar.Boss = boss; + MusicPlayer.Stream = boss.Music; + MusicPlayer.Play(); } private void LoadMap(Map map)