diff --git a/Level_Core.tscn b/Level_Core.tscn index 2c6ea00..bfdc933 100644 --- a/Level_Core.tscn +++ b/Level_Core.tscn @@ -2733,9 +2733,6 @@ outline_modulate = Color(0.00803253, 9.36218e-06, 0.0382829, 1) text = "To unlock/free the cursor, press Shift+Enter" font = ExtResource("2_fq2vn") -[node name="PauseMenu" parent="." instance=ExtResource("3_i8tni")] -visible = false - [node name="StaticBody3D2" type="StaticBody3D" parent="."] transform = Transform3D(2.13967e-07, -2.18557e-07, -5, -5, -2.18557e-07, -2.13967e-07, -2.18557e-07, 5, -2.18557e-07, -60, -7.67982, 1.39268) @@ -2818,3 +2815,6 @@ size_flags_horizontal = 8 size_flags_vertical = 10 text = "Narration belongs here" label_settings = SubResource("LabelSettings_5l3ux") + +[node name="PauseMenu" parent="." instance=ExtResource("3_i8tni")] +visible = false diff --git a/Level_Labyrinth.tscn b/Level_Labyrinth.tscn index de460c5..ed21e09 100644 --- a/Level_Labyrinth.tscn +++ b/Level_Labyrinth.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=18 format=3 uid="uid://vx8amdj4s586"] +[gd_scene load_steps=19 format=3 uid="uid://vx8amdj4s586"] [ext_resource type="Script" uid="uid://cb2ob5t0phqot" path="res://main_l2.gd" id="1_4fas2"] [ext_resource type="PackedScene" uid="uid://bs6yq6gy7k2sb" path="res://player.tscn" id="2_r0elk"] @@ -8,6 +8,7 @@ [ext_resource type="FontFile" uid="uid://cfk3fgwuhngcw" path="res://InstrumentSans-VariableFont_wdth,wght.ttf" id="5_r0elk"] [ext_resource type="Texture2D" uid="uid://d15530ei26qvv" path="res://addons/kenney_prototype_textures/purple/texture_02.png" id="6_3xop5"] [ext_resource type="Shape3D" uid="uid://ck3ryefc358gp" path="res://wall_ncwt.tres" id="7_tb2wo"] +[ext_resource type="Texture2D" uid="uid://clnhbd4dggxmo" path="res://ProjektLuzidLogo.svg" id="9_nngep"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_rv2mx"] sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1) @@ -129,6 +130,23 @@ size_flags_horizontal = 8 size_flags_vertical = 10 text = "Narration belongs here" label_settings = SubResource("LabelSettings_nngep") +horizontal_alignment = 1 + +[node name="PROLUZ_LOGO" type="TextureRect" parent="."] +visible = false +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -250.0 +offset_top = -200.0 +offset_right = 250.0 +offset_bottom = 200.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("9_nngep") +stretch_mode = 2 [node name="PauseMenu" parent="." instance=ExtResource("5_mnf3s")] visible = false diff --git a/README.md b/README.md index 610d2f9..0da5d74 100644 --- a/README.md +++ b/README.md @@ -5,5 +5,14 @@ WIP btw !! # Credits +Main license of project: MIT +(subject to change) -Kenney Prototype Textures +Fonts used: Instrument Sans, Instrument Serif +Sources of icons: Material Icons +Music: +- FSM Team - Flying Home +Online Godot assets used: +- Godot Discord RPC +- Kenney UI Audio Prototype +- Kenney Prototype Textures diff --git a/assets/audio/FlyingHomeIntro.ogg b/assets/audio/FlyingHomeIntro.ogg new file mode 100644 index 0000000..bad8cca Binary files /dev/null and b/assets/audio/FlyingHomeIntro.ogg differ diff --git a/assets/audio/FlyingHomeIntro.ogg.import b/assets/audio/FlyingHomeIntro.ogg.import new file mode 100644 index 0000000..c4a2621 --- /dev/null +++ b/assets/audio/FlyingHomeIntro.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://bpjylusbehwgq" +path="res://.godot/imported/FlyingHomeIntro.ogg-0266d50457cdedd417c49a16f498ac77.oggvorbisstr" + +[deps] + +source_file="res://assets/audio/FlyingHomeIntro.ogg" +dest_files=["res://.godot/imported/FlyingHomeIntro.ogg-0266d50457cdedd417c49a16f498ac77.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/assets/audio/FlyingHomeMain.ogg b/assets/audio/FlyingHomeMain.ogg new file mode 100644 index 0000000..b4508b6 Binary files /dev/null and b/assets/audio/FlyingHomeMain.ogg differ diff --git a/assets/audio/FlyingHomeMain.ogg.import b/assets/audio/FlyingHomeMain.ogg.import new file mode 100644 index 0000000..8bca15b --- /dev/null +++ b/assets/audio/FlyingHomeMain.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://c2dqbhtgkaslq" +path="res://.godot/imported/FlyingHomeMain.ogg-88d020de83667302a7c9f36e5e299e3c.oggvorbisstr" + +[deps] + +source_file="res://assets/audio/FlyingHomeMain.ogg" +dest_files=["res://.godot/imported/FlyingHomeMain.ogg-88d020de83667302a7c9f36e5e299e3c.oggvorbisstr"] + +[params] + +loop=false +loop_offset=0 +bpm=0 +beat_count=0 +bar_beats=4 diff --git a/main.gd b/main.gd index 8fdc52b..5239972 100644 --- a/main.gd +++ b/main.gd @@ -109,9 +109,20 @@ func pauseMenu(): Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) pause_menu.hide() Engine.time_scale = 1 + player.musicplayer.stream_paused = false + player.newmusicplayer.stream_paused = false + player.audioplayer.stream_paused = false else: pause_menu.show() Engine.time_scale = 0.00001 + player.musicplayer.stream_paused = true + player.newmusicplayer.stream_paused = true + player.audioplayer.stream_paused = true # Engine.time_scale = -1 paused = !paused + +func narrate(text: String): + player.audioplayer.stream = load("res://addons/kenney_ui_audio/switch38.wav") + player.audioplayer.play() + narrationtext.text = text diff --git a/main_l2.gd b/main_l2.gd index f584395..0b4f87e 100644 --- a/main_l2.gd +++ b/main_l2.gd @@ -19,21 +19,82 @@ var checkpoint3 = Vector3(-50, 25, -5) var terminus = Vector3(-8, -8.5, 9.5) func wait(specifiedsecond: float): - await get_tree().create_timer(specifiedsecond).timeout + await get_tree().create_timer(4).timeout + +func _on_audio_finished(): + player.newmusicplayer.play() func _ready() -> void: # var player = get_node("%Player") +# player.newmusicplayer.finished.connect(_on_audio_finished) + checkpointtext.text = "station 0" narrationtext.hide() narrationtext.show() - checkpointtext.text = "station 0" - narrationtext.text = "Hi." - wait(2) - narrationtext.text = "You probably have no idea who I could be." - wait(6) - narrationtext.text = "But I've been watching you." - wait(3) - narrationtext.text = "Closely." - wait(1) + narrate("Hi.") + await get_tree().create_timer(2).timeout + narrate("You probably have no idea who I could be.") + await get_tree().create_timer(4).timeout + narrate("But I've been watching you.") + await get_tree().create_timer(3).timeout + narrate("Closely.") + await get_tree().create_timer(2).timeout + narrate("You don't know it yet, but essentially, \nI guess you could call me a different version \nof what you happen to be.") + await get_tree().create_timer(8).timeout + narrate("I am what you think. I am you.") + await get_tree().create_timer(3).timeout + narrate("Sure, it may sound weird, but I am you, but not at the same time.\nI can speak, you can't, at least not yet.") + await get_tree().create_timer(7).timeout + narrate("I will be here.") + await get_tree().create_timer(1).timeout + narrate("Everywhere you go.") + await get_tree().create_timer(1).timeout + narrate("Thinking.") + await get_tree().create_timer(1).timeout + narrate("Seeing.") + player.musicplayer.stream = load("res://assets/audio/FlyingHomeIntro.ogg") + player.musicplayer.play() + await get_tree().create_timer(1).timeout + narrate("Talking.") + await get_tree().create_timer(1).timeout + narrate("Acting.") + await get_tree().create_timer(1).timeout + narrate("So good that sometimes you won't even notice I'm here.") + await get_tree().create_timer(4).timeout + narrate("It's like I live in your mind.") + await get_tree().create_timer(2).timeout + narrate("Although,") + await get_tree().create_timer(1).timeout + narrate("Although, there's no reason to be scared of me.") + await get_tree().create_timer(4).timeout + narrate("After all, I'm a part of your thoughts, without me you probably\nwouldn't be alive due to some dumb shit\nyou'd be likely to do.") + await get_tree().create_timer(8).timeout + narrate("Must feel like a lucid dream, huh?") + await get_tree().create_timer(3).timeout + narrate("Kind of almost as lucid as...") + await get_tree().create_timer(3).timeout + narrationtext.hide() + player.musicplayer.stream = load("res://assets/audio/FlyingHomeMain.ogg") + player.musicplayer.stream.loop = true + player.musicplayer.play() +# player.musicplayer.stream.loop = true + narrationtext.text = "" + narrationtext.show() + $PROLUZ_LOGO.show() + await get_tree().create_timer(1.9).timeout +# $PROLUZ_LOGO.hide() + narrationtext.text = "Music playing is \"FSM Team - Flying Home\"" + await get_tree().create_timer(1.71).timeout + narrationtext.text = "Published by Lintine GS2EB" + await get_tree().create_timer(1.71).timeout + narrationtext.text = "Solo project by kevadesu" + await get_tree().create_timer(1.71).timeout + narrationtext.text = "Without initial experience in Godot" + await get_tree().create_timer(1.71).timeout + narrationtext.text = "Started as a school project" + await get_tree().create_timer(1.71).timeout + narrationtext.hide() + $PROLUZ_LOGO.hide() + # narrationtext.hide() # while true: # wait(5) @@ -66,6 +127,7 @@ func _process(delta: float): get_tree().reload_current_scene() var player = get_node("Player") $HUD/HBoxContainer/VBoxContainer/Label_Controls2.text = get_formatted_time() + # Health bar if player.health == 100: healthtext.text = "[//////////]" @@ -105,6 +167,10 @@ func _process(delta: float): healthtext.add_theme_color_override("font_color", Color.MEDIUM_PURPLE) Engine.time_scale = 0.001 +func narrate(text: String): + player.audioplayer.stream = load("res://addons/kenney_ui_audio/switch38.wav") + player.audioplayer.play() + narrationtext.text = text func get_formatted_time() -> String: var total_milliseconds = int(elapsed_time * 1000) @@ -118,9 +184,14 @@ func pauseMenu(): Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) pause_menu.hide() Engine.time_scale = 1 + player.musicplayer.stream_paused = false + player.newmusicplayer.stream_paused = false + player.audioplayer.stream_paused = false else: pause_menu.show() Engine.time_scale = 0.00001 -# Engine.time_scale = -1 + player.musicplayer.stream_paused = true + player.newmusicplayer.stream_paused = true + player.audioplayer.stream_paused = true paused = !paused diff --git a/player.gd b/player.gd index 395f679..872d7e1 100644 --- a/player.gd +++ b/player.gd @@ -9,6 +9,8 @@ var twist_input := 0.0 var pitch_input := 0.0 # var levelcore: Node @onready var audioplayer = get_node("SFX") +@onready var musicplayer = get_node("Music") +@onready var newmusicplayer = $MusicProper @onready var twist_pivot := $TwistPivot @onready var pitch_pivot := $TwistPivot/PitchPivot @onready var currentscene = get_tree().current_scene diff --git a/player.tscn b/player.tscn index 1f42a6e..1910455 100644 --- a/player.tscn +++ b/player.tscn @@ -31,3 +31,8 @@ transform = Transform3D(1, 0, 0, 0, 0.986406, -0.164325, 0, 0.164325, 0.986406, [node name="SFX" type="AudioStreamPlayer3D" parent="."] [node name="Music" type="AudioStreamPlayer3D" parent="."] + +[node name="MusicLoop" type="AudioStreamPlayer3D" parent="."] +playback_type = 1 + +[node name="MusicProper" type="AudioStreamPlayer" parent="."] diff --git a/start.gd b/start.gd index 3557c07..e86ed2c 100644 --- a/start.gd +++ b/start.gd @@ -12,8 +12,30 @@ func main(): func _ready(): print("READY!!! >w<") levellist.hide() -# start_button.pressed.connect(_start_button_pressed) -# quit_button.pressed.connect(_quit_button_pressed) + start_button.pressed.connect(_start_button_pressed) + quit_button.pressed.connect(_quit_button_pressed) + +#func _ready(): +# print("READY!!! >w<") +# levellist.hide() +# +# var original = load("res://assets/audio/FlyingHomeIntro.ogg") as AudioStreamOggVorbis +# print("Original stream loaded:", original) +# print("Original loop mode:", original.loop) +# +# var stream = original.duplicate() as AudioStreamOggVorbis +# stream.loop = true +# print("Duplicated stream set to loop:", stream.loop) +# + +# $AudioStreamPlayer.stream = stream +# $AudioStreamPlayer.volume_db = 0 +# $AudioStreamPlayer.play() +# print("Tried to play...") +# +# await get_tree().create_timer(0.2).timeout +# print("Is playing after 0.2s:", $AudioStreamPlayer.is_playing()) + func _start_button_pressed(): if playbutton == false: diff --git a/start.tscn b/start.tscn index b034b96..7f1b728 100644 --- a/start.tscn +++ b/start.tscn @@ -225,5 +225,7 @@ alignment = 0 icon_alignment = 2 expand_icon = true +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] + [connection signal="pressed" from="TextureRect/MarginContainer/HBoxContainer/VBoxContainer/PlayButton" to="." method="_start_button_pressed"] [connection signal="pressed" from="TextureRect/MarginContainer/HBoxContainer/VBoxContainer/QuitButton" to="." method="_quit_button_pressed"]