mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-25 17:44:24 +00:00
Rename HoverDetector
to ScareArea
in SkitterFromMouse
This commit is contained in:
parent
8b8b6fbd88
commit
ff0c49cf07
2 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ signal calmed
|
|||
@export var directions: Array[Vector2] = []
|
||||
|
||||
@onready var calm_timer: Timer = $"CalmTimer"
|
||||
@onready var hover_detector: HoverDetector = $"HoverDetector"
|
||||
@onready var scare_area: HoverDetector = $"HoverDetector"
|
||||
|
||||
|
||||
enum State { CALM, SCARED }
|
||||
|
@ -44,7 +44,7 @@ func _physics_process(delta: float) -> void:
|
|||
move.emit(movement)
|
||||
|
||||
func _on_calm_timer_timeout() -> void:
|
||||
if hover_detector.mouse_inside:
|
||||
if scare_area.mouse_inside:
|
||||
scare()
|
||||
else:
|
||||
calm()
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
[node name="SkitterFromMouse" type="Node2D"]
|
||||
script = ExtResource("1_ftcf8")
|
||||
|
||||
[node name="HoverDetector" parent="." instance=ExtResource("2_cuaq0")]
|
||||
[node name="ScareArea" parent="." instance=ExtResource("2_cuaq0")]
|
||||
|
||||
[node name="CalmTimer" type="Timer" parent="."]
|
||||
|
||||
[connection signal="calmed" from="." to="." method="_on_calmed"]
|
||||
[connection signal="move" from="." to="." method="_on_move"]
|
||||
[connection signal="scared" from="." to="." method="_on_scared"]
|
||||
[connection signal="mouse_entered" from="HoverDetector" to="." method="_on_hover_detector_mouse_entered"]
|
||||
[connection signal="mouse_entered" from="ScareArea" to="." method="_on_hover_detector_mouse_entered"]
|
||||
[connection signal="timeout" from="CalmTimer" to="." method="_on_calm_timer_timeout"]
|
||||
|
|
Loading…
Reference in a new issue