The best idea is to set a "mode" for your character. So when you press the jump key you change his "mode" to "jump" then your code will never call the normal "running" code.
So your main control loop would be something like this:
select PLAYERmode
case 0
DoPlayerNormal()
case 1
DoPlayerJumping()
end select
The DoPlayerNormal function will be checking for keys and making him run. When the jump key is pressed you change the PLAYERmode to 1 and then the DoPlayerJumping function will be called and in that you have no check for the jump key been pressed.
Look in the code archives for my Manic Miner. Its 2D but the logic is still the same.
So your main control loop would be something like this:
select PLAYERmode
case 0
DoPlayerNormal()
case 1
DoPlayerJumping()
end select
The DoPlayerNormal function will be checking for keys and making him run. When the jump key is pressed you change the PLAYERmode to 1 and then the DoPlayerJumping function will be called and in that you have no check for the jump key been pressed.
Look in the code archives for my Manic Miner. Its 2D but the logic is still the same.