Collision Masks

S

Sammykat9

Guest
Okay I am very new at all this and I use the drag and drop system becuase I don't know how to code. As well, my game is a mixture of techniques from the interest and me just screwing around.

Okay the problem is my character is a cat (not symmetrical) and I have many sprites for it. I put precise collision masks on but it just got stuck on everything. So I put a mask with big enough dimensions that it fully covers each sprite(same dimensions for each mask). Now I don't get stuck on anything but the mask is so large that if the smallest bit of the cat is touching another solid object I can stand on it. It would make jumping from platform to platform way to easy if I can balance on the edge with the tail or nose of the cat. How can I have it that the collision Masks don't make me get stuck but also aren't identical for each sprite? Thanks and sorry I'm a huge newbie.
 
M

MegaGamer99

Guest
I believe I have played around with masks before while I was using DnD and the older Game Makers (7 and 8.1). I too am not a good programmer, but I'll try to help you as I can. May I see your game so I can see what the problem is?
 

TDSrock

Member
What you can do is detect when the player gets stuck and push them out.

However you'll probably need to head to coding if you want to achieve that. The new forums cater extremely poorly to GameMakers drag and drop, so even those who would know how to deal with this in drag and drop might not take the time to note it down properly.

If you look into how "zips" work in Super Mario 3 or Super Mario World you'll see that Nintendo's programmers decided to add something to push the player out of blocks in case the player finds himself in a block, the speedrunners abuse that system so I'm sure there are clear videos out there to explain it, it might give you a good sense on the basis of the mechanic at works here.
 

TheouAegis

Member
Post your cat's sprite. You typically don't even need pixel-perfect collisions. Just make a box for the idle sprite that extends from the shoulders to the butt, from the back down to the feet, and then translate that box across all the other sprites. Your jumping sprite would probably be wider and lower than the idle sprite, but the bounding box should only be lower - the width of a bounding box needs to be consistent in a side-scroller.

If it's a top-down game, use a square or circle mask around the feet.
 
L

Latté

Guest
I think I understand the problem. One way you can probably fix it is by making a new sprite and setting it to always be the object's mask. Try this: Duplicate the object's sprite. Then, edit it to be the shape you need the object's mask to be. Then, double-click on the object, click on the button that says "mask", and select the new sprite. I hope that was what you needed.
 
W

Wild_West

Guest
I think I understand the problem. One way you can probably fix it is by making a new sprite and setting it to always be the object's mask. Try this: Duplicate the object's sprite. Then, edit it to be the shape you need the object's mask to be. Then, double-click on the object, click on the button that says "mask", and select the new sprite. I hope that was what you needed.
He's right, that's the best way to deal with collisions, I had the same problem for a time until I gave my character a set mask for every sprite.
another cool trick is to always set the Y origin of any sprite that touches the ground to match it's own sprite height.
 
Top