I know it would be easy to use the windows timer, implement gravity and acceleration, and etc. but just as a test I tried making a primitive "jumping function". On run, the computer freezes; my guess is that I'm doing a useless loop of some sort. Here is the code; can anyone help figure out the problem?
void Character::Jump(bool x){
bool inAir;
bool rising;
bool falling;
if(m_pos.y != 0)inAir = true;
if(x)inAir = true;
if(inAir){
if(m_pos.y == 10 && !falling){
rising = false;
falling = true;
}
if(rising)m_pos.y += 0.5;
if(falling)m_pos.y -= 0.5;
if(m_pos.y == 0){
inAir = false;
}
}
}
I've tried many ways, and this is my latest... I can't see why it shouldn't work