From f6e903b7d5c4413e016b676e8e06e2a458670847 Mon Sep 17 00:00:00 2001 From: Thomas Lavocat Date: Sun, 30 Apr 2023 20:27:06 +0200 Subject: [PATCH] princesse/prout: relier le fromage au dash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- princesse.gd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/princesse.gd b/princesse.gd index 505650b..0377570 100644 --- a/princesse.gd +++ b/princesse.gd @@ -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)