As mentioned earlier, your jumped variable has mismatched names. (The second one is named jumped which will misfire)
However i think this is a case of your code firing too quick. You have your jump code but then under that jump code you have the switch. That creates a dependency where you always call jump and probably fire both pieces of code at once because you can’t call the second expression without hitting jump. You likely need to separate them, perhaps with a signal? Put a custom signal and fire it in that isonfloor() function (what is that and why is it true?) and then when the signal fires then run the second half of the code. You also may have some quirks in your logic with the ison_floor function() being true and the variable being true. If both aren’t true your event doesn’t happen.
My money is on that jump code though. Break it apart.
signal jump_end
func _ready():
self.connect(“jump_end”, self, “on_jumpend”)
Then your code:
> If Input.is_action_just_pressed(“jump”):
> var _jumped = 1
Then put the signal in the isonfloor() function:
I
emit_signal(“jump_end”)
Then the signal function:
func on_jumpend():
if _jumped == 1:
$AnimationPlayer.play(‘land’)
_jumped = 0