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

Get help using Construct 2

Post » 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. :cry:

Thanks;
Roberto
B
4
S
1
Posts: 43
Reputation: 461

Post » 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.

Image
B
28
S
11
G
20
Posts: 738
Reputation: 13,692

Post » Sun Jan 03, 2016 8:10 pm

Thanks Mirlas, back to the drawing board then ;)
B
4
S
1
Posts: 43
Reputation: 461

Post » 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.
scirra.com/arcade/racing-games/lamboracing-v16-4313

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


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests