Title screen background now fades when loading game
This commit is contained in:
parent
e18abd8bef
commit
1d0e362d54
2 changed files with 30 additions and 14 deletions
|
|
@ -50,7 +50,7 @@ volume_db = -4.0
|
||||||
autoplay = true
|
autoplay = true
|
||||||
parameters/looping = true
|
parameters/looping = true
|
||||||
|
|
||||||
[node name="GPUParticles2D" type="GPUParticles2D" parent="."]
|
[node name="Stars" type="GPUParticles2D" parent="."]
|
||||||
position = Vector2(-1420, 0)
|
position = Vector2(-1420, 0)
|
||||||
amount = 512
|
amount = 512
|
||||||
texture = ExtResource("2_4rr2b")
|
texture = ExtResource("2_4rr2b")
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,9 @@ func _on_new_game_pressed() -> void:
|
||||||
transitioning = true
|
transitioning = true
|
||||||
|
|
||||||
get_viewport().gui_release_focus()
|
get_viewport().gui_release_focus()
|
||||||
|
|
||||||
|
|
||||||
|
if FileAccess.file_exists("user://savegame.save"):
|
||||||
var i = 0
|
var i = 0
|
||||||
|
|
||||||
while i < 6:
|
while i < 6:
|
||||||
|
|
@ -227,7 +230,6 @@ func _on_new_game_pressed() -> void:
|
||||||
|
|
||||||
$UI/Control/Title.visible = false
|
$UI/Control/Title.visible = false
|
||||||
|
|
||||||
if FileAccess.file_exists("user://savegame.save"):
|
|
||||||
$UI/Control/OverrideSave.visible = true
|
$UI/Control/OverrideSave.visible = true
|
||||||
|
|
||||||
$UI/Control/OverrideSave.modulate.a = 0
|
$UI/Control/OverrideSave.modulate.a = 0
|
||||||
|
|
@ -246,6 +248,18 @@ func _on_new_game_pressed() -> void:
|
||||||
transitioning = false
|
transitioning = false
|
||||||
|
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
var i = 0
|
||||||
|
|
||||||
|
while i < 6:
|
||||||
|
$UI/Control/Title.modulate.a -= 0.2
|
||||||
|
$Stars.modulate.a -= 0.2
|
||||||
|
|
||||||
|
await get_tree().create_timer(0.2).timeout
|
||||||
|
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
$UI/Control/Title.visible = false
|
||||||
|
|
||||||
if global.stats.location == "space":
|
if global.stats.location == "space":
|
||||||
get_tree().change_scene_to_file("res://scenes/game.tscn")
|
get_tree().change_scene_to_file("res://scenes/game.tscn")
|
||||||
|
|
@ -264,6 +278,7 @@ func _on_load_game_pressed() -> void:
|
||||||
|
|
||||||
while i < 6:
|
while i < 6:
|
||||||
$UI/Control/Title.modulate.a -= 0.2
|
$UI/Control/Title.modulate.a -= 0.2
|
||||||
|
$Stars.modulate.a -= 0.2
|
||||||
|
|
||||||
await get_tree().create_timer(0.2).timeout
|
await get_tree().create_timer(0.2).timeout
|
||||||
|
|
||||||
|
|
@ -293,6 +308,7 @@ func _on_yes_override_pressed() -> void:
|
||||||
|
|
||||||
while i < 6:
|
while i < 6:
|
||||||
$UI/Control/OverrideSave.modulate.a -= 0.2
|
$UI/Control/OverrideSave.modulate.a -= 0.2
|
||||||
|
$Stars.modulate.a -= 0.2
|
||||||
|
|
||||||
await get_tree().create_timer(0.2).timeout
|
await get_tree().create_timer(0.2).timeout
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue