forked from team-sg/hero-mark-2
added sound test
This commit is contained in:
parent
79667b593c
commit
f14e8ebdd0
21 changed files with 734 additions and 2 deletions
20
menus/sound_select.gd
Normal file
20
menus/sound_select.gd
Normal file
|
@ -0,0 +1,20 @@
|
|||
extends TextureButton
|
||||
|
||||
export (Array, String) var titles
|
||||
export (Array, AudioStream) var sounds
|
||||
var current_selection = 0
|
||||
onready var body = $SoundLabel/Label
|
||||
|
||||
func _gui_input(event):
|
||||
if Input.is_action_just_pressed("ui_left"):
|
||||
current_selection -= 1
|
||||
if Input.is_action_just_pressed("ui_right"):
|
||||
current_selection += 1
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
Audio.play_sound(sounds[current_selection],Audio.ac_collectible)
|
||||
if Input.is_action_just_pressed("ui_cancel"):
|
||||
Audio.ac_music.stop()
|
||||
current_selection = posmod(current_selection,sounds.size())
|
||||
body.text = titles[current_selection]
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue