la souris fait bouger qu'au clic gauche
This commit is contained in:
@@ -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 :
|
||||
|
||||
Reference in New Issue
Block a user