jump = 1;
if(yvelocity > 2)jump = 0;
if(jump == 1) {
yvelocity = - 8;
jump = 0;
}
shady7twenty4 wrote:I had to use some of both of your responses to get it to work. Sgt. with yours something was wrong with my key down to jump, it did nothing but the rest was helpful.[big space]problem i can jump as high as long as i keep the up button down, but i only want him to b able to jump a certin heighth.
char*key=GetKeyState();
yvelocity += 1;
if(fly == 0) {
if(key[KEY_LEFT] == 1 && key[KEY_RIGHT] == 0)
{
gs = 0;
if(jump == 1)x -= 5;;
if(jump == 0)xvelocity -= 1;
if(af == 1 && jump == 1 && key[KEY_DOWN] == 0) {
af = 0;
ChangeAnimation("Event Actor", "WL 1", FORWARD);
}
if(af == 1 && jump == 1 && key[KEY_DOWN] == 1) {
af = 0;
ChangeAnimation("Event Actor", "CL 1", FORWARD);
}
if(af == 1 && jump == 0) {
af = 0;
ChangeAnimation("Event Actor", "LJ 1", FORWARD);
}
}
if(key[KEY_LEFT] == 0 && key[KEY_RIGHT] == 1)
{
gs = 1;
if(jump == 1)x += 5;
if(jump == 0)xvelocity += 1;
if(af == 1 && jump == 1 && key[KEY_DOWN] == 0) {
af = 0;
ChangeAnimation("Event Actor", "WR 1", FORWARD);
}
if(af == 1 && jump == 1 && key[KEY_DOWN] == 1) {
af = 0;
ChangeAnimation("Event Actor", "CR 1", FORWARD);
}
if(af == 1 && jump == 0) {
af = 0;
ChangeAnimation("Event Actor", "RJ 1", FORWARD);
}
}
if(key[KEY_UP] == 1 && jump == 1) {
if(gs == 0)ChangeAnimation("Event Actor", "LJ 1", FORWARD);
if(gs == 1)ChangeAnimation("Event Actor", "JR 1", FORWARD);
yvelocity = - 15;
jump = 0;
}
if(xvelocity > 5 && jump == 0)xvelocity = 5;
if(xvelocity < -5 && jump == 0)xvelocity = -5;
}
if(yvelocity > 2)jump = 0;
Users browsing this forum: No registered users and 1 guest