1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-22 08:04:23 +00:00

Temporarily remove Draggable from Sheep

This commit is contained in:
Steffo 2024-04-19 01:33:44 +02:00
parent f1871a02ae
commit a1053e13a9
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0
2 changed files with 8 additions and 21 deletions

View file

@ -2,7 +2,6 @@ extends CharacterBody2D
class_name Sheep class_name Sheep
@onready var draggable: Draggable = $"Draggable"
@onready var sprite: SpriteLeftRight = $"Sprite" @onready var sprite: SpriteLeftRight = $"Sprite"
@onready var drag_sound: AudioStreamPlayer2D = $"Draggable/DragSound" @onready var drag_sound: AudioStreamPlayer2D = $"Draggable/DragSound"
@onready var drop_sound: AudioStreamPlayer2D = $"Draggable/DropSound" @onready var drop_sound: AudioStreamPlayer2D = $"Draggable/DropSound"
@ -13,19 +12,5 @@ func _ready() -> void:
animator.play("RESET") animator.play("RESET")
func _on_move(movement: Vector2) -> void: func _on_move(movement: Vector2) -> void:
if not draggable.being_dragged:
move_and_collide(movement) move_and_collide(movement)
sprite.handle_move(movement) sprite.handle_move(movement)
func _on_drag_move(movement: Vector2) -> void:
if draggable.being_dragged:
move_and_collide(movement)
sprite.handle_move(movement)
func _on_draggable_dragged() -> void:
drag_sound.play()
animator.play("wobble")
func _on_draggable_dropped() -> void:
drop_sound.play()
animator.play("RESET")

View file

@ -108,7 +108,7 @@ speed = 0.0
enabled = false enabled = false
[node name="IdlePriority" parent="MovementIdle" instance=ExtResource("11_0jlmk")] [node name="IdlePriority" parent="MovementIdle" instance=ExtResource("11_0jlmk")]
priority = 10 alternative_priority = 0
[node name="BoredTimer" parent="MovementIdle" instance=ExtResource("12_c45uk")] [node name="BoredTimer" parent="MovementIdle" instance=ExtResource("12_c45uk")]
one_shot = true one_shot = true
@ -122,6 +122,7 @@ speed = 66.0
enabled = false enabled = false
[node name="WanderPriority" parent="MovementWander" instance=ExtResource("11_0jlmk")] [node name="WanderPriority" parent="MovementWander" instance=ExtResource("11_0jlmk")]
alternative_priority = 20
[node name="TiredTimer" parent="MovementWander" instance=ExtResource("12_c45uk")] [node name="TiredTimer" parent="MovementWander" instance=ExtResource("12_c45uk")]
one_shot = true one_shot = true
@ -133,6 +134,7 @@ speed = -100.0
enabled = false enabled = false
[node name="RunFromMousePriority" parent="MovementRunFromMouse" instance=ExtResource("11_0jlmk")] [node name="RunFromMousePriority" parent="MovementRunFromMouse" instance=ExtResource("11_0jlmk")]
alternative_priority = 30
[node name="CursorSense" parent="MovementRunFromMouse" instance=ExtResource("13_5fkdr")] [node name="CursorSense" parent="MovementRunFromMouse" instance=ExtResource("13_5fkdr")]
@ -154,19 +156,19 @@ enabled = false
[connection signal="move_enabled" from="MovementIdle" to="MovementIdle/BoredTimer" method="start"] [connection signal="move_enabled" from="MovementIdle" to="MovementIdle/BoredTimer" method="start"]
[connection signal="priority_changed_no_args" from="MovementIdle/IdlePriority" to="MovementSampler" method="enable"] [connection signal="priority_changed_no_args" from="MovementIdle/IdlePriority" to="MovementSampler" method="enable"]
[connection signal="timeout" from="MovementIdle/BoredTimer" to="MovementWander" method="randomize_direction"] [connection signal="timeout" from="MovementIdle/BoredTimer" to="MovementWander" method="randomize_direction"]
[connection signal="changed_direction" from="MovementWander" to="MovementWander/WanderPriority" method="set_priority_if_truthy" binds= [20]] [connection signal="changed_direction" from="MovementWander" to="MovementWander/WanderPriority" method="priority_conditional"]
[connection signal="move" from="MovementWander" to="." method="_on_move"] [connection signal="move" from="MovementWander" to="." method="_on_move"]
[connection signal="move_disabled" from="MovementWander" to="MovementWander/TiredTimer" method="stop"] [connection signal="move_disabled" from="MovementWander" to="MovementWander/TiredTimer" method="stop"]
[connection signal="move_enabled" from="MovementWander" to="MovementWander/TiredTimer" method="start"] [connection signal="move_enabled" from="MovementWander" to="MovementWander/TiredTimer" method="start"]
[connection signal="priority_changed_no_args" from="MovementWander/WanderPriority" to="MovementSampler" method="enable"] [connection signal="priority_changed_no_args" from="MovementWander/WanderPriority" to="MovementSampler" method="enable"]
[connection signal="timeout" from="MovementWander/TiredTimer" to="MovementWander" method="clear_direction"] [connection signal="timeout" from="MovementWander/TiredTimer" to="MovementWander" method="clear_direction"]
[connection signal="changed_target" from="MovementRunFromMouse" to="MovementRunFromMouse/RunFromMousePriority" method="set_priority_if_truthy" binds= [30]] [connection signal="changed_target" from="MovementRunFromMouse" to="MovementRunFromMouse/RunFromMousePriority" method="priority_conditional"]
[connection signal="move" from="MovementRunFromMouse" to="." method="_on_move"] [connection signal="move" from="MovementRunFromMouse" to="." method="_on_move"]
[connection signal="move_enabled" from="MovementRunFromMouse" to="MovementWander" method="clear_direction"] [connection signal="move_enabled" from="MovementRunFromMouse" to="MovementWander" method="clear_direction"]
[connection signal="priority_changed_no_args" from="MovementRunFromMouse/RunFromMousePriority" to="MovementSampler" method="enable"] [connection signal="priority_changed_no_args" from="MovementRunFromMouse/RunFromMousePriority" to="MovementSampler" method="enable"]
[connection signal="cursor_entered" from="MovementRunFromMouse/CursorSense" to="MovementRunFromMouse" method="set_target"] [connection signal="cursor_entered" from="MovementRunFromMouse/CursorSense" to="MovementRunFromMouse" method="set_target"]
[connection signal="cursor_exited" from="MovementRunFromMouse/CursorSense" to="MovementRunFromMouse" method="clear_target" unbinds=1] [connection signal="cursor_exited" from="MovementRunFromMouse/CursorSense" to="MovementRunFromMouse" method="clear_target" unbinds=1]
[connection signal="changed_target" from="MovementRunFromHunter" to="MovementRunFromHunter/RunFromHunterPriority" method="set_priority_if_truthy" binds= [40]] [connection signal="changed_target" from="MovementRunFromHunter" to="MovementRunFromHunter/RunFromHunterPriority" method="priority_conditional"]
[connection signal="move" from="MovementRunFromHunter" to="." method="_on_move"] [connection signal="move" from="MovementRunFromHunter" to="." method="_on_move"]
[connection signal="move_disabled" from="MovementRunFromHunter" to="MovementWander" method="clear_direction"] [connection signal="move_disabled" from="MovementRunFromHunter" to="MovementWander" method="clear_direction"]
[connection signal="priority_changed_no_args" from="MovementRunFromHunter/RunFromHunterPriority" to="MovementSampler" method="enable"] [connection signal="priority_changed_no_args" from="MovementRunFromHunter/RunFromHunterPriority" to="MovementSampler" method="enable"]