• 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!

GameMaker Moving through jumpthrough slopes while on jumpthrough platform

D

DarkzFlame

Guest
I've been working on jumpthrough slopes and I got it mostly working, the only issue I've now is that while I'm moving on a jumpthrough platform and the player moves through the jumpthrough slope the player gets stuck horizontally, the player will still be able to jump out of it though.

Here is a gif demonstrating the bug:


Here is the code I've got so far:
Code:
repeat(abs(vx)) {
        if (place_meeting(x + sign(vx), y, oParSolid) && !place_meeting(x + sign(vx), y - 1, oParSolid))
            y -= 1;
        
        if (place_meeting(x + sign(vx), y + 2, oParSolid) && !place_meeting(x + sign(vx), y + 1, oParSolid))
            y += 1;       
        
            
        if (!place_meeting(x, y, oParJumpThru)){
            if (place_meeting(x + sign(vx), y, oParJumpThru) && !place_meeting(x + sign(vx), y - 1, oParJumpThru))
                y -= 1;
        
            if (place_meeting(x + sign(vx), y + 2, oParJumpThru) && !place_meeting(x + sign(vx), y + 1, oParJumpThru))
                y += 1;
                
                if (place_meeting(x + sign(vx), y, oParJumpThru) ) 
                vx = 0;
        }
          
    if (place_meeting(x + sign(vx), y, oParSolid)) 
        vx = 0;
            
        x += sign(vx);
        
}
I've also tried to do this:
Code:
if (!place_meeting(x, y+1, oParJumpThru)){
    if (place_meeting(x + sign(vx), y, oParJumpThru) ) 
    vx = 0;
}
But then the player will keep it's momentum moving through the jumpthrough slopes.

Also it might be worth mentioning that the code I'm using is from Zack Bell's "Action Platformer Engine 1"
I know your not supossed to share code from Market Place assets, but Zack Bell posted pretty much the same code here for the slope movement.
 
Top