I'll take a look at the code and see if I can come up with something. Although, keep in mind that I am not an IntyBASIC programmer, so it'll take me a while just to figure out what the code does.
In any case, here's a bit of theory. Gravity is a rather simple mechanic to implement: it is just an acceleration adjustment added to the existing velocity of the sprite. The highest and lowest points in the trajectory occur rather "naturally": The former by the negative acceleration of gravity when going up, which eventually causes the velocity to reach zero; and the latter by just colliding with the floor or a platform.
Acceleration Due To Gravity
So, what do we need then? First we need a gravity constant, let's call it "G". The actual acceleration due to gravity on Earth is 9.8 m/s. However, since you are not making a physics simulation and presumably do not really care about sticking to real-life accuracy, just come up with a value and experiment until it feels right in your game. It also depends on how you measure speed, distance, and time in your game.
Then, we need to track the horizontal and vertical velocities of the object in motion, let's call them "VX" and "VY," respectively. These are the rate of change in displacement on a given axis. Again, these depend on how you track speed, distance, and time in your game. It could be pixels/second, pixels/frame, whatever.
The horizontal velocity is not affected by gravity (think about that: when you throw something forward, it is only stopped by either a wall, air friction, or when it finally hits the ground -- and even then, it may continue rolling forward with its own momentum). Therefore, we are only concerned with vertical velocity.
So, how does it work? Well, in its most simplest way, all you do is add the acceleration due to gravity G to your vertical velocity VY on every movement iteration. Then, update the sprite's vertical position based on this new velocity. In pseudo-code:
G = <set-acceleration-due-to-gravity>
VX = <set-initial-horizontal-velocity>
VY = <set-initial-jump-velocity>
While (Not Landed-On-Platform) And (Not Off-Bottom-Of-Screen)
PosX = PosX + (VX * Time)
PosY = PosY + (VY * Time)
VY = VY + (G * Time)
What is the "Time" value above? It's a factor that influences the rate of movement. Think of it as the "delay" for each pixel displacement. If, for example, you alternate the Time value between one and zero on every frame, it will cause the movements to be updated on every other frame.
How Does This Really Work?
If you think about it, since your vertical (jump) velocity is negative (because you are going up), and the acceleration due to gravity is positive (because it pulls you go down), adding +G to -VY will reduce the vertical velocity on every turn, eventually reaching zero. From zero, adding more +G will cause the vertical velocity to increment on every turn, going faster and faster until the sprite either goes off the bottom of the screen (player dies), or hits a platform (player bounces).
There is no need to keep track of complicated states like "going up" or "going down" unless there are specific things you want to happen on each case. The fact that the initial vertical velocity is negative and opposes gravity, and that gravity pulls it down little by little; will cause a nice parabolic arc in the actual jump: decelerating slowly until reaching the peak of the jump, then accelerating slowly until you hit the ground or go off the screen.
The trick is in picking some nice values for the initial velocity and the acceleration due to gravity constants, to make this cycle of going up and down as smooth and realistic as possible.
Does that help?
Edited by DZ-Jay, Sun Jul 15, 2018 7:43 AM.