diff --git a/caracters/bob/bob.dialogue b/caracters/bob/bob.dialogue index 3f3b0a4..e0de3a5 100644 --- a/caracters/bob/bob.dialogue +++ b/caracters/bob/bob.dialogue @@ -6,7 +6,7 @@ Bob: Bonjour l'ami. Bob: En vrai, si tu est venu jusqu'à moi et qu'on parle, je suppose que oui! Bob: Est-ce que tu veux faire des choix? - Non merci - Bob: Petit chenapan! Tu viens d'en faire un, tu m'a l'air d'un sacré loustique, allez file avant que je t'oublies + Bob: Petit chenapan! Tu viens d'en faire un, tu m'a l'air d'un sacré loustic, allez file avant que je t'oublies - Oui! Bob: Je savais que tu choisirai quelque chose. Bravo pour ce choix conséquent qui aura des conséquences conséquentes. - Je veux recommencer cette discussion hyper utile à ma vie => start diff --git a/caracters/human.gd b/caracters/human.gd index 4a236eb..77aa99f 100644 --- a/caracters/human.gd +++ b/caracters/human.gd @@ -44,7 +44,7 @@ func _physics_process(delta): else: velocity = velocityVector * speed - if state_machine.get_current_node() == "grabing": + if state_machine.get_current_node() == "grabing" or humanInteractionTarget != null : velocity = Vector2(0,0); # move the caracter @@ -53,7 +53,6 @@ func _physics_process(delta): # compute the direction the player wants to look at if velocity: last_facing_direction = velocity.normalized() - stop_interaction() updateFacingDirectionInAnimationTree() diff --git a/caracters/player/player_controler.gd b/caracters/player/player_controler.gd index af8598f..e4c7086 100644 --- a/caracters/player/player_controler.gd +++ b/caracters/player/player_controler.gd @@ -5,6 +5,10 @@ extends Node var interactable : Node2D func _unhandled_input(event: InputEvent) -> void: + human.stop_interaction() + human.velocityVector = Vector2(0, 0) + human.wants_to_grab = false + human.wants_to_interact_with = null if ( event.is_action("move_left") or event.is_action("move_right") or @@ -14,13 +18,9 @@ func _unhandled_input(event: InputEvent) -> void: human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down") if event.is_action_pressed("grab"): if interactable: - human.stop_interaction() human.wants_to_interact_with = interactable else: human.wants_to_grab = true - else: - human.wants_to_grab = false - human.wants_to_interact_with = null func _process(delta) -> void: ray.target_position = human.last_facing_direction * 48