Valve and music

This commit is contained in:
Marco 2025-07-09 10:41:44 +02:00
commit ed86ffd184
13 changed files with 197 additions and 15 deletions

View file

@ -0,0 +1,48 @@
[gd_scene load_steps=7 format=3 uid="uid://dvmkfm2l3vcf7"]
[ext_resource type="Script" uid="uid://qnxswkkn24eo" path="res://Scripts/Interactables/3D/AnimatedSwitch3D.cs" id="1_2itqu"]
[ext_resource type="AudioStream" uid="uid://bjvklk7qmlivd" path="res://SFX/288963__littlerobotsoundfactory__click_electronic_14.wav" id="3_442iw"]
[ext_resource type="PackedScene" uid="uid://b11b5nh0lu7nq" path="res://3D/BlockbenchModels/Tubes/Valve.gltf" id="4_2itqu"]
[ext_resource type="AudioStream" uid="uid://myr6n2c1u503" path="res://SFX/581602__samsterbirdies__beep-error.mp3" id="4_q1ywx"]
[ext_resource type="Script" uid="uid://c077xadpua5iy" path="res://Scripts/Actors/3D/OpenCloseActorAnimationManager3D.cs" id="5_fw20q"]
[sub_resource type="SphereShape3D" id="SphereShape3D_itd0i"]
radius = 0.868968
[node name="Valve" type="Area3D" node_paths=PackedStringArray("Targets") groups=["Interactable"]]
collision_layer = 32
collision_mask = 0
script = ExtResource("1_2itqu")
Targets = []
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_itd0i")
[node name="ActivationSound" type="AudioStreamPlayer3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.15351868)
stream = ExtResource("3_442iw")
bus = &"Effects"
[node name="DenySound" type="AudioStreamPlayer3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -0.15351868)
stream = ExtResource("4_q1ywx")
bus = &"Effects"
[node name="blockbench_export" parent="." instance=ExtResource("4_2itqu")]
[node name="bone" parent="blockbench_export/Node" index="0"]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0, 0, 0)
[node name="AnimationManager" type="Node" parent="." node_paths=PackedStringArray("AnimationPlayer")]
script = ExtResource("5_fw20q")
AnimationPlayer = NodePath("../blockbench_export/AnimationPlayer")
[connection signal="Closing" from="." to="AnimationManager" method="PlayClosing"]
[connection signal="Opening" from="." to="AnimationManager" method="PlayOpening"]
[connection signal="SetClosed" from="." to="AnimationManager" method="SkipToClose"]
[connection signal="SetOpen" from="." to="AnimationManager" method="SkipToOpen"]
[connection signal="ClosedAnimationCompleted" from="AnimationManager" to="." method="ClosedAnimationFinished"]
[connection signal="OpenAnimationCompleted" from="AnimationManager" to="." method="OpenAnimationFinished"]
[editable path="blockbench_export"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=12 format=3 uid="uid://ec4m3geediis"]
[gd_scene load_steps=14 format=3 uid="uid://ec4m3geediis"]
[ext_resource type="Script" uid="uid://ba0tf7ihw4hpp" path="res://Scripts/Misc/CameraController3D.cs" id="1_g4gcm"]
[ext_resource type="Script" uid="uid://b8g8mflgsr5dc" path="res://Scripts/GameController.cs" id="1_joeuf"]
@ -9,6 +9,8 @@
[ext_resource type="AudioStream" uid="uid://blohh20jktoyo" path="res://SFX/270641__phantastonia__alarm2.wav" id="7_5vm3d"]
[ext_resource type="Script" uid="uid://csruxpdnpj18r" path="res://Scripts/Actors/3D/PlayerStartMarker3D.cs" id="9_g4gcm"]
[ext_resource type="PackedScene" uid="uid://rimplblbptcd" path="res://Scenes/Actors/IsoPlayer_FSM.tscn" id="12_g4gcm"]
[ext_resource type="PackedScene" uid="uid://b3tyacxxw88lx" path="res://Scenes/Utils/StreamPlayerWithName.tscn" id="12_mgr2t"]
[ext_resource type="Resource" uid="uid://b12ldmtfhlvf0" path="res://Resources/Music/Apparitions_Stalk_The_Factory.tres" id="13_lhprj"]
[ext_resource type="Script" uid="uid://dnslcy71dgea" path="res://Scripts/Misc/CameraTarget3D.cs" id="16_e2nai"]
[ext_resource type="PackedScene" uid="uid://cupulrjeeivxm" path="res://3D/MapScenes/TestLevel2.tscn" id="18_e2nai"]
@ -73,3 +75,7 @@ TargetPath = NodePath("../CameraTarget")
[node name="TestLevel2" parent="." instance=ExtResource("18_e2nai")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 93.4519, 0, -38.2113)
[node name="AudioStreamPlayer2D" parent="." instance=ExtResource("12_mgr2t")]
autoplay = true
MusicData = ExtResource("13_lhprj")

BIN
Music/Apparitions_Stalk_The_factory.ogg (Stored with Git LFS) Normal file

Binary file not shown.

View file

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://ckewppifyg28p"
path="res://.godot/imported/Apparitions_Stalk_The_factory.ogg-2cdf35be5dafdeda19b25e140be09281.oggvorbisstr"
[deps]
source_file="res://Music/Apparitions_Stalk_The_factory.ogg"
dest_files=["res://.godot/imported/Apparitions_Stalk_The_factory.ogg-2cdf35be5dafdeda19b25e140be09281.oggvorbisstr"]
[params]
loop=true
loop_offset=0.0
bpm=0.0
beat_count=0
bar_beats=4

View file

@ -7,7 +7,6 @@
[sub_resource type="Resource" id="Resource_ep84i"]
script = ExtResource("1_aaqha")
Name = "Director"
Contribution = ""
CustomLabelSettings = ExtResource("2_vda0h")
metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
@ -20,7 +19,6 @@ metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
[sub_resource type="Resource" id="Resource_m7fsk"]
script = ExtResource("1_aaqha")
Name = "Original Game By"
Contribution = ""
CustomLabelSettings = ExtResource("2_vda0h")
metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
@ -33,7 +31,6 @@ metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
[sub_resource type="Resource" id="Resource_1cmaw"]
script = ExtResource("1_aaqha")
Name = "Music"
Contribution = ""
CustomLabelSettings = ExtResource("2_vda0h")
metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
@ -46,7 +43,6 @@ metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
[sub_resource type="Resource" id="Resource_daaek"]
script = ExtResource("1_aaqha")
Name = "Art"
Contribution = ""
CustomLabelSettings = ExtResource("2_vda0h")
metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
@ -59,7 +55,6 @@ metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"
[sub_resource type="Resource" id="Resource_321dv"]
script = ExtResource("1_aaqha")
Name = "Misc"
Contribution = ""
CustomLabelSettings = ExtResource("2_vda0h")
metadata/_custom_type_script = "uid://bc4f4ggvk3ktf"

View file

@ -5,7 +5,6 @@
[sub_resource type="Resource" id="Resource_7e7pr"]
script = ExtResource("2_bbif0")
EggIndex = 0
StartingEquipment = []
RemoveEquipment = []
metadata/_custom_type_script = "uid://mja0rk7n2kln"
@ -16,6 +15,5 @@ LevelId = -1
MapName = &"Briefing"
MapDescription = null
ScenePath = &"uid://dcn2o6hllas78"
WeaponsAllowed = false
StartData = SubResource("Resource_7e7pr")
metadata/_custom_type_script = "uid://quy4d4tgvqfy"

View file

@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="MusicResource" load_steps=3 format=3 uid="uid://b12ldmtfhlvf0"]
[ext_resource type="Script" uid="uid://cx63lvsuj1787" path="res://Scripts/Resources/MusicResource.cs" id="1_l4141"]
[ext_resource type="AudioStream" uid="uid://ckewppifyg28p" path="res://Music/Apparitions_Stalk_The_factory.ogg" id="1_nvmwn"]
[resource]
script = ExtResource("1_l4141")
TrackName = "Apparitions Stalk the Factory"
AuthorName = "J4NkY"
ShowAuthor = true
Track = ExtResource("1_nvmwn")
metadata/_custom_type_script = "uid://cx63lvsuj1787"

