poursuite de la finition de l'introduction
This commit is contained in:
+21
-17
@@ -19,6 +19,8 @@ func _ready() -> void:
|
||||
add_child(bedroom)
|
||||
add_child(text_screens)
|
||||
|
||||
|
||||
|
||||
#Naming Scenes
|
||||
title_screen.name = "TitleScreen"
|
||||
office.name = "Office"
|
||||
@@ -30,11 +32,7 @@ func _ready() -> void:
|
||||
office.hide()
|
||||
bedroom.hide()
|
||||
|
||||
#Hiding Text_Screens
|
||||
text_screens.hide()
|
||||
for scene in $TextScreens/MarginContainer.get_children():
|
||||
scene.hide()
|
||||
$TextScreens/SkipContainer.hide()
|
||||
#Showing TitleScreen
|
||||
title_screen.show()
|
||||
|
||||
#Connecting Signals
|
||||
@@ -53,23 +51,29 @@ func _process(delta: float) -> void:
|
||||
|
||||
# Starts a new game
|
||||
func _on_new_game_pressed():
|
||||
transition([$TitleScreen], [$TextScreens, $TextScreens/MarginContainer/TextIntro1, $TextScreens/SkipContainer])
|
||||
await $TextScreens.slide_finished
|
||||
transition([$TextScreens/MarginContainer/TextIntro1], [$TextScreens/MarginContainer/TextIntro2])
|
||||
await $TextScreens.slide_finished
|
||||
transition([$TextScreens/MarginContainer/TextIntro2], [$TextScreens/MarginContainer/TextIntro3])
|
||||
await $TextScreens.slide_finished
|
||||
transition([$TextScreens/MarginContainer/TextIntro3], [$TextScreens/MarginContainer/TextIntro4])
|
||||
await $TextScreens.slide_finished
|
||||
transition([$TextScreens/MarginContainer/TextIntro4], [$TextScreens/MarginContainer/TextIntro5])
|
||||
|
||||
var text_container = $TextScreens/MarginContainer/IntroBoxContainer/TextContainer
|
||||
|
||||
transition("big", [$TitleScreen], [$TextScreens, text_container.get_child(0)])
|
||||
await $TextScreens.on_transition_finished
|
||||
|
||||
for i in 4:
|
||||
transition("small", [text_container.get_child(i)], [text_container.get_child(i+1)])
|
||||
await $TextScreens.on_transition_finished
|
||||
|
||||
|
||||
|
||||
# Takes care of fading transitions between scenes
|
||||
func transition(scenes_to_hide, scenes_to_show):
|
||||
TransitionScreen.transition()
|
||||
await TransitionScreen.on_transition_finished
|
||||
func transition(size, scenes_to_hide, scenes_to_show):
|
||||
|
||||
TransitionScreen.transition(size)
|
||||
|
||||
await TransitionScreen.on_fading_finished
|
||||
|
||||
for scene in scenes_to_hide:
|
||||
scene.hide()
|
||||
for scene in scenes_to_show:
|
||||
scene.show()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user