21 lines
528 B
GDScript3
21 lines
528 B
GDScript3
|
extends CanvasLayer
|
||
|
|
||
|
@warning_ignore("unused_signal")
|
||
|
signal exit(arg)
|
||
|
|
||
|
@onready var wheel = $Wheel as Wheel2D
|
||
|
@onready var wheel_sfx = $"Sfx转盘齿轮"
|
||
|
@onready var wheel_sprite = $"转盘" as AnimatedSprite2D
|
||
|
|
||
|
func _ready() -> void:
|
||
|
layer = GlobalConfig.CANVAS_LAYER_LITTLE_GAME
|
||
|
wheel.rotated.connect(_on_wheel_rotated)
|
||
|
|
||
|
var rotationg_steps := 0
|
||
|
|
||
|
func _on_wheel_rotated(_radiant: float) -> void:
|
||
|
if not wheel_sfx.playing:
|
||
|
wheel_sfx.play()
|
||
|
rotationg_steps += 1
|
||
|
wheel_sprite.frame = wrapi(wheel_sprite.frame + 1, 0, 3)
|