amélioration de la commande tactile

les clues sont dépendantes du contexte
elles affichent un bouton si on est au clavier
un doigt si on est à la souris ou au doigt
This commit is contained in:
Thomas
2025-03-29 12:51:15 +01:00
parent 2125236638
commit 6edefc58d0
13 changed files with 1673 additions and 16 deletions

View File

@@ -14,6 +14,8 @@ func _unhandled_input(event: InputEvent) -> void:
human.wants_to_grab = false
human.wants_to_interact_with = null
human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down")
if human.velocityVector != Vector2(0, 0):
GameState.isUsingTouch = false
if event.is_action_pressed("grab"):
if can_interact_with:
@@ -23,6 +25,7 @@ func _unhandled_input(event: InputEvent) -> void:
# moving using either touch or mouse button
if event is InputEventMouseButton or event is InputEventScreenTouch:
GameState.isUsingTouch = true
var tile_pos = world.local_to_map(world.to_local(get_global_mouse_position()))
if event.pressed:
pathFinder.destination = get_global_mouse_position()