Lightmind
Member
Basically, I have made code for jumping. But, if I press the jump button twice quickly, it does a double jump for some reason, and I need to fix this. I am making a metroidvania, so you can probably see why a double jump isn't going to be good at the start of the game where there would be so many locations you could get to with the double jump. This is my jump code:
GML:
if (place_meeting(x, y + 1, obj_wall)) and (jump) {
jumppw = 0.1;
vsp = -jumpsp * jumppw;
jump_x = true;
}
if (!jump) {
jump_x = false;
} else if (jumppw < 0.5 and jump) {
jumppw += 0.01;
vsp = -jumpsp * jumppw;
}
GML:
if (place_meeting(x, y + vsp, obj_wall)) {
while (!place_meeting(x, y + sign(vsp), obj_wall)) {
y += sign(vsp);
}
vsp = 0;
}
y += vsp;