JeanSwamp
Member
Hello guys
I've been for three days trying to find a solution to my vertical jump through platform. I modidied it multiple times, fixing one stuff, but then messing something else.
The jump through platforms work pretty good on themselves, is the vertical moving one that is giving me hell.
I tried making the platform move the player, that worked pretty good for my needs, as I plan out the level design around that to avoid player collision with other solids while standing, problem was a pretty small hickup barely noticiable while landing, where would land, go back to air, and land again almost imposible to notice.
I've tried working with player's vsp, snapping the player to the top of the platform, most of them always end up having the player drop out when the platform reaches the lower level and changes direction.
This is what my collision code looks like.
Hopefully someone can drop some insight,
Thanks!
I've been for three days trying to find a solution to my vertical jump through platform. I modidied it multiple times, fixing one stuff, but then messing something else.
The jump through platforms work pretty good on themselves, is the vertical moving one that is giving me hell.
I tried making the platform move the player, that worked pretty good for my needs, as I plan out the level design around that to avoid player collision with other solids while standing, problem was a pretty small hickup barely noticiable while landing, where would land, go back to air, and land again almost imposible to notice.
I've tried working with player's vsp, snapping the player to the top of the platform, most of them always end up having the player drop out when the platform reaches the lower level and changes direction.
This is what my collision code looks like.
Code:
//Vertical Collision Jump Through
var falling = vsp > 0;
var platformBelow = instance_place(x, y+vsp, par_through);
if(falling)
{
if(platformBelow != noone)
{
var notClipping = !place_meeting(x, y, platformBelow);
if(notClipping)
{
while(!place_meeting(x, y+1, platformBelow))
{
y+= 1;
}
vsp = 0;
}
}
}
var onPlatform = collision_rectangle(bbox_left, bbox_bottom, bbox_right, bbox_bottom+1, par_through, false, false);
if(onPlatform != noone)
{
var notInsidePlatform = !collision_rectangle(bbox_left, bbox_bottom-1, bbox_right, bbox_bottom, onPlatform, false, false);
if(notInsidePlatform)
{
if (input_check_pressed(E_INPUT_SLOT.JUMP) && (input_check(E_INPUT_SLOT.DOWN)))
{
image_index = 0;
var amount = 4;
y += amount;
state = states.dropdown
}
}
}
var onVerticalPlat = instance_place(x,y+1,oMovPlatVer)
if(onVerticalPlat != noone)
{
var notInsidePlat = !instance_place(x,y-1,oMovPlatVer)
if(notInsidePlat)
{
vsp = onVerticalPlat.vmove
grv = 0
}
}
//Vertical Collision Solids
if (place_meeting(x,y+vsp,par_solid))
{
while (!place_meeting(x,y+sign(vsp),par_solid))
{
y = y + sign(vsp);
}
vsp = 0;
}
y = y + vsp;
Thanks!