diff --git a/game/_development/ayuroo/Magician.glb.import b/game/_development/ayuroo/Magician.glb.import index fca6680..7e0f45f 100644 --- a/game/_development/ayuroo/Magician.glb.import +++ b/game/_development/ayuroo/Magician.glb.import @@ -39,7 +39,20 @@ import_script/path="" materials/extract=1 materials/extract_format=0 materials/extract_path="" -_subresources={} +_subresources={ +"materials": { +"@MATERIAL:0": { +"use_external/enabled": true, +"use_external/fallback_path": "res://_development/ayuroo/@MATERIAL_0.tres", +"use_external/path": "res://_development/ayuroo/@MATERIAL_0.tres" +}, +"@MATERIAL:1": { +"use_external/enabled": true, +"use_external/fallback_path": "res://_development/ayuroo/@MATERIAL_1.tres", +"use_external/path": "res://_development/ayuroo/@MATERIAL_1.tres" +} +} +} gltf/naming_version=2 gltf/embedded_image_handling=1 gltf/texture_map_mode=0 diff --git a/game/addons/version_display/version_display.gd b/game/addons/version_display/version_display.gd index 80fbc2b..7230748 100644 --- a/game/addons/version_display/version_display.gd +++ b/game/addons/version_display/version_display.gd @@ -3,7 +3,7 @@ extends CanvasLayer const DEFAULT_TEXT: String = "{game_name} - {state} - V - {version}" const UNDEFINED_TEXT: String = "Undefined" -const States: String = "Pre-Production,Pre-Alpha,Early-Alpha,Alpha,Beta,Early-Access,Release" +const States: String = "Prototype,Pre-Production,Alpha,Beta,Early-Access,Release" @export_custom(PROPERTY_HINT_ENUM_SUGGESTION, States) var state: String = "Pre-Production" @export_multiline var text_override: String = DEFAULT_TEXT: set = set_text @@ -26,7 +26,7 @@ func set_text(new_text: String) -> void: func _update_hud() -> void: - if not self.is_node_ready(): - await self.ready + if not is_node_ready(): + await ready version_label.set_text(text_override) diff --git a/game/addons/version_display/version_display.tscn b/game/addons/version_display/version_display.tscn index 24708d2..e9ef16c 100644 --- a/game/addons/version_display/version_display.tscn +++ b/game/addons/version_display/version_display.tscn @@ -7,6 +7,7 @@ process_mode = 3 layer = 64 follow_viewport_enabled = true script = ExtResource("1_jk1t8") +text_override = "{game_name} - {state} - v{version}" [node name="MarginContainer" type="MarginContainer" parent="." unique_id=1238717635] anchors_preset = 15 diff --git a/game/project.godot b/game/project.godot index 978cce0..2105906 100644 --- a/game/project.godot +++ b/game/project.godot @@ -11,6 +11,7 @@ config_version=5 [application] config/name="MagicNStuff" +config/version="0.0.1" config/tags=PackedStringArray("game", "horror", "open_world", "story") run/main_scene="uid://ga0d5817hbc8" config/features=PackedStringArray("4.7", "Forward Plus") diff --git a/game/src/core/controller_rumble/rumble_component.gd b/game/src/core/controller_rumble/rumble_component.gd index 81bd976..7447483 100644 --- a/game/src/core/controller_rumble/rumble_component.gd +++ b/game/src/core/controller_rumble/rumble_component.gd @@ -59,6 +59,7 @@ var _editor_stop_test_vibration: Callable = stop_vibration get = get_magnitude_multiplier, set = set_magnitude_multiplier +var animated_config := RumbleConfig.new() var animated_weak_magnitude: float = 0.0: set(value): animated_weak_magnitude = clampf(value, 0.0, 1.0) @@ -77,15 +78,14 @@ func _physics_process(delta: float) -> void: can_vibrate() and not is_zero_approx(animated_weak_magnitude + animated_strong_magnitude) ): - var config := RumbleConfig.new() - config.weak_intensity = animated_weak_magnitude - config.strong_intensity = animated_strong_magnitude - config.duration = delta + animated_config.weak_intensity = animated_weak_magnitude + animated_config.strong_intensity = animated_strong_magnitude + animated_config.duration = delta #_weak_magnitude = remap(_weak_magnitude, 0.0, 1.0, min_weak_magnitude_threshold * float(_weak_magnitude > 0.0), 1.0) #_strong_magnitude = remap(_strong_magnitude, 0.0, 1.0, min_strong_magnitude_threshold * float(_strong_magnitude > 0.0), 1.0) - RumbleConductor.add_rumble(config, device) + RumbleConductor.add_rumble(animated_config, device) #Input.start_joy_vibration.call_deferred(device, _weak_magnitude, _strong_magnitude, delta) animated_weak_magnitude = 0.0 animated_strong_magnitude = 0.0 diff --git a/game/src/game.gd b/game/src/game.gd index d104f3f..54cfb56 100644 --- a/game/src/game.gd +++ b/game/src/game.gd @@ -7,6 +7,7 @@ extends Node const USER_SETTINGS_PATH: String = "user://settings.ini" const SAVE_DIR: String = "user://saves/%d/" # TODO "user://ch1/saves/%d/ # Chapter 1 const SAVE_PATH: String = SAVE_DIR + "%s" +const SAVE_FILENAME: String = "save_data.tres" const INITIAL_SAVE_DATA: SaveData = preload("uid://b8ojagpq5pxr2") static var is_debug: bool = true @@ -63,7 +64,7 @@ func save_game() -> Error: if not is_instance_valid(world): return ERR_DOES_NOT_EXIST - var file_name: String = "save_data.tres" + var file_name: String = SAVE_FILENAME if is_instance_valid(world): save_data.current_world = ResourceUID.path_to_uid(world.scene_file_path) diff --git a/game/src/ui/setup/controller/controller_setup_menu.gd b/game/src/ui/setup/controller/controller_setup_menu.gd index 90c7ddf..9667a39 100644 --- a/game/src/ui/setup/controller/controller_setup_menu.gd +++ b/game/src/ui/setup/controller/controller_setup_menu.gd @@ -19,6 +19,9 @@ var _duration_idx: int = 0 @onready var vibrate_texture: TextureRect = %VibrateTexture @onready var confirm_button: Button = %ConfirmButton +@onready var deny_button: Button = %DenyButton + +@onready var status_label: Label = %StatusLabel func _ready() -> void: @@ -32,6 +35,7 @@ func _ready() -> void: min_weak_magnitude.value_changed.connect(_on_min_weak_magnitude_value_changed) min_strong_magnitude.value_changed.connect(_on_min_strong_magnitude_value_changed) confirm_button.pressed.connect(confirm) + deny_button.pressed.connect(confirm) visibility_changed.connect(_on_visibility_changed) _on_visibility_changed() @@ -54,10 +58,22 @@ func confirm() -> void: confirmed.emit() +func stop_setup() -> void: + disable_controls() + + +func disable_controls() -> void: + min_weak_magnitude.editable = false + min_strong_magnitude.editable = false + confirm_button.disabled = true + deny_button.disabled = true + + func _test_vibration() -> void: # If is_testing_weak and is_testing_strong are both false, vibrate both together. var weak_enabled: bool = is_testing_weak or (not is_testing_weak and not is_testing_strong) var strong_enabled: bool = is_testing_strong or (not is_testing_weak and not is_testing_strong) + rumble_component.data.weak_intensity = MIN_WEAK_MAGNITUDE * float(weak_enabled) rumble_component.data.strong_intensity = MIN_STRONG_MAGNITUDE * float(strong_enabled) @@ -86,6 +102,18 @@ func _vibrate_texture() -> void: tween.tween_property(vibrate_texture, ^"rotation_degrees", 0.0, 0.1) +func _update_status_label() -> void: + var weak_enabled: bool = is_testing_weak or (not is_testing_weak and not is_testing_strong) + var strong_enabled: bool = is_testing_strong or (not is_testing_weak and not is_testing_strong) + + if weak_enabled and strong_enabled: + status_label.text = "Testing: Both Motors" + elif weak_enabled: + status_label.text = "Testing: Weak Motor" + else: + status_label.text = "Testing: Strong Motor" + + func _on_visibility_changed() -> void: if is_visible_in_tree(): repeat_vibration_timer.start() @@ -109,15 +137,19 @@ func _on_min_strong_magnitude_value_changed(value: float) -> void: func _on_weak_slider_focused() -> void: is_testing_weak = true + _update_status_label() func _on_weak_slider_unfocused() -> void: is_testing_weak = false + _update_status_label() func _on_strong_slider_focused() -> void: is_testing_strong = true + _update_status_label() func _on_strong_slider_unfocused() -> void: is_testing_strong = false + _update_status_label() diff --git a/game/src/ui/setup/controller/controller_setup_menu.tscn b/game/src/ui/setup/controller/controller_setup_menu.tscn index 5487e87..d63622f 100644 --- a/game/src/ui/setup/controller/controller_setup_menu.tscn +++ b/game/src/ui/setup/controller/controller_setup_menu.tscn @@ -69,10 +69,32 @@ grow_vertical = 0 focus_neighbor_left = NodePath(".") focus_neighbor_top = NodePath("../VBoxContainer/MinStrongMagnitude") focus_neighbor_right = NodePath(".") +focus_neighbor_bottom = NodePath("../DenyButton") +focus_next = NodePath("../DenyButton") +focus_previous = NodePath("../VBoxContainer/MinStrongMagnitude") +text = "Confirm" + +[node name="DenyButton" type="Button" parent="." unique_id=675156855] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.5 +anchor_top = 0.75 +anchor_right = 0.5 +anchor_bottom = 0.75 +offset_left = -109.5 +offset_top = 10.0 +offset_right = 109.5 +offset_bottom = 41.0 +grow_horizontal = 2 +grow_vertical = 0 +focus_neighbor_left = NodePath(".") +focus_neighbor_top = NodePath("../ConfirmButton") +focus_neighbor_right = NodePath(".") focus_neighbor_bottom = NodePath(".") focus_next = NodePath(".") focus_previous = NodePath("../VBoxContainer/MinStrongMagnitude") -text = "Confirm" +text = "I wont be using a controller" [node name="VibrateTexture" type="TextureRect" parent="." unique_id=766104981] unique_name_in_owner = true @@ -106,6 +128,12 @@ grow_horizontal = 2 grow_vertical = 2 metadata/_edit_use_anchors_ = true +[node name="StatusLabel" type="Label" parent="VBoxContainer" unique_id=1981025114] +unique_name_in_owner = true +layout_mode = 2 +text = "Testing: Weak-Motor" +horizontal_alignment = 1 + [node name="MinDurationSlider" type="HSlider" parent="VBoxContainer" unique_id=339190501] unique_name_in_owner = true visible = false diff --git a/game/src/ui/setup/initial_setup_menu.gd b/game/src/ui/setup/initial_setup_menu.gd index 0e8d03c..0f92bde 100644 --- a/game/src/ui/setup/initial_setup_menu.gd +++ b/game/src/ui/setup/initial_setup_menu.gd @@ -55,12 +55,13 @@ func fade_out() -> void: func _on_rythm_setup_confirmed() -> void: - rhythm_setup_menu.stop_setup() + rhythm_setup_menu.fade_out_and_stop_setup(3.0) await fade_in() setup_finished.emit() func _on_controller_setup_confirmed() -> void: + controller_setup_menu.stop_setup() await fade_in() controller_setup_menu.hide() rhythm_setup_menu.show() diff --git a/game/src/ui/setup/rhythm/80bpm_metronome.ogg b/game/src/ui/setup/rhythm/80bpm_metronome.ogg new file mode 100644 index 0000000..7877d7f Binary files /dev/null and b/game/src/ui/setup/rhythm/80bpm_metronome.ogg differ diff --git a/game/src/ui/setup/rhythm/80bpm_metronome.ogg.import b/game/src/ui/setup/rhythm/80bpm_metronome.ogg.import new file mode 100644 index 0000000..42478d9 --- /dev/null +++ b/game/src/ui/setup/rhythm/80bpm_metronome.ogg.import @@ -0,0 +1,19 @@ +[remap] + +importer="oggvorbisstr" +type="AudioStreamOggVorbis" +uid="uid://ba8numb2iktfh" +path="res://.godot/imported/80bpm_metronome.ogg-01fbd8eafec323cab783e93ca397fd9a.oggvorbisstr" + +[deps] + +source_file="res://src/ui/setup/rhythm/80bpm_metronome.ogg" +dest_files=["res://.godot/imported/80bpm_metronome.ogg-01fbd8eafec323cab783e93ca397fd9a.oggvorbisstr"] + +[params] + +loop=true +loop_offset=0.0 +bpm=0.0 +beat_count=0 +bar_beats=4 diff --git a/game/src/ui/setup/rhythm/rhythm_setup_menu.gd b/game/src/ui/setup/rhythm/rhythm_setup_menu.gd index 6d174e5..cf5098a 100644 --- a/game/src/ui/setup/rhythm/rhythm_setup_menu.gd +++ b/game/src/ui/setup/rhythm/rhythm_setup_menu.gd @@ -21,6 +21,9 @@ var _previous_bar_phase: float = 0.0 @onready var rhythm_beat: AudioStreamPlayer = %RhythmBeat @onready var confirm_button: Button = %Confirm +@onready var beat_rumble: RumbleComponent = %BeatRumble +@onready var bar_rumble: RumbleComponent = %BarRumble + func _ready() -> void: user_offset_slider.value_changed.connect(_on_user_offset_slider_value_changed) @@ -32,14 +35,25 @@ func close() -> void: confirmed.emit() +func disable_controls() -> void: + user_offset_slider.editable = false + confirm_button.disabled = true + + func fade_out_and_stop_setup(duration: float) -> void: + disable_controls() + var tween: Tween = create_tween() tween.tween_property(rhythm_beat, ^"volume_linear", 0.0, duration) + tween.parallel().tween_property(beat_rumble.data, ^"intensity", 0.0, duration) + tween.parallel().tween_property(bar_rumble.data, ^"intensity", 0.0, duration) tween.tween_callback(stop_setup) await tween.finished func stop_setup() -> void: + disable_controls() + rhythm_player.stop() _restore_song_playback_data() process_mode = Node.PROCESS_MODE_DISABLED diff --git a/game/src/ui/setup/rhythm/rhythm_setup_menu.tscn b/game/src/ui/setup/rhythm/rhythm_setup_menu.tscn index 20bdb63..03f14ac 100644 --- a/game/src/ui/setup/rhythm/rhythm_setup_menu.tscn +++ b/game/src/ui/setup/rhythm/rhythm_setup_menu.tscn @@ -3,13 +3,13 @@ [ext_resource type="Script" uid="uid://bvs4uvpewolwc" path="res://src/ui/setup/rhythm/rhythm_setup_menu.gd" id="1_la56f"] [ext_resource type="Script" uid="uid://bfpr421kg4s" path="res://src/ui/settings_menu/slider_label.gd" id="2_0yond"] [ext_resource type="Script" uid="uid://bdi06itcm6wfp" path="res://src/core/rhythm/rhythm_player.gd" id="2_jsobq"] -[ext_resource type="AudioStream" uid="uid://cwpx80o5yaauf" path="res://src/ui/setup/rhythm/120bpm_beat.ogg" id="2_uupbh"] [ext_resource type="Script" uid="uid://bbwtct3hoxwws" path="res://src/core/controller_rumble/rumble_component.gd" id="2_yr7ls"] [ext_resource type="Script" uid="uid://co7j2qtqpud6b" path="res://src/core/rhythm/rhythm_listener.gd" id="3_o47te"] [ext_resource type="Script" uid="uid://dwwingj0dsxdg" path="res://src/core/controller_rumble/rumble_config.gd" id="3_xnyx0"] [ext_resource type="Script" uid="uid://c5mqtmsvgt4e8" path="res://src/core/rhythm/song_info.gd" id="4_7a0hf"] [ext_resource type="Script" uid="uid://cx1nws4t8hs2u" path="res://src/core/rhythm/tempo_section_info.gd" id="5_cribi"] [ext_resource type="Texture2D" uid="uid://t6ydwif1bo1c" path="res://godot_icon.svg" id="6_cribi"] +[ext_resource type="AudioStream" uid="uid://ba8numb2iktfh" path="res://src/ui/setup/rhythm/80bpm_metronome.ogg" id="6_xnyx0"] [ext_resource type="Script" uid="uid://bvmfdeypbeqsn" path="res://src/core/rhythm/rhythm_property_setter.gd" id="7_0yond"] [sub_resource type="Resource" id="Resource_ej02t"] @@ -24,7 +24,8 @@ strong_intensity = 0.5 [sub_resource type="Resource" id="Resource_0yond"] script = ExtResource("4_7a0hf") -audio_stream = ExtResource("2_uupbh") +audio_stream = ExtResource("6_xnyx0") +bpm = 80.0 metadata/_custom_type_script = "uid://c5mqtmsvgt4e8" [node name="RhythmSetupMenu" type="Control" unique_id=552044082] @@ -39,6 +40,7 @@ script = ExtResource("1_la56f") metadata/_custom_type_script = "uid://bvs4uvpewolwc" [node name="BeatRumble" type="Node" parent="." unique_id=1560105761] +unique_name_in_owner = true script = ExtResource("2_yr7ls") data = SubResource("Resource_ej02t") weak_magnitude = 0.5 @@ -46,6 +48,7 @@ strong_magnitude = 0.0 metadata/_custom_type_script = "uid://bbwtct3hoxwws" [node name="BarRumble" type="Node" parent="." unique_id=1199048244] +unique_name_in_owner = true script = ExtResource("2_yr7ls") data = SubResource("Resource_sp7no") weak_magnitude = 0.9 @@ -64,7 +67,6 @@ metadata/_custom_type_script = "uid://bdi06itcm6wfp" [node name="RhythmBeat" type="AudioStreamPlayer" parent="RhythmPlayer" unique_id=763640763] unique_name_in_owner = true -stream = ExtResource("2_uupbh") [node name="UserOffsetSlider" type="HSlider" parent="." unique_id=1070556103] unique_name_in_owner = true @@ -174,7 +176,8 @@ anchors_preset = 10 anchor_right = 1.0 offset_bottom = 23.0 grow_horizontal = 2 -text = "Adjust the slider so that everything syncs up with the beat." +text = "Adjust the slider so that everything syncs up with the beat. +(This will affect gameplay)" horizontal_alignment = 1 [connection signal="bar_ticked" from="RhythmListener" to="BarRumble" method="vibrate" flags=3 unbinds=1] diff --git a/game/src/worlds/exposition/exposition.tscn b/game/src/worlds/exposition/exposition.tscn index 1ad1ff0..0a74ba5 100644 --- a/game/src/worlds/exposition/exposition.tscn +++ b/game/src/worlds/exposition/exposition.tscn @@ -578,7 +578,6 @@ _data = [Vector2(-0.099999994, -1), 0.0, 1.75, 0, 0, Vector2(0.1, -1), -1.75, 1. point_count = 6 [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_7y7p6"] -load_path = "res://.godot/imported/scratch.png-e93cbee00757bfbec04c028cf522898f.ctex" [sub_resource type="AtlasTexture" id="AtlasTexture_bmjgb"] atlas = SubResource("CompressedTexture2D_7y7p6")