View file

@ -1,10 +1,11 @@
[gd_scene load_steps=10 format=3 uid="uid://c84shrj84g4t2"]
[gd_scene load_steps=11 format=3 uid="uid://c84shrj84g4t2"]
[ext_resource type="Script" uid="uid://c06tspxwnj7pg" path="res://Scripts/UI/MusicRoom.cs" id="1_u3ui8"]
[ext_resource type="Script" uid="uid://cx63lvsuj1787" path="res://Scripts/Resources/MusicResource.cs" id="2_nkbmj"]
[ext_resource type="Theme" uid="uid://dnsadvmunm76k" path="res://Resources/Styles/MainMenuButtons.tres" id="2_rcbhv"]
[ext_resource type="Resource" uid="uid://byo74ews118nl" path="res://Resources/Music/No_Reason.tres" id="3_nkbmj"]
[ext_resource type="Texture2D" uid="uid://bpd4ldfmt3s51" path="res://Sprites/UI/Note.png" id="3_u3ui8"]
[ext_resource type="Resource" uid="uid://b12ldmtfhlvf0" path="res://Resources/Music/Apparitions_Stalk_The_Factory.tres" id="4_cv0ke"]
[ext_resource type="Texture2D" uid="uid://b4fhb0wyc5vw" path="res://Sprites/UI/BackIcon.png" id="7_cv0ke"]
[ext_resource type="FontFile" uid="uid://ccm3u37q1hvux" path="res://fonts/Xolonium-Regular.ttf" id="7_nkbmj"]
[ext_resource type="LabelSettings" uid="uid://buk3e7bbwmnv1" path="res://Resources/Styles/Hud_Text_Style.tres" id="8_nkbmj"]
@ -24,7 +25,7 @@ grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_u3ui8")
Tracks = Array[ExtResource("2_nkbmj")]([ExtResource("3_nkbmj")])
Tracks = Array[ExtResource("2_nkbmj")]([ExtResource("3_nkbmj"), ExtResource("4_cv0ke")])
TracksContainer = NodePath("VBoxContainer/ItemList")
Icon = ExtResource("3_u3ui8")
DescriptionLabel = NodePath("VBoxContainer/MarginContainer/DescriptionLabel")

