ft: switch to click movement
This commit is contained in:
@@ -69,3 +69,9 @@ func _on_sight_body_entered(body: Node2D) -> void:
|
||||
|
||||
func _on_attack_cooldown_timer_timeout() -> void:
|
||||
can_attack = true
|
||||
|
||||
|
||||
func _on_collision_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
|
||||
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
|
||||
if player:
|
||||
player.target = self.collision
|
||||
|
||||
@@ -101,6 +101,7 @@ metadata/_custom_type_script = "uid://dgfimmq53whll"
|
||||
scale = Vector2(0.8, 0.8)
|
||||
collision_layer = 4
|
||||
collision_mask = 3
|
||||
input_pickable = true
|
||||
script = ExtResource("2_7qt2q")
|
||||
|
||||
[node name="Sprite" type="AnimatedSprite2D" parent="Collision" unique_id=410999609]
|
||||
@@ -154,6 +155,7 @@ script = ExtResource("8_7qt2q")
|
||||
wait_time = 0.5
|
||||
one_shot = true
|
||||
|
||||
[connection signal="input_event" from="Collision" to="." method="_on_collision_input_event"]
|
||||
[connection signal="body_entered" from="Collision/Sight" to="." method="_on_sight_body_entered"]
|
||||
[connection signal="timeout" from="StateMachine/Idle/Timer" to="StateMachine/Idle" method="_on_timer_timeout"]
|
||||
[connection signal="timeout" from="StateMachine/RandomMovement/Timer" to="StateMachine/RandomMovement" method="_on_timer_timeout"]
|
||||
|
||||
Reference in New Issue
Block a user