Your code is a little mess (no offense :)) so I'll try to give a general guidelines to simple platform jumping and falling.
What you want to do is to maintain a velocity Y for the player, which is the speed he moves on y axis every frame. Positive is falling down, negative jumping up, or the other way around its your choice.
So every frame you'll have something like:
position.y += velocity.y * elapsedTime
Now assuming positive is down, every frame the player feet don't touch the ground, the y velocity should increase by your gravity factor (up to a certain max so he won't fall too fast). When hitting ground, it should zero velocity y. Something like:
velocity.y = 0
velocity.Y += gravity * elapsedTime
So what about jumping?
When your player release spacebar (or your jumping key) you just change y velocity:
velocity.y = -jumpingForce
But of course you need to add some additional checks:
- To prevent jumping from air, only allow jump if currently touching ground and velocity y is 0.
- To make sure the jump won't be cancelled out by the hit ground check that zero velocity, zero velocity y only if positive (eg falling down) AND touching ground.
- If your levels have ceiling you'll also need to test if the player's head hitting it when jumping, and zero velocity y.
That's the very basic falling / jumping behavior. You'll need some fine tuning and extra steps to make it feel right, but this should help you start.