L'arrivée de la boulangerie
Il n'y a rien dedans, mais elle est ouverte. Bonne visite
This commit is contained in:
@@ -17,6 +17,8 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
human.velocityVector = Input.get_vector("move_left", "move_right", "move_up", "move_down")
|
||||
if human.velocityVector != Vector2(0, 0):
|
||||
GameState.isUsingTouch = false
|
||||
else:
|
||||
update_game_state()
|
||||
|
||||
if event.is_action_pressed("grab"):
|
||||
if can_interact_with:
|
||||
@@ -32,10 +34,9 @@ func _unhandled_input(event: InputEvent) -> void:
|
||||
pathFinder.destination = get_global_mouse_position()
|
||||
|
||||
func update_game_state():
|
||||
GameState.player_positions = human.get_feet_global_position()
|
||||
GameState.update_position(human.get_feet_global_position())
|
||||
|
||||
func _process(delta) -> void:
|
||||
update_game_state()
|
||||
ray.target_position = human.last_facing_direction * 48
|
||||
|
||||
if human.last_facing_direction.y > 0 :
|
||||
@@ -88,3 +89,11 @@ func _process(delta) -> void:
|
||||
can_interact_with = closest
|
||||
if can_interact_with:
|
||||
can_interact_with.enable_interaction_clue(human)
|
||||
|
||||
func _on_area_2d_body_entered(body: Node2D) -> void:
|
||||
if body.has_method("do_trap") :
|
||||
human.kill_path_finder = true
|
||||
body.do_trap()
|
||||
|
||||
func _on_area_2d_body_exited(body: Node2D) -> void:
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user