Tiled background collision

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

    <img src="http://img560.imageshack.us/img560/2884/tiledy.jpg" border="0" />

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

    <img src="http://img856.imageshack.us/img856/1060/spriteb.jpg" border="0" />

    thank you

  • Maybe you could use a dummy/empty sprite on top of the background, and have the collision happen on this sprite.

  • 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

  • Yeap, what aridale and Xavier suggested seems to be the best solution.

    Especially since you can scale that one object to any platform size.

  • Works like a charm. Thanks guys

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)