r3-next/backgounds/supernova.gd

36 lines
1,008 B
GDScript3
Raw Normal View History

2023-09-08 22:55:16 +02:00
extends Node2D
var crash := AudioStreamPlayer.new()
2023-09-12 18:23:48 +02:00
var wait
2023-09-08 22:55:16 +02:00
# Called when the node enters the scene tree for the first time.
func _ready():
2024-10-29 22:37:39 +01:00
#Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
2023-09-08 22:55:16 +02:00
add_child(crash)
2024-01-16 13:58:51 +01:00
var titlemusic = load(Global.sfxtracks[1])
2023-09-08 22:55:16 +02:00
crash.stream = titlemusic
crash.play(0)
2023-09-12 18:23:48 +02:00
wait = Time.get_ticks_msec()
2023-09-08 22:55:16 +02:00
#pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _input(event):
# Mouse in viewport coordinates.
2024-10-29 22:37:39 +01:00
if Input.is_action_just_pressed("ui_accept") || Input.is_action_just_pressed("mclick"):
2023-09-08 22:55:16 +02:00
#print("Mouse Click/Unclick at: ", event.position)
_title()
func _title():
# This is like autoloading the scene, only
# it happens after already loading the main scene.
2024-01-16 13:58:51 +01:00
if Global.debug:
2024-10-29 22:37:39 +01:00
get_tree().change_scene("res://levels/scene.tscn")
2024-01-16 13:58:51 +01:00
else:
2024-10-29 22:37:39 +01:00
get_tree().change_scene("res://title.tscn")
2023-09-08 22:55:16 +02:00
#get_tree().root.add_child(title)
#get_tree().root.remove_child(boot)
#boot.queue_free()