From 07369a7ebf681d1ce60839a94f39d5ffc68eafa9 Mon Sep 17 00:00:00 2001 From: Thomas Lavocat Date: Sat, 29 Apr 2023 14:14:49 +0200 Subject: [PATCH] =?UTF-8?q?typage:=20bon=20typage=20de=20retour=20pour=20l?= =?UTF-8?q?es=20d=C3=A9placements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Une erreur d'attention faisaient passer des chiens pour des chats. Et on ne mélange pas les torchons avec des serviettes sinon les poulets ne seront pas bien gardés. J'en met ma main à couper le feu que c'est la dernière fois qu'on my prendra, jusqu'à la suivant bien entendu. En attendant, ce fix fixe le bug. bisous --- princesse.gd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/princesse.gd b/princesse.gd index cd49c40..31032c7 100644 --- a/princesse.gd +++ b/princesse.gd @@ -54,7 +54,7 @@ const PLATFORM_LAYER = 1 << (5 - 1) # collision layer 5 const PICS_BLOCK_LAYER = 1 << (6 - 1) # collision layer 6 var layer_of_collision = null -func walk(direction:int) -> int: +func walk(direction:int) -> float: # Fait marcher le personnage. # Si le personnage est dans l'air, il aura une friction plus faible lors de @@ -101,7 +101,7 @@ func walk(direction:int) -> int: return velocity.x -func fall() -> int: +func fall() -> float: if jumping: falling_step = -1 return velocity.y @@ -126,7 +126,7 @@ func fall() -> int: return FALL_SPEED_TABLE[falling_step] * FALLING_SPEED -func jump() -> int: +func jump() -> float: if not jumping: return velocity.y