feat: major transitioning overhaul
This commit is contained in:
parent
517b1812ec
commit
6be6d6774a
|
|
@ -11,6 +11,8 @@ func start_room():
|
||||||
%UI.show()
|
%UI.show()
|
||||||
$logic/PlayerController.process_mode = Node.PROCESS_MODE_INHERIT
|
$logic/PlayerController.process_mode = Node.PROCESS_MODE_INHERIT
|
||||||
|
|
||||||
|
await Main.curtain.open()
|
||||||
|
|
||||||
if not Scenes.is_sequence_repeating(Scenes.id.YOUTH_DRAVEN):
|
if not Scenes.is_sequence_repeating(Scenes.id.YOUTH_DRAVEN):
|
||||||
# Play intro scene directly (not triggered by CollectableUi)
|
# Play intro scene directly (not triggered by CollectableUi)
|
||||||
await _play_intro_scene()
|
await _play_intro_scene()
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,15 @@ func add_note(note: StickyNote) -> void:
|
||||||
notes.append(note)
|
notes.append(note)
|
||||||
note.is_dragable = true
|
note.is_dragable = true
|
||||||
|
|
||||||
|
func appear():
|
||||||
|
await Main.curtain.close()
|
||||||
|
show()
|
||||||
|
await Main.curtain.open()
|
||||||
|
|
||||||
|
func vanish():
|
||||||
|
await Main.curtain.close()
|
||||||
|
hide()
|
||||||
|
await Main.curtain.open()
|
||||||
|
|
||||||
# Checks if a Node is currently inside the dropzone
|
# Checks if a Node is currently inside the dropzone
|
||||||
func is_in_dropzone(to_check: Draggable) -> bool:
|
func is_in_dropzone(to_check: Draggable) -> bool:
|
||||||
|
|
|
||||||
|
|
@ -147,8 +147,8 @@ _data = {
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="board" type="PanelContainer"]
|
[node name="board" type="PanelContainer"]
|
||||||
|
show_behind_parent = true
|
||||||
material = SubResource("ShaderMaterial_ttqei")
|
material = SubResource("ShaderMaterial_ttqei")
|
||||||
clip_contents = true
|
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
|
|
||||||
|
|
@ -37,14 +37,13 @@ func play() -> void:
|
||||||
# 3. Populate the 4 anchor slots with random cards
|
# 3. Populate the 4 anchor slots with random cards
|
||||||
for ancor: Control in ancors:
|
for ancor: Control in ancors:
|
||||||
var card: Card = stack.pop_front()
|
var card: Card = stack.pop_front()
|
||||||
|
assert(card, "Not enough cards collected.")
|
||||||
cards.append(card)
|
cards.append(card)
|
||||||
ancor.add_child(card)
|
ancor.add_child(card)
|
||||||
print_debug("CardBurner: Added card '%s' to anchor" % card.name)
|
print_debug("CardBurner: Added card '%s' to anchor" % card.name)
|
||||||
|
|
||||||
print("CardBurner: ", len(cards))
|
print("CardBurner: ", len(cards))
|
||||||
|
|
||||||
await appear()
|
|
||||||
|
|
||||||
# 4. Wait for player to burn a card (or skip)
|
# 4. Wait for player to burn a card (or skip)
|
||||||
print_debug("CardBurner: Waiting for player to burn a card...")
|
print_debug("CardBurner: Waiting for player to burn a card...")
|
||||||
handle_direction_input(Vector2.UP)
|
handle_direction_input(Vector2.UP)
|
||||||
|
|
|
||||||
|
|
@ -90,14 +90,22 @@ grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
script = ExtResource("1_copuj")
|
script = ExtResource("1_copuj")
|
||||||
|
|
||||||
[node name="ColorRect" type="ColorRect" parent="."]
|
|
||||||
custom_minimum_size = Vector2(8192, 8192)
|
|
||||||
layout_mode = 2
|
|
||||||
color = Color(0, 0, 0, 0.5019608)
|
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="."]
|
[node name="Control" type="Control" parent="."]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="ColorRect" type="ColorRect" parent="Control"]
|
||||||
|
show_behind_parent = true
|
||||||
|
custom_minimum_size = Vector2(8192, 8192)
|
||||||
|
layout_mode = 0
|
||||||
|
offset_left = -4096.0
|
||||||
|
offset_top = -4096.0
|
||||||
|
offset_right = 4096.0
|
||||||
|
offset_bottom = 4096.0
|
||||||
|
grow_horizontal = 2
|
||||||
|
grow_vertical = 2
|
||||||
|
mouse_filter = 2
|
||||||
|
color = Color(0, 0, 0, 0.6745098)
|
||||||
|
|
||||||
[node name="Label" type="Label" parent="Control"]
|
[node name="Label" type="Label" parent="Control"]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
anchors_preset = 7
|
anchors_preset = 7
|
||||||
|
|
|
||||||
|
|
@ -101,9 +101,10 @@ func _input(event: InputEvent) -> void:
|
||||||
func play_story() -> void:
|
func play_story() -> void:
|
||||||
# Check if this is a repeat playthrough
|
# Check if this is a repeat playthrough
|
||||||
var repeat := collected
|
var repeat := collected
|
||||||
|
|
||||||
collected = true
|
collected = true
|
||||||
|
|
||||||
canvas_layer.show()
|
canvas_layer.show()
|
||||||
|
await playable.appear()
|
||||||
|
|
||||||
# Allow room to prepare for scene (e.g., play animations)
|
# Allow room to prepare for scene (e.g., play animations)
|
||||||
await State.room.prepare_scene_start(playable.scene_id, repeat)
|
await State.room.prepare_scene_start(playable.scene_id, repeat)
|
||||||
|
|
@ -111,7 +112,6 @@ func play_story() -> void:
|
||||||
Scenes.begin_sequence(playable.scene_id)
|
Scenes.begin_sequence(playable.scene_id)
|
||||||
|
|
||||||
# Play the story
|
# Play the story
|
||||||
await playable.appear()
|
|
||||||
await playable.play()
|
await playable.play()
|
||||||
|
|
||||||
# Pick the cards if not already picked
|
# Pick the cards if not already picked
|
||||||
|
|
@ -131,11 +131,12 @@ func play_story() -> void:
|
||||||
|
|
||||||
func play_board() -> void:
|
func play_board() -> void:
|
||||||
canvas_layer.show()
|
canvas_layer.show()
|
||||||
|
await playable.appear()
|
||||||
|
|
||||||
# Play the board (handles mouse visibility and waits for close)
|
# Play the board (handles mouse visibility and waits for close)
|
||||||
await playable.play()
|
await playable.play()
|
||||||
|
|
||||||
# Hide the CanvasLayer when done
|
await playable.vanish()
|
||||||
canvas_layer.hide()
|
canvas_layer.hide()
|
||||||
|
|
||||||
Scenes.player_enable.emit(true)
|
Scenes.player_enable.emit(true)
|
||||||
|
|
@ -144,18 +145,18 @@ func play_board() -> void:
|
||||||
|
|
||||||
func play_burner() -> void:
|
func play_burner() -> void:
|
||||||
canvas_layer.show()
|
canvas_layer.show()
|
||||||
|
await playable.appear()
|
||||||
|
|
||||||
# Play the board (handles mouse visibility and waits for close)
|
# Play the burner mini-game, will actually send us to the next map
|
||||||
await playable.play()
|
await playable.play()
|
||||||
|
|
||||||
# Hide the CanvasLayer when done
|
await playable.vanish()
|
||||||
canvas_layer.hide()
|
canvas_layer.hide()
|
||||||
|
|
||||||
|
|
||||||
func interact() -> void:
|
func interact() -> void:
|
||||||
Scenes.player_enable.emit(false)
|
Scenes.player_enable.emit(false)
|
||||||
await collapse()
|
await collapse()
|
||||||
collected = true
|
|
||||||
|
|
||||||
# collapse other interactables BEFORE showing canvas
|
# collapse other interactables BEFORE showing canvas
|
||||||
get_tree().call_group("interactables", "collapse")
|
get_tree().call_group("interactables", "collapse")
|
||||||
|
|
|
||||||
|
|
@ -13,15 +13,17 @@ func handle_hover(_area: Draggable):
|
||||||
#prints("Playable[base].handle_hover", _area, _area.name)
|
#prints("Playable[base].handle_hover", _area, _area.name)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
const TRANSPARENT_BLACK := Color(0,0,0,0)
|
||||||
|
|
||||||
func appear():
|
func appear():
|
||||||
self.modulate = Color.TRANSPARENT
|
self.modulate = TRANSPARENT_BLACK
|
||||||
show()
|
show()
|
||||||
var tween := create_tween().set_ease(Tween.EASE_IN)
|
var tween := create_tween().set_ease(Tween.EASE_IN)
|
||||||
tween.tween_property(self, "modulate", Color.WHITE, 1.5)
|
tween.tween_property(self, "modulate", Color.WHITE, 0.3)
|
||||||
await tween.finished
|
await tween.finished
|
||||||
|
|
||||||
func vanish():
|
func vanish():
|
||||||
var tween := create_tween().set_ease(Tween.EASE_OUT)
|
var tween := create_tween().set_ease(Tween.EASE_OUT)
|
||||||
tween.tween_property(self, "modulate", Color.TRANSPARENT, 1.5)
|
tween.tween_property(self, "modulate", TRANSPARENT_BLACK, 0.3)
|
||||||
await tween.finished
|
await tween.finished
|
||||||
hide()
|
hide()
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ var app_state: AppState = AppState.BOOT:
|
||||||
credits_roll.hide()
|
credits_roll.hide()
|
||||||
main_menu.hide()
|
main_menu.hide()
|
||||||
pause_menu.hide()
|
pause_menu.hide()
|
||||||
curtain.hide()
|
|
||||||
AppState.PAUSE:
|
AppState.PAUSE:
|
||||||
credits_roll.hide()
|
credits_roll.hide()
|
||||||
main_menu.hide()
|
main_menu.hide()
|
||||||
|
|
@ -76,7 +75,7 @@ func start_game(save: SaveGame) -> void:
|
||||||
await State.room.play()
|
await State.room.play()
|
||||||
|
|
||||||
func _load_room(next_path: String) -> bool:
|
func _load_room(next_path: String) -> bool:
|
||||||
await curtain.show()
|
await curtain.close()
|
||||||
%Loading.play()
|
%Loading.play()
|
||||||
|
|
||||||
if State.room != null:
|
if State.room != null:
|
||||||
|
|
@ -95,7 +94,6 @@ func _load_room(next_path: String) -> bool:
|
||||||
await get_tree().process_frame
|
await get_tree().process_frame
|
||||||
await State.room.get_ready()
|
await State.room.get_ready()
|
||||||
%Loading.stop()
|
%Loading.stop()
|
||||||
await curtain.hide()
|
|
||||||
return true
|
return true
|
||||||
ResourceLoader.THREAD_LOAD_FAILED:
|
ResourceLoader.THREAD_LOAD_FAILED:
|
||||||
push_error("Failed to load room.")
|
push_error("Failed to load room.")
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ offset_bottom = 0.0
|
||||||
[node name="MainMenu" parent="." instance=ExtResource("3_ik73t")]
|
[node name="MainMenu" parent="." instance=ExtResource("3_ik73t")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
|
z_index = 10
|
||||||
|
|
||||||
[node name="FPSLabel" type="Label" parent="."]
|
[node name="FPSLabel" type="Label" parent="."]
|
||||||
visible = false
|
visible = false
|
||||||
|
|
|
||||||
|
|
@ -5,22 +5,22 @@ var _tween : Tween = null
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
print_debug("curtain.gd: ready()")
|
print_debug("curtain.gd: ready()")
|
||||||
show()
|
visible = true
|
||||||
|
|
||||||
func show() -> void:
|
## Conceals the Game Stage
|
||||||
|
func close() -> void:
|
||||||
visible = true
|
visible = true
|
||||||
print_debug("curtain.gd: show()")
|
print_debug("curtain.gd: show()")
|
||||||
if _tween != null:
|
if _tween: _tween.kill()
|
||||||
_tween.kill()
|
|
||||||
_tween = create_tween()
|
_tween = create_tween()
|
||||||
_tween.tween_property(self, "modulate:a", 1.0, 1.0)
|
_tween.tween_property(self, "modulate:a", 1.0, 0.7)
|
||||||
await _tween.finished
|
await _tween.finished
|
||||||
|
|
||||||
func hide() -> void:
|
## Makes the Game Stage Visible
|
||||||
|
func open() -> void:
|
||||||
print_debug("curtain.gd: hide()")
|
print_debug("curtain.gd: hide()")
|
||||||
if _tween != null:
|
if _tween: _tween.kill()
|
||||||
_tween.kill()
|
|
||||||
_tween = create_tween()
|
_tween = create_tween()
|
||||||
_tween.tween_property(self, "modulate:a", 0.0, 1.0)
|
_tween.tween_property(self, "modulate:a", 0.0, 0.7)
|
||||||
await _tween.finished
|
await _tween.finished
|
||||||
visible = false
|
visible = false
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
[ext_resource type="Script" uid="uid://cg7sc173lvchp" path="res://ui/curtain/curtain.gd" id="1_8qa50"]
|
[ext_resource type="Script" uid="uid://cg7sc173lvchp" path="res://ui/curtain/curtain.gd" id="1_8qa50"]
|
||||||
|
|
||||||
[node name="Curtain" type="Panel"]
|
[node name="Curtain" type="Panel"]
|
||||||
|
z_index = -10
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ _data = {
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Loading" type="Control"]
|
[node name="Loading" type="Control"]
|
||||||
|
z_index = -5
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 2
|
anchors_preset = 2
|
||||||
anchor_top = 1.0
|
anchor_top = 1.0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue