Tiled background collision

Discussion and feedback on Construct 2

Post » Tue Aug 07, 2012 12:07 pm

Hello guys,

I know that for a platformer when creating grass for example etc it is best to use tile background instead of sprite. But I am having a problem with collision then because I know I cannot set collision polygons on background tiles. But that is a problem because in some tiles collison system does not work well and this certain case player walkers above the grass instead of on the grass if it makes sense(. Is there something else I can do?

Because if I use background tile it looks like this:



But I need to set my collision like something like this (this is a sprite)



thank youMichal112012-08-07 12:08:47
B
8
S
2
Posts: 45
Reputation: 1,168

Post » Tue Aug 07, 2012 1:20 pm

Maybe you could use a dummy/empty sprite on top of the background, and have the collision happen on this sprite.Xavier2012-08-08 03:38:10
B
63
S
23
G
17
Posts: 254
Reputation: 14,342

Post » Tue Aug 07, 2012 3:53 pm

yeah make one object for all your collisions (or a family if you need different shapes besides square) and use that for collisions make it invisible
B
13
S
5
G
2
Posts: 306
Reputation: 3,262

Post » Wed Aug 08, 2012 5:07 am

Yeap, what aridale and Xavier suggested seems to be the best solution.
Especially since you can scale that one object to any platform size.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Wed Aug 08, 2012 7:43 am

Works like a charm. Thanks guys
B
8
S
2
Posts: 45
Reputation: 1,168

Post » Wed Aug 08, 2012 2:36 pm

For debugging purposes, too, your collisions should really be set to a completely separate layer--it'll make everything easier down the track.

Especially if you set a particular 'debug' button which disappears the other layers except the collision one, in case you get stuck.brockatkinson2012-08-08 14:37:17
B
14
S
1
G
2
Posts: 85
Reputation: 2,810


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests