Intérargir en marchant ne fait plus bugger
pas le temps d'expliquer, banzaï!
This commit is contained in:
@@ -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: 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?
|
Bob: Est-ce que tu veux faire des choix?
|
||||||
- Non merci
|
- 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!
|
- Oui!
|
||||||
Bob: Je savais que tu choisirai quelque chose. Bravo pour ce choix conséquent qui aura des conséquences conséquentes.
|
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
|
- Je veux recommencer cette discussion hyper utile à ma vie => start
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ func _physics_process(delta):
|
|||||||
else:
|
else:
|
||||||
velocity = velocityVector * speed
|
velocity = velocityVector * speed
|
||||||
|
|
||||||
if state_machine.get_current_node() == "grabing":
|
if state_machine.get_current_node() == "grabing" or humanInteractionTarget != null :
|
||||||
velocity = Vector2(0,0);
|
velocity = Vector2(0,0);
|
||||||
|
|
||||||
# move the caracter
|
# move the caracter
|
||||||
@@ -53,7 +53,6 @@ func _physics_process(delta):
|
|||||||
# compute the direction the player wants to look at
|
# compute the direction the player wants to look at
|
||||||
if velocity:
|
if velocity:
|
||||||
last_facing_direction = velocity.normalized()
|
last_facing_direction = velocity.normalized()
|
||||||
stop_interaction()
|
|
||||||
|
|
||||||
updateFacingDirectionInAnimationTree()
|
updateFacingDirectionInAnimationTree()
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ extends Node
|
|||||||
var interactable : Node2D
|
var interactable : Node2D
|
||||||
|
|
||||||
func _unhandled_input(event: InputEvent) -> void:
|
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 (
|
if (
|
||||||
event.is_action("move_left") or
|
event.is_action("move_left") or
|
||||||
event.is_action("move_right") 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")
|
human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||||
if event.is_action_pressed("grab"):
|
if event.is_action_pressed("grab"):
|
||||||
if interactable:
|
if interactable:
|
||||||
human.stop_interaction()
|
|
||||||
human.wants_to_interact_with = interactable
|
human.wants_to_interact_with = interactable
|
||||||
else:
|
else:
|
||||||
human.wants_to_grab = true
|
human.wants_to_grab = true
|
||||||
else:
|
|
||||||
human.wants_to_grab = false
|
|
||||||
human.wants_to_interact_with = null
|
|
||||||
|
|
||||||
func _process(delta) -> void:
|
func _process(delta) -> void:
|
||||||
ray.target_position = human.last_facing_direction * 48
|
ray.target_position = human.last_facing_direction * 48
|
||||||
|
|||||||
Reference in New Issue
Block a user