typage: bon typage de retour pour les déplacements

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
This commit is contained in:
Thomas Lavocat
2023-04-29 14:14:49 +02:00
parent c8f981f2b6
commit 07369a7ebf

View File

@@ -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