How do I create a custom collision polygon for physics

Get help using Construct 2

Post » Wed Jul 23, 2014 10:40 am

so the question is, can a custom collision polygon be created inside one image?

this is the image:
i.imgur.com/kSRdqBG.jpg

and i want the polygon to be bound on the track's edges. so when a car hits the edge of track to.. bounce and slow down..

my buddy did it with additional ~60 objects with physics applied, but that seems too much and not needed.
any solutions?
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Wed Jul 23, 2014 11:32 am

Inside the image editor bottom shape on the left is the collision polygon tool..

You are going to need multiple shapes (not 60), because a collision polygon only has an outside, so you can't have an open space in the middle..
Last edited by LittleStain on Wed Jul 23, 2014 11:35 am, edited 1 time in total.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 23, 2014 11:33 am

Image

:)
B
7
S
1
Posts: 61
Reputation: 588

Post » Wed Jul 23, 2014 11:35 am

I don't know much, but I thinned it down http://imgur.com/SdhnpCv
You can save time like with 1,2,7,8 and 3,4,5,6 using clone object and rotating.
B
17
S
3
Posts: 37
Reputation: 935

Post » Wed Jul 23, 2014 8:31 pm

thnx, yes this seems like a very good solution SKuirely.

it would be nice if construct had options for creating more / polygon shapes in one.

also i got another question - why can't i add more points to collision polygon?
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Wed Jul 23, 2014 9:19 pm

You can..
Right click on a polygon point and choose add..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 23, 2014 10:12 pm

it's greyed out :/
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Wed Jul 23, 2014 10:21 pm

select the point with left click..
when the point is yellow, right click on it and add new point..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 23, 2014 10:35 pm

oh, that worked, thnx ! :)
Sea Monsters template - Isometric
Also includes 40 pages PDF of optimizations and "how-to" for your games, and how the "sea monsters" template was built. Follow link for details :)

sea-monsters-templates-and-assets_t162705
B
43
S
14
G
12
Posts: 626
Reputation: 9,450

Post » Thu Jul 24, 2014 12:14 am

Just note - if you are using the asm.js physics then you are limited to 8 polygon corners per sprite...
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Next

Return to How do I....?

Who is online

Users browsing this forum: MrSkailo and 24 guests