la souris fait bouger qu'au clic gauche

This commit is contained in:
Thomas
2025-03-30 08:12:11 +02:00
parent 5b83435748
commit ce77fc810f
4 changed files with 16 additions and 5 deletions

View File

@@ -25,14 +25,17 @@ func _unhandled_input(event: InputEvent) -> void:
human.wants_to_grab = true
# moving using either touch or mouse button
if event is InputEventMouseButton or event is InputEventScreenTouch:
if event.is_action_pressed("touch") or event is InputEventScreenTouch:
GameState.isUsingTouch = true
var tile_pos = world.local_to_map(world.to_local(get_global_mouse_position()))
if event.pressed:
if event.is_pressed():
pathFinder.destination = get_global_mouse_position()
func update_game_state():
GameState.player_positions = human.get_feet_global_position()
func _process(delta) -> void:
GameState.player_positions = human.get_feet_global_position()
update_game_state()
ray.target_position = human.last_facing_direction * 48
if human.last_facing_direction.y > 0 :