princesse/prout: relier le fromage au dash

Maintenant, la princesse à besoin de manger du fromage pour récupérer un
prout dans le compteur de prout pour lui permettre de dasher. Il manque
le fait d'avoir un timer qui délaye l'ajout du prout au compteur de
prout et le HUD pour savoir où on en est de son nombre de prouts
réstants.
This commit is contained in:
Thomas Lavocat
2023-04-30 20:27:06 +02:00
parent e963ececf9
commit f6e903b7d5

View File

@@ -84,6 +84,9 @@ var dash_step : int = -1
var dash_direction_x : int = 1
var dash_direction_y : int = 1
var available_dashs = 0
@export var MAX_FARTS : int = 1
################################################################################
#
# Gestion d'avec quoi Princesse collisionne
@@ -376,7 +379,9 @@ func read_input() -> void:
direction = kick_direction
if Input.is_action_just_pressed("dash" + action_suffix):
if not dashing:
if not dashing and available_dashs > 0:
Input.start_joy_vibration(0, 1, 0.5, 0.2)
available_dashs -=1
dashing = true
dash_step = DASH_SPEED_TABLE.size()-1
var axis_x = Input.get_axis(
@@ -447,4 +452,5 @@ func _physics_process(delta: float) -> void:
play_animation()
func reload_fart() -> void:
available_dashs = min(available_dashs+1, MAX_FARTS)
Input.start_joy_vibration(0, 0, 1, 0.1)