We can add a check_platform_collisions() function that makes sure the player doesn't go below the platform.
We check to make sure that player's y-coordinate (the bottom of the player) doesn't go below the platform's y-coordinate (the top of the platform). If that ever happens, we move the player to the top of the platform and set the player's y-velocity to 0.
Right now, this platform collision detection is pretty basic - and only works with a single platform. We'll be expanding it later to make it more general.
Since we'll be doing a lot more collision detection, we might as well create a check_collisions() function that will check for all the collisions that we care about in the game.
Right now, we only have platform collisions, so we only need to call check_platform_collisions(). We'll be adding more to this function later.
And finally, we need to call our check_collisions() function. We need to do that in update_world() so that the game checks for collisions whenever anything moves on the screen.
Run your code and see if you can jump.