Confusion about collision on different layers

Just started using Construct 2? Post your questions here

Post » Sun Aug 14, 2016 3:22 am

Hi there, I'm a little confused about the collision for tilemaps on different layers.

I understand that if two tile maps are on top of each other, the bottom one has zero collision? This is the thing I am having trouble with.

I am wondering if it is possible to have an RPG Maker-like tile setup where a layout has the "lower tile" layer and the "upper tile" layer- where the "lower tile" has water, mountains and such, basically filled tiles. Then the "upper" is decorations like windows, rocks stuff that has transparent pixels.

I've tried to emulate this with having 2 layers, a tilemap with "lower tiles" on it and another one with "upper tiles." The problem lies with this "zero collision" . I will place water , mountains or buildings like that on the "lower tile" but because of this overlapping tilemap collision , my player can walk through those tiles like they are Jesus. I then think "well put the water/buildings on upper" but that also means that I wouldn't be able to put decorations on that like windows or water lilies because they are on the same tile map layer and overwrite each other!

Is there a way to accomplish what I'm looking for? I'm not sure how to solve my issue.

EDIT: for some reason a lot of words got removed in my post, fixed.
B
17
S
3
G
1
Posts: 13
Reputation: 1,370

Post » Sun Aug 14, 2016 5:19 am

You could make a sprite, make it solid, and set it to invisible. You could us the same sprite repeatedly or use several depending on your collision shape needs. I don't make these type of games but seems to me this would work fine, placing the invisible sprites on the uppermost layer. I would also disable collisions on all visible tiles or sprites which would save memory. Hope this helps.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,293

Post » Sun Aug 14, 2016 4:25 pm

TheDom wrote:You could make a sprite, make it solid, and set it to invisible. You could us the same sprite repeatedly or use several depending on your collision shape needs. I don't make these type of games but seems to me this would work fine, placing the invisible sprites on the uppermost layer. I would also disable collisions on all visible tiles or sprites which would save memory. Hope this helps.

So if I understanding right, I would use an invisible sprite with solid to go over places in the lower part like water, buildings and etc. ?

As for disabling collision on tiles, how would I do that?
B
17
S
3
G
1
Posts: 13
Reputation: 1,370

Post » Mon Aug 15, 2016 3:58 pm

Like I said, I don't make these type of games but, I don't know if there are collision properties on tile maps but, collisions with normal sprites will work fine, no matter what layer you place them on. I only mentioned disabling collisions on sprites that they are not required is just a good practice for performance. Normally you can disable collisions on the properties dialog box for every sprite. I assumed it was the same for tile maps.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,293


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest