How do I .. ignore empty spaces on sprite collision?

Get help using Construct 2

» Sun Jan 03, 2016 12:36 pm

Hi Community,

I'm still a complete N00B with C2, but having fun learning al the same time. My question is this (after exhausting web search)...

CAN A SPRITE PASS THROUGH ANOTHER SPRITE WITHOUT COLLIDING WITH ITS EMPTY SPACE?

Example: I'm trying to create a top-down scroller game: e.g. Spy Hunter.
Sprite A = car (left & right controls)
Sprite B = road (which scrolls downwards)

Below is an image example of Sprite B:
http://robfreeman.co.uk/Temp/game.html

Imagine: Sprite B, being the road... the edges are solid but the middle is empty (chequered) ... I want to enable collision with the car and road, but only collide with the solid edges.... hope that makes sense.

here is the game file.
http://robfreeman.co.uk/Temp/game.capx

I thought I might have been able to have two polygon shapes on either side, but sadly not.

Thanks;
Roberto
B
5
S
2
Posts: 63
Reputation: 628

» Sun Jan 03, 2016 12:51 pm

The problem here is the collision polygon, these occupying the entire block.
You can not have two independent collision polygons in the same graph, so you can use two objects or object tilemap.

B
30
S
13
G
21
Posts: 837
Reputation: 14,654

» Sun Jan 03, 2016 8:10 pm

Thanks Mirlas, back to the drawing board then
B
5
S
2
Posts: 63
Reputation: 628

» Sun Jan 03, 2016 9:22 pm

3 ways of doing this split the image and set collision fro each side. or create another sprite for border/edge of road.
or use tilemap to set collisions for edge of road with road as background image

see my example lambo racing.

which uses border sprite for edge of track.
B
29
S
13
G
10
Posts: 355
Reputation: 8,327