princesse/physique: physique activée avant contrôles

Pour pas que la princesse commence par tomber dès qu'on la voit, activer
sa physique mais ne pas lui permettre marcher au travers des murs
Faudrait voir si le dash ne permet pas de passer au travers du coup.
This commit is contained in:
Thomas Lavocat
2023-05-12 16:18:54 +02:00
parent 81f01f3b65
commit 1cdab1c082

View File

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