r3-next/levels/musictest.gd

103 lines
2 KiB
GDScript3
Raw Normal View History

2024-01-16 13:58:51 +01:00
extends Control
var player := AudioStreamPlayer.new()
func _ready():
2024-10-29 22:37:39 +01:00
#Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
2024-01-16 13:58:51 +01:00
add_child(player)
$"VBoxContainer/Title Screen".grab_focus()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
# Mouse in viewport coordinates.
if Input.is_action_just_pressed("ui_cancel"):
_on_back_pressed()
2024-10-29 22:37:39 +01:00
if Input.is_key_pressed(KEY_X) || Input.is_joy_button_pressed(0,JOY_XBOX_X):
2024-01-16 13:58:51 +01:00
player.stop()
#print("Mouse Click/Unclick at: ", event.position)
# if highlighted == 1:
# _on_debug_pressed()
# if highlighted == 2:
# _on_exit_pressed()
# else:
# _on_start_pressed()
# elif Input.is_action_pressed("ui_up"):
# focus_next
func _on_back_pressed():
2024-10-29 22:37:39 +01:00
get_tree().change_scene("res://levels/soundtest.tscn")
2024-01-16 13:58:51 +01:00
func _on_title_screen_pressed():
player.stream = load(Global.musictracks[0])
player.play(0)
func _on_galaxy_pressed():
player.stream = load(Global.musictracks[1])
player.play(0)
func _on_wormhole_pressed():
player.stream = load(Global.musictracks[2])
player.play(0)
func _on_abstract_pressed():
player.stream = load(Global.musictracks[3])
player.play(0)
func _on_galaxy_2_pressed():
player.stream = load(Global.musictracks[4])
player.play(0)
func _on_lagoon_pressed():
player.stream = load(Global.musictracks[5])
player.play(0)
func _on_orion_pressed():
player.stream = load(Global.musictracks[6])
player.play(0)
func _on_space_pressed():
player.stream = load(Global.musictracks[7])
player.play(0)
func _on_stars_pressed():
player.stream = load(Global.musictracks[8])
player.play(0)
func _on_universe_pressed():
player.stream = load(Global.musictracks[9])
player.play(0)
func _on_credits_1_pressed():
player.stream = load(Global.musictracks[10])
player.play(0)
func _on_credits_2_pressed():
player.stream = load(Global.musictracks[11])
player.play(0)
func _on_credits_3_pressed():
player.stream = load(Global.musictracks[12])
player.play(0)