diff --git a/princesse.gd b/princesse.gd index dde197b..b289abe 100644 --- a/princesse.gd +++ b/princesse.gd @@ -58,6 +58,7 @@ signal dash_fart() # utilisé pour vider le HUD signal princesse_is_dead() # signal au jeu de recharger la scene var locked = true +var locked_controls = true ################################################################################ # @@ -110,7 +111,7 @@ var crouch : bool = false func copy_from(other : Princess): direction = other.direction - walking = other.walking + walking = false walking_step = other.walking_step walk_incr_reserve = other.walk_incr_reserve init_decel = other.init_decel @@ -370,7 +371,7 @@ func get_coyote(table: Array): func read_input() -> void: # Lis les commandes du joueur pour piloter Princesse - if locked: + if locked or locked_controls: return # le joueur veut-il accélérer sa chute si il s'accroche au mur? @@ -570,14 +571,19 @@ func death() -> void: if not dead: print("death") locked = true + locked_controls = true + dead = true Input.start_joy_vibration(0, 1,0.7, 1) self.rotation = 90 - dead = true death_animation.play(&"death") + kill_farts() -func go_out_and_play(): +func _ready() -> void: locked = false dead = false +func go_out_and_play(): + locked_controls = false + func _on_death_player_animation_finished(_anim_name: StringName) -> void: princesse_is_dead.emit()