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

Legacy GM Jump-through platforms with gravity

H

HenrikoNumberOne

Guest
Hello! I am trying to create a 2D platformer with jump-through platforms (in the shape of square boxes). However, these boxes have gravity which makes them fall through the ground if I set their masks to "nothing" whenever you are trying to jump through them (using the method shown here).

This is the script I used;
Code:
with obj_platform
{
if other.bbox_bottom < bbox_top
mask_index = -1;
else mask_index = sprite_index;
}
Is there a way to fix this problem?

Thanks in advance!
 

TheouAegis

Member
YouTube needs to slap a disclaimer on Shaun's video to tell people to stop using it for jump through platforms. And here is yet another reason why it doesn't work, now!

The fundamentals are pretty much the same, you check if the player's falling, check if the player is going to collide with a platform, check if the player's above the platform that he is about to collide with, and then you move him into the Collision.
 
M

maratae

Guest
YouTube needs to slap a disclaimer on Shaun's video to tell people to stop using it for jump through platforms. And here is yet another reason why it doesn't work, now!

The fundamentals are pretty much the same, you check if the player's falling, check if the player is going to collide with a platform, check if the player's above the platform that he is about to collide with, and then you move him into the Collision.
I learnt this the hard way :p
 
H

HenrikoNumberOne

Guest
YouTube needs to slap a disclaimer on Shaun's video to tell people to stop using it for jump through platforms. And here is yet another reason why it doesn't work, now!

The fundamentals are pretty much the same, you check if the player's falling, check if the player is going to collide with a platform, check if the player's above the platform that he is about to collide with, and then you move him into the Collision.
Ah, I see. Thanks!
 
YouTube needs to slap a disclaimer on Shaun's video to tell people to stop using it for jump through platforms. And here is yet another reason why it doesn't work, now!

The fundamentals are pretty much the same, you check if the player's falling, check if the player is going to collide with a platform, check if the player's above the platform that he is about to collide with, and then you move him into the Collision.
As I've pointed out a few times he has 2 videos on the subject and both have big issues. Over in the GML1 Steam forum this was probably the #2 most asked question other than "How do I get Shaun's state machine to work?"
 

TheouAegis

Member
@HenrikoNumberOne if your olatforms overlap like in Super Mario Bros. 3, a simple place_meeting call won't work. You could use a "reverse with" loop to have every platform check if it 's not colliding yet, if it will collide next step, then move the player into collision.

Just remember that you can't use the solid attribute. Not sure the physics engine changes things.

For tile-based ones, o prefer checking if falling, checking if there IS a collision at the feet and NO collision at the knees or hips.
 
H

HenrikoNumberOne

Guest
@HenrikoNumberOne if your olatforms overlap like in Super Mario Bros. 3, a simple place_meeting call won't work. You could use a "reverse with" loop to have every platform check if it 's not colliding yet, if it will collide next step, then move the player into collision.

Just remember that you can't use the solid attribute. Not sure the physics engine changes things.

For tile-based ones, o prefer checking if falling, checking if there IS a collision at the feet and NO collision at the knees or hips.
Got it working now! Thanks for the help :)
 
Top