• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Weird double jump that isn't meant to be there?

Status
Not open for further replies.

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;
 

TsukaYuriko

☄️
Forum Staff
Moderator
You already have a topic about this. Please don't post more than one topic per issue, that just creates clutter.
 
Status
Not open for further replies.
Top