Gameplay Loop début
This commit is contained in:
+17
-14
@@ -36,8 +36,6 @@ func _ready() -> void:
|
||||
|
||||
#Showing TitleScreen
|
||||
title_screen.show()
|
||||
#UI.show()
|
||||
#UI.get_node("UI/SkipContainer").show()
|
||||
|
||||
#Connecting Signals
|
||||
title_screen.connect("new_game_pressed", _on_new_game_pressed)
|
||||
@@ -55,33 +53,37 @@ func _process(delta: float) -> void:
|
||||
# Starts a new game
|
||||
func _on_new_game_pressed():
|
||||
|
||||
var choice_dialog = UI.get_node("UI/ConfirmationDialog")
|
||||
|
||||
choice_dialog.set_ok_button_text("Yes")
|
||||
choice_dialog.set_cancel_button_text("No")
|
||||
choice_dialog.get_label().text = ("Do you wish to skip the introduction ?")
|
||||
|
||||
UI.get_node("UI/ConfirmationDialog").show()
|
||||
|
||||
choice_dialog.get_ok_button().pressed.connect(skip_intro, CONNECT_ONE_SHOT)
|
||||
choice_dialog.get_cancel_button().pressed.connect(play_intro, CONNECT_ONE_SHOT)
|
||||
#Offering to skip Introduction
|
||||
UI.confirmation_text.text = "[center]Do you wish to skip the introduction ?[/center]"
|
||||
UI.confirmation_yes.pressed.connect(skip_intro, CONNECT_ONE_SHOT)
|
||||
UI.confirmation_no.pressed.connect(play_intro, CONNECT_ONE_SHOT)
|
||||
UI.confirmation_dialog.show()
|
||||
TransitionScreen.mask.visible = true
|
||||
|
||||
|
||||
#Skips the introduction
|
||||
func skip_intro():
|
||||
|
||||
#Disconnecting the other Signal from the Confirmation Dialogue
|
||||
UI.confirmation_no.disconnect("pressed", play_intro)
|
||||
|
||||
#Transitioning to Screening Desk
|
||||
TransitionScreen.transition("big", [$TitleScreen], [$ScreeningDesk, UI, UI.get_node("UI/UpperContainer")])
|
||||
await TransitionScreen.transition_finished
|
||||
|
||||
#Launching the gameplay loop
|
||||
$ScreeningDesk.gameplay_loop("564")
|
||||
|
||||
|
||||
#Plays the entire introduction
|
||||
func play_intro():
|
||||
|
||||
#Disconnecting the other Signal from the Confirmation Dialogue
|
||||
UI.confirmation_yes.disconnect("pressed", skip_intro)
|
||||
|
||||
#Introduction First slides
|
||||
var text_container = $TextScreens/MarginContainer/IntroBoxContainer/TextContainer
|
||||
|
||||
#Introduction first slides
|
||||
TransitionScreen.transition("big", [$TitleScreen], [$TextScreens, text_container.get_child(0), UI, UI.get_node("UI/SkipContainer")])
|
||||
await UI.next_slide
|
||||
|
||||
@@ -96,10 +98,11 @@ func play_intro():
|
||||
DialogueManager.show_dialogue_balloon(dialogue_intro, "start")
|
||||
await DialogueManager.dialogue_ended
|
||||
|
||||
#Transition to the Screening Desk
|
||||
#Transitioning to the Screening Desk
|
||||
TransitionScreen.transition("big", [$DialogueScreens], [$ScreeningDesk, UI, UI.get_node("UI/UpperContainer")])
|
||||
await TransitionScreen.transition_finished
|
||||
|
||||
#Launching the gameplay loop
|
||||
$ScreeningDesk.gameplay_loop("564")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user