My solution was a little bit different, as I was able to do all of it only in the air state. I also added the variables to count air jumps, but instead of limiting jumps in general to 2 I limited "air_jumps" so my limit was 1 and regardless if the player entered the Air state by jumping or by falling, he would only have one jump in the air.
Also, my jump function resets "move.velocity.y" to 0 before adding the calculated jump impulse so that we don't lose height because of fall speed, or even lose the air jump altogether if I'm already falling at a max speed that is stronger than what my jump impulse could revert.
Finally, I changed the calculate_jump_velocity so that instead of passing "move.max_speed" to it, I pass "Vector2(move.max_speed.x, impulse)" this way I ensured my max jump speed would always be the impulse, without having to split my max_speed.y, and without having to add a new parameters to "calculate_velocity"
Thanks for the course! Loving it so far!
Great work. 🙂
Thanks for sharing your solution, and for the kind words!