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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user