1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 15:44:23 +00:00

Alter Move a bit...

This commit is contained in:
Steffo 2024-04-17 05:01:02 +02:00
parent 1f8a553294
commit 17e87b06d0
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 26 additions and 3 deletions

View file

@ -4,6 +4,19 @@ class_name Move
signal move(norm: Vector2) signal move(norm: Vector2)
signal move_toggled(value: bool)
signal move_enabled
signal move_disabled
## Whether this component should emit [signal move]. ## Whether this component should emit [signal move].
@export var enabled: bool = true @export var enabled: bool = true:
get:
return enabled
set(value):
if enabled != value:
enabled = value
move_toggled.emit(value)
if value:
move_enabled.emit()
else:
move_disabled.emit()

View file

@ -124,7 +124,6 @@ priority = 10
[node name="BoredTimer" type="Timer" parent="Movement/Idle"] [node name="BoredTimer" type="Timer" parent="Movement/Idle"]
one_shot = true one_shot = true
autostart = true
[node name="Wander" parent="Movement" instance=ExtResource("10_05kcd")] [node name="Wander" parent="Movement" instance=ExtResource("10_05kcd")]
enabled = false enabled = false
@ -152,20 +151,31 @@ enabled = false
[node name="TrackerTracker" parent="Movement/RunFromHunter" instance=ExtResource("14_eqowb")] [node name="TrackerTracker" parent="Movement/RunFromHunter" instance=ExtResource("14_eqowb")]
[node name="Camera2D" type="Camera2D" parent="."]
position_smoothing_enabled = true
position_smoothing_speed = 1.0
[connection signal="dragged" from="Draggable" to="." method="_on_draggable_dragged"] [connection signal="dragged" from="Draggable" to="." method="_on_draggable_dragged"]
[connection signal="dropped" from="Draggable" to="." method="_on_draggable_dropped"] [connection signal="dropped" from="Draggable" to="." method="_on_draggable_dropped"]
[connection signal="ready" from="Movement" to="Movement" method="enable"] [connection signal="ready" from="Movement" to="Movement" method="enable"]
[connection signal="move" from="Movement/Idle" to="." method="_on_move"]
[connection signal="move_disabled" from="Movement/Idle" to="Movement/Idle/BoredTimer" method="stop"]
[connection signal="move_enabled" from="Movement/Idle" to="Movement/Idle/BoredTimer" method="start"]
[connection signal="priority_changed_no_args" from="Movement/Idle/IdlePriority" to="Movement" method="enable"] [connection signal="priority_changed_no_args" from="Movement/Idle/IdlePriority" to="Movement" method="enable"]
[connection signal="timeout" from="Movement/Idle/BoredTimer" to="Movement/Wander" method="randomize_direction"] [connection signal="timeout" from="Movement/Idle/BoredTimer" to="Movement/Wander" method="randomize_direction"]
[connection signal="changed_direction" from="Movement/Wander" to="Movement/Wander/WanderPriority" method="set_priority_if_truthy" binds= [20]] [connection signal="changed_direction" from="Movement/Wander" to="Movement/Wander/WanderPriority" method="set_priority_if_truthy" binds= [20]]
[connection signal="changed_direction" from="Movement/Wander" to="Movement/Wander/TiredTimer" method="start" unbinds=1] [connection signal="move" from="Movement/Wander" to="." method="_on_move"]
[connection signal="move_disabled" from="Movement/Wander" to="Movement/Wander/TiredTimer" method="stop"]
[connection signal="move_enabled" from="Movement/Wander" to="Movement/Wander/TiredTimer" method="start"]
[connection signal="priority_changed_no_args" from="Movement/Wander/WanderPriority" to="Movement" method="enable"] [connection signal="priority_changed_no_args" from="Movement/Wander/WanderPriority" to="Movement" method="enable"]
[connection signal="timeout" from="Movement/Wander/TiredTimer" to="Movement/Wander/WanderPriority" method="set_priority" binds= [0]] [connection signal="timeout" from="Movement/Wander/TiredTimer" to="Movement/Wander/WanderPriority" method="set_priority" binds= [0]]
[connection signal="changed_target" from="Movement/RunFromMouse" to="Movement/RunFromMouse/RunFromMousePriority" method="set_priority_if_truthy" binds= [30]] [connection signal="changed_target" from="Movement/RunFromMouse" to="Movement/RunFromMouse/RunFromMousePriority" method="set_priority_if_truthy" binds= [30]]
[connection signal="move" from="Movement/RunFromMouse" to="." method="_on_move"]
[connection signal="priority_changed_no_args" from="Movement/RunFromMouse/RunFromMousePriority" to="Movement" method="enable"] [connection signal="priority_changed_no_args" from="Movement/RunFromMouse/RunFromMousePriority" to="Movement" method="enable"]
[connection signal="cursor_entered" from="Movement/RunFromMouse/CursorDetector" to="Movement/RunFromMouse" method="set_target"] [connection signal="cursor_entered" from="Movement/RunFromMouse/CursorDetector" to="Movement/RunFromMouse" method="set_target"]
[connection signal="cursor_exited" from="Movement/RunFromMouse/CursorDetector" to="Movement/RunFromMouse" method="clear_target" unbinds=1] [connection signal="cursor_exited" from="Movement/RunFromMouse/CursorDetector" to="Movement/RunFromMouse" method="clear_target" unbinds=1]
[connection signal="changed_target" from="Movement/RunFromHunter" to="Movement/RunFromHunter/RunFromHunterPriority" method="set_priority_if_truthy" binds= [40]] [connection signal="changed_target" from="Movement/RunFromHunter" to="Movement/RunFromHunter/RunFromHunterPriority" method="set_priority_if_truthy" binds= [40]]
[connection signal="move" from="Movement/RunFromHunter" to="." method="_on_move"]
[connection signal="priority_changed_no_args" from="Movement/RunFromHunter/RunFromHunterPriority" to="Movement" method="enable"] [connection signal="priority_changed_no_args" from="Movement/RunFromHunter/RunFromHunterPriority" to="Movement" method="enable"]
[connection signal="tracked" from="Movement/RunFromHunter/TrackerTracker" to="Movement/RunFromHunter" method="set_target"] [connection signal="tracked" from="Movement/RunFromHunter/TrackerTracker" to="Movement/RunFromHunter" method="set_target"]
[connection signal="untracked" from="Movement/RunFromHunter/TrackerTracker" to="Movement/RunFromHunter" method="clear_target" unbinds=1] [connection signal="untracked" from="Movement/RunFromHunter/TrackerTracker" to="Movement/RunFromHunter" method="clear_target" unbinds=1]