View file

@ -3,8 +3,7 @@
[ext_resource type="Script" uid="uid://sebnyy6skgsr" path="res://Scripts/UI/AudioNameVisualizer.cs" id="2_ppua0"]
[ext_resource type="PackedScene" uid="uid://dfdagutgntio4" path="res://Scripts/UI/MusicVisualizerCanvas.tscn" id="3_vf84v"]
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D"]
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer"]
bus = &"Music"
script = ExtResource("2_ppua0")
TrackName = "Track Title"
AuthorName = "Author Name"
CanvasTemplate = ExtResource("3_vf84v")

View file

@ -0,0 +1,100 @@
using Godot;
namespace Cirno.Scripts.Interactables._3D;
[Tool]
public partial class AnimatedSwitch3D : Switch3D
{
[Export] public DoorState State { get; set; } = DoorState.Closed;
[Signal]
public delegate void OpeningEventHandler();
[Signal]
public delegate void ClosingEventHandler();
[Signal]
public delegate void SetClosedEventHandler();
[Signal]
public delegate void SetOpenEventHandler();
private bool _isAnimating = false;
public override void _Ready()
{
if (Engine.IsEditorHint()) return;
base._Ready();
SyncAnimation();
}
private void SyncAnimation()
{
if (State is DoorState.Closed)
{
EmitSignalSetClosed();
}
else
{
EmitSignalSetOpen();
}
}
public void ClosedAnimationFinished()
{
State = DoorState.Closed;
_isAnimating = false;
}
public void OpenAnimationFinished()
{
State = DoorState.Open;
_isAnimating = false;
}
private void ChangeState(DoorState newState)
{
if (_isAnimating) return;
if (State == newState) return;
switch (newState)
{
case DoorState.Open:
EmitSignalOpening();
break;
case DoorState.Closed:
EmitSignalClosing();
break;
}
_isAnimating = true;
}
public override bool Activate(ActivationType activationType = ActivationType.Toggle)
{
if (_isAnimating) return false;
switch (State)
{
case DoorState.Closed:
if (base.Activate(ActivationType.Open))
{
ChangeState(DoorState.Open);
return true;
}
break;
case DoorState.Open:
if (base.Activate(ActivationType.Close))
{
ChangeState(DoorState.Closed);
return true;
}
break;
}
return false;
}
}

View file

@ -0,0 +1 @@
uid://qnxswkkn24eo

View file

@ -20,7 +20,7 @@ public partial class MainMenu : CanvasLayer
public Button DefaultSelectedButton { get; private set; }
[Export]
public AudioStreamPlayer2D MusicPlayer { get; private set; }
public AudioStreamPlayer MusicPlayer { get; private set; }
[ExportCategory("Languages")]
[Export] public Button ItalianButton { get; private set; }

View file

@ -8,7 +8,7 @@ using GTweens.Tweens;
using GTweensGodot.Extensions;
using Cirno.Scripts.Resources;
public partial class AudioNameVisualizer : AudioStreamPlayer2D
public partial class AudioNameVisualizer : AudioStreamPlayer
{
[Export]
public MusicResource MusicData { get; set; }