![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | JayH |
Hi,
Just as the title says, I’d like to know the best way to determine when the Player has first hit the ground. This way I can generate some game juice with foot dust.
I understand that I may be able to use a boolean test, but perhaps there is a more straight-forward way.
Here’s my grounded code:
#SET IF ON THE GROUND OR NOT
if is_on_floor() :
onGround = true
else:
onGround = false
if myVelocity.y < 0:
$AnimatedSprite.play("Jump")
if myVelocity.y > 0 :
$AnimatedSprite.play("Fall")
myVelocity = move_and_slide(myVelocity, FLOOR) #MOVE PLAYER WALKING
What are your suggestions?
Thanks.