Ok, I knew that you would say to use if Statements. So I was coming up with this while waiting for a reply
if(dbKeyState(KeyW) == 1 && JumpStatus == 0)
{
JumpStatus = 1;
Jump();
}
////////////////////////////////////////////////////////////////////
void Character::Jump()
{
if(LocationY > MaxHeight && JumpStatus == 1)
{
LocationY = LocationY - 6 * Velocity;
}
if(LocationY <= MaxHeight)
{
JumpStatus = 2;
}
}
This is all wrapped up in a class. When I run the game with this code my guy moves up about 40 or so pixels and then instantly returns to the ground. I'm assuming their is a small problem somewhere in the code, or this just isn't set up right. Also you may notice I don't include a part where the sprite must return to the ground.. this is because I'm using a gravity function to make the sprites fall at a certain rate. If you want me to post it because that might be the problem, just ask.
/*================================================*\
| Lead Programmer/Owner===============Anti-Triangle Cult=====|
\*================================================*/