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

How do I go behind and in front of objects with the same collision mask?

J

Jane Landrum

Guest
Hey guys! I'm tying to figure out how to use collision masks and layers in game maker studio and could use some help. I'm wondering how I can make my player be able to walk all the way up to a sign and cover it up, but then also go behind the sign and only be able to walk up to it about half way. I've tried to do some research with this but most tutorials I find are either for beginners or too vague to answer my question. Does anybody know how to do this?
Here are two pictures from the game Stardew Valley that I'm using as an example. Thanks! :)
 
J

Jane Landrum

Guest
Hmm im new to this site and the pictures didnt upload, I hope my explanation was good enough ¯\_(ツ)_/¯
 

woods

Member
something like....
depth = -y in the step events
and collision area at the lower half of the sprites?
 

NightFrost

Member
In GMS1.4 making 2.5D depth stuff was a matter of setting instance depth to -y and using only the bottom parts of the sprites for collision masking. I can't remember what the argument against using depth with GMS2 was, but I know every time you put an instance at depth instead of a layer, GMS creates a layer ("managed layer") for it. People have devised some 2.5D methods for GMS2 like this and this.
 
J

Jane Landrum

Guest
Thanks so much! I'll look into the instance depth and -y and see if I can make it work.
 

samspade

Member
Hey guys! I'm tying to figure out how to use collision masks and layers in game maker studio and could use some help. I'm wondering how I can make my player be able to walk all the way up to a sign and cover it up, but then also go behind the sign and only be able to walk up to it about half way. I've tried to do some research with this but most tutorials I find are either for beginners or too vague to answer my question. Does anybody know how to do this?
Here are two pictures from the game Stardew Valley that I'm using as an example. Thanks! :)
You may also want to look into something like this as well. It is a little more complicated than using the -y depth method but it is also a lot more flexible. So, if the above doesn't work, it might be an alternative. Even if you don't use it. It is probably worth watching as it contains a great explanation of why the -y/depth method works and how drawing works in general.

 
Top