-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcredits.gd
28 lines (21 loc) · 904 Bytes
/
credits.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
extends Control
var game_size = DisplayServer.screen_get_size()
# Called when the node enters the scene tree for the first time.
func _ready():
$CreditsMusic.play()
$Background.size = game_size
$ColorRect.size = game_size
$Vinheta.size = game_size
$Transition/Black.size = game_size
$Logo.size = Vector2(game_size.x * 0.5, game_size.y * 0.1)
$Logo.position = Vector2(game_size.x/2 - $Logo.size.x/2, game_size.y + $Logo.size.y)
$CreditsText.size.x = game_size.x/2
$CreditsText.position = Vector2(game_size.x/2 - $CreditsText.size.x/2, game_size.y + ($Logo.size.y * 2))
$Transition.play("fade_in_credits")
await get_tree().create_timer(3.5).timeout
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
$Logo.position.y -= 2
$CreditsText.position.y -= 2
func _on_timer_timeout():
get_tree().change_scene_to_file("res://main_menu.tscn")