2023-10-02 09:13:16 +00:00
|
|
|
#extends RigidBody2D
|
|
|
|
#
|
2023-10-02 13:50:25 +00:00
|
|
|
#@export var sound_touch: AudioStreamPlayer
|
2023-10-02 09:13:16 +00:00
|
|
|
#
|
2023-10-02 13:50:25 +00:00
|
|
|
#var touched=false
|
|
|
|
#var was_sleeping: bool = false
|
2023-10-02 09:13:16 +00:00
|
|
|
#
|
2023-10-02 13:50:25 +00:00
|
|
|
#func set_touched():
|
|
|
|
# touched=true
|
2023-10-02 09:13:16 +00:00
|
|
|
#
|
2023-10-02 13:50:25 +00:00
|
|
|
#func _on_sleeping_state_changed():
|
|
|
|
# was_sleeping = true
|
|
|
|
#
|
|
|
|
#func _on_body_entered(body):
|
|
|
|
# if not was_sleeping:
|
|
|
|
# if touched==false and $Timer.is_stopped():
|
|
|
|
# #$sound_touch.play()
|
|
|
|
# $Timer.start()
|
|
|
|
# var other_node=body
|
|
|
|
# if other_node.has_method("set_touched"):
|
|
|
|
# other_node.set_touched()
|
|
|
|
#
|
|
|
|
#func _on_body_exited(body):
|
|
|
|
# touched=false
|
2023-10-02 09:13:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|