extends Control var nodes var upmenuopened = false; # Called when the node enters the scene tree for the first time. func _ready() -> void: nodes = [ self.get_node("Easy"), self.get_node("Normal"), self.get_node("Hard"), self.get_node("Lunatic") ] #(self.get_node("AnimationPlayer") as AnimationPlayer).speed_scale=99 (self.get_node("AnimationPlayer") as AnimationPlayer).play("new_animation") # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta: float) -> void: if(upmenuopened==false): if(Input.is_action_just_pressed("ui_accept")): MusicController.playSE(MusicController.SEs.ok) for i in nodes : if(i.get_meta("selected") == true ): upmenuopened = true ; i.ok() if(Input.is_action_just_pressed("ui_cancel")): get_tree().current_scene.get_node("TitleMenuGroup").get_node("Menu").get_node("Start").submenuopened = false MusicController.playSE(MusicController.SEs.cancel) (self.get_node("AnimationPlayer") as AnimationPlayer).play_backwards("new_animation") await get_tree().create_timer(0.25).timeout self.queue_free() (get_tree().get_root().get_node("Mainmenu").get_node("TitleMenuGroup").get_node("AnimationPlayer") as AnimationPlayer).play_backwards("new_animation_2") if(Input.is_action_just_pressed("ui_up")): MusicController.playSE(MusicController.SEs.select) for i in range(0, nodes.size()) : if((nodes[i] as Sprite2D).get_meta("selected") == true): (nodes[i] as Sprite2D).set_meta("selected", false) (nodes[i-1] as Sprite2D).set_meta("selected", true) break if(Input.is_action_just_pressed("ui_down")): MusicController.playSE(MusicController.SEs.select) for i in nodes.size(): if((nodes[i] as Sprite2D).get_meta("selected") == true): (nodes[i] as Sprite2D).set_meta("selected", false) if(i+1 >= nodes.size()): (nodes[0] as Sprite2D).set_meta("selected", true) break else: (nodes[i+1] as Sprite2D).set_meta("selected", true) break