add make another choice once played

This commit is contained in:
Alice Gaudon 2020-08-20 17:45:40 +02:00
parent 021a99fcd5
commit 41e9c5a685
5 changed files with 44 additions and 22 deletions

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=3 format=2]
[ext_resource path="res://images/Credits.png" type="Texture" id=1]
[ext_resource path="res://scripts/credits.gd" type="Script" id=2]
[node name="Node2D" type="Node2D"]
script = ExtResource( 2 )
[node name="Sprite" type="Sprite" parent="."]
texture = ExtResource( 1 )

View File

@ -38,29 +38,27 @@ script = ExtResource( 1 )
start_delay = 4.0
[node name="UI" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
margin_right = 192.0
margin_bottom = 108.0
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Buttons" type="Control" parent="UI"]
margin_right = 40.0
margin_bottom = 40.0
[node name="Buttons" type="VBoxContainer" parent="UI"]
margin_left = 74.0
margin_top = 19.0
margin_right = 192.0
margin_bottom = 74.0
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PlayButton" type="Button" parent="UI/Buttons"]
anchor_left = 3.875
anchor_top = 1.35
anchor_right = 3.875
anchor_bottom = 1.35
margin_left = -13.3871
margin_top = -17.551
margin_right = 30.6129
margin_bottom = 2.449
margin_top = 23.0
margin_right = 118.0
margin_bottom = 37.0
custom_styles/focus = SubResource( 1 )
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 )
@ -74,14 +72,9 @@ __meta__ = {
scene_to_load = "res://scenes/campfire.tscn"
[node name="QuitButton" type="Button" parent="UI/Buttons"]
anchor_left = 3.875
anchor_top = 1.35
anchor_right = 3.875
anchor_bottom = 1.35
margin_left = -13.3871
margin_top = 2.449
margin_right = 30.6129
margin_bottom = 22.449
margin_top = 41.0
margin_right = 118.0
margin_bottom = 55.0
custom_styles/focus = SubResource( 2 )
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 )
@ -92,5 +85,22 @@ script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AnotherChoiceButton" type="Button" parent="UI/Buttons"]
visible = false
margin_top = 41.0
margin_right = 118.0
margin_bottom = 55.0
custom_styles/focus = SubResource( 2 )
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 )
custom_colors/font_color_hover = Color( 1, 1, 1, 1 )
text = "Make another choice"
flat = true
script = ExtResource( 3 )
__meta__ = {
"_editor_description_": ""
}
scene_to_load = "res://scenes/campfire2.tscn"
[connection signal="animation_finished" from="ely" to="ely" method="_on_background_animation_finished"]
[connection signal="animation_finished" from="fire" to="fire" method="_on_background_animation_finished"]

View File

@ -2,3 +2,4 @@ extends Node
var ui_accept_tip = false
var ui_interact_flatfish_tip = false
var did_already_play_once = false

7
scripts/credits.gd Normal file
View File

@ -0,0 +1,7 @@
extends Node2D
func _input(event):
if event.is_action_pressed("ui_accept"):
Globals.did_already_play_once = true
get_tree().change_scene("res://scenes/main_menu.tscn")

View File

@ -4,3 +4,5 @@ onready var music_player = get_node('/root/MusicPlayer') as MusicPlayer
func _ready():
music_player.play('main_title')
if Globals.did_already_play_once:
$UI/Buttons/AnotherChoiceButton.show()