Polygon Collision

Get help using Construct 2

Post » Wed Feb 15, 2012 7:31 pm

Hi Guys, quick question about polygon collisions.

Some of you might have seen my train lying around the forums ;D. The shapes are pretty intricate so polygon collisions are a pain! So if i have just a black sprite and use that as a solid to form my collision polygon then that would be better right? instead of having more than 8 points.

But then I need some advice, I'll manually create a polygon for all of the trains shapes, then when they spawn what should I do? should I make the shape into a family its self? Like Train_BoxCart, ect? then when the right part of the train is spawned spawn the correct family and put it on the position of each train. But then how do I know which sprite in the trains family is spawned?

Here's the capx: capx

Thanks.
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Wed Feb 15, 2012 7:33 pm

Sounds like a job for @Yann?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Thu Feb 16, 2012 1:30 am

Bump. Us there at least a way to know what sprite had been spawned in the family?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Thu Feb 16, 2012 5:46 pm

[quote]Bump. Us there at least a way to know what sprite had been spawned in the family?[/quote]

Use a series of sub-events to the spawn action.
Sprite1 | pick instance with UID Family.UID
Sprite2 | pick instance with UID Family.UID
Sprite3 | pick instance with UID Family.UID

or one sub-event per object type in the family. Only one of them will evaluate true. Another approach would be to use a family variable indicating what the object type is.
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Thu Feb 16, 2012 7:07 pm

@R0J0hound, thanks for the help. But I'm a little confused still, I Dont think I understood what you meant. Would you please take a look at my updated capx: http://db.tt/jtNqwpJ3

thanks.
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Thu Feb 16, 2012 8:15 pm

How about this?
http://dl.dropbox.com/u/5426011/examples%209/smitchell_train.capx

Are you planning a platformer?
B
79
S
24
G
55
Posts: 4,755
Reputation: 41,273

Post » Thu Feb 16, 2012 8:36 pm

@R0J0hound Thanks for this, well sort of. The game is already made and awaiting publishing on the appstore. But for the games website I wanted to use HTML5 to have a basic demo of the game for people to play. But thanks man, I see what I was doing wrong.
B
29
S
12
G
7
Posts: 740
Reputation: 7,849


Return to How do I....?

Who is online

Users browsing this forum: Megavolt, selaus and 0 guests