Des changements de scènes sans bugs
du moins je l'espère!
This commit is contained in:
@@ -17,6 +17,7 @@ var humanInteractionTarget: Human = null
|
||||
var interactionClueFor : Human
|
||||
var interactionPaused= false
|
||||
var kill_path_finder = false
|
||||
var pause_everything = true
|
||||
|
||||
signal start_intracting
|
||||
signal loadFromGameState
|
||||
@@ -35,7 +36,8 @@ func face(whereToFace: Vector2) -> void:
|
||||
last_facing_direction = (whereToFace - global_position).normalized()
|
||||
|
||||
func decideAction() -> void:
|
||||
pass
|
||||
if pause_everything:
|
||||
return
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if interactionPaused and interactionClueFor:
|
||||
@@ -59,6 +61,10 @@ func _physics_process(delta):
|
||||
if state_machine.get_current_node() == "grabing" or humanInteractionTarget != null :
|
||||
velocity = Vector2(0,0);
|
||||
|
||||
|
||||
if pause_everything:
|
||||
velocity = Vector2(0,0);
|
||||
|
||||
# move the caracter
|
||||
move_and_slide()
|
||||
|
||||
@@ -115,3 +121,12 @@ func _on_load_from_game_state() -> void:
|
||||
emit_signal("loadFromGameState")
|
||||
feetSound.play()
|
||||
feetSound.stream_paused = true
|
||||
|
||||
|
||||
func _on_pause_game() -> void:
|
||||
pause_everything = true
|
||||
|
||||
|
||||
func _on_resume_game() -> void:
|
||||
pause_everything = false
|
||||
_on_load_from_game_state()
|
||||
|
||||
Reference in New Issue
Block a user