some fixes

godot-4.1.1
John Montagu, the 4th Earl of Sandvich 2023-07-24 00:43:21 -07:00
parent 3f4567b6ba
commit 47f5c6869b
Signed by: sandvich
GPG Key ID: 9A39BE37E602B22D
10 changed files with 102 additions and 62 deletions

Binary file not shown.

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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="."]

View File

@ -20,6 +20,7 @@ public partial class NPCMoveState : NPCState
public override IState<CharacterState> Enter(IState<CharacterState> prev)
{
Character.MovementAnimation.Play("move");
GD.Print("playing anim " + Character.MovementAnimation.CurrentAnimation);
return base.Enter(prev);
}
}

View File

@ -21,8 +21,11 @@ public partial class DocShungiteDartState : DocAttackState
[Export]
public Characters.Doc Doc { get; set; }
public override void Exit(IState<NPCState> nextState)
public override NPCState Enter(IState<NPCState> nextState)
{
Doc.CanAttack = true;
Doc.ShouldMove = true;
return base.Enter(nextState);
}
protected virtual Projectile SpawnProjectile(

View File

@ -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<NPCState> nextState)
{
Doc.ShouldMove = true;
Doc.CanAttack = true;
//Doc.TelegraphAnimation.Stop();
//Doc.TelegraphAnimation.Stop();
}

View File

@ -15,7 +15,6 @@ public partial class DocUnwantedFrequencyState : DocShungiteSpikeState
{
GetNode<GpuParticles2D>("../../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;

View File

@ -20,6 +20,9 @@ public partial class World : Node2D
[Export]
public UI.UIController UIController { get; set; }
[Export]
public AudioStreamPlayer MusicPlayer { get; set; }
private Dictionary<string, Map> _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)