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.
did you do everything I told you to add?(without the other jumpin' script, just my jumping script only)remove the other jumping code you have now and try mine, I use it in all my games that jump.
but I usually do not make key down events,
I just make a code and put it in the draw actor event,
example:
- Code: Select all
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;
there are alot of events in this,
here is what I have so far of this game I am workin' on xD
not much so far.
this game once I add more stuff is going to be like an Agent sort of game,
you have to do simple tasks in a complicated way.
xD
once I add stuff it is going to be stuff like getting bread off the top of the level,
I will add bomb dudes guys with guns, everything!