This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
ld50/assets/Robot.gd

26 lines
763 B
GDScript

extends Spatial
onready var anim: AnimationNodeStateMachinePlayback = $AnimationTree["parameters/playback"]
var robotworking_sound
var robotpoweron_sound
func _ready() -> void:
# Sound.play("Robot", self)
robotworking_sound = Sound.instance("RobotWorking").attach(self)
Sound.instance("RobotPowerOn").attach(self).start()
# robotpoweron_sound = Sound.instance("RobotPowerOn").attach(self).start()
pass
func start_working() -> void:
anim.travel("robotWorking")
robotworking_sound.start()
func stop_working() -> void:
anim.travel("robotDeactivate")
robotworking_sound.stop()
Sound.instance("RobotPowerOff").attach(self).start()
# Sound.instance("Robot").attach(self).start()
# Every instance of the Robot event triggers one of the three drill sounds