-
Notifications
You must be signed in to change notification settings - Fork 2
/
StartMenu.gd
36 lines (24 loc) · 907 Bytes
/
StartMenu.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
29
30
31
32
33
34
35
36
extends Control
signal next_level
signal play_music(path)
var current_x = 0
# Called when the node enters the scene tree for the first time.
func _ready():
emit_signal("play_music", "assets/music/StartMenu.ogg")
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
var rot_speed = 0.1
current_x = current_x + 0.01
$StationSmall.rotation = $StationSmall.rotation + rot_speed * delta
$StationSmall.translate(Vector2(0, 0.1*sin(current_x)))
func _on_StartButton_pressed():
$InitialScene.play("start_game")
func _on_InitialScene_animation_finished(anim_name):
emit_signal("play_music", "assets/music/Initial.ogg")
emit_signal("next_level")
func _on_Credit_pressed():
$MainMenu.visible = false
$CreditMenu.visible = true
func _on_Back_pressed():
$MainMenu.visible = true
$CreditMenu.visible = false