How do I recreate a collision pollygon

Get help using Construct 2

Post » Sat Nov 07, 2015 6:16 pm

Hey,

Have polygon, need polygon to resize in different way than sprite can. need to say polygon equal (0,0 - 0,1 - 200,100 - 200,99). make sense?

think cannot be done. Maybe sdk but don't think can access that in any way.

Resiszing polygon best solution, understand alternative ways to solve problem but workarounds less efficient. Take more work. Undesirable.

Tips?

Gratitude.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sat Nov 07, 2015 6:20 pm

Interesting you know the workarounds will take more work, considering you don't know how to do it without yet..
Changing the polygon can ofcourse be done in the image editor, just add animation frames where you change it and set the frame in your event sheet..
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 » Sun Nov 08, 2015 6:23 am

@LittleStain

1.) I do know how to solve my problem without re-sizing the polygon in multiple ways, demonstrated by solving a single aspect of the problem. Problem is multifaceted and will require 4x the work to fully solve. Solution cannot be scaled efficiently in future if project expands. Further, performance will be degraded in solutions based on benchmark comparisons. Much better to be able to set polygon directly.

2.) Adding animation frames would require 4n frames where n is the total number of sprites of type x that can occur in a particular pattern known to exist in advance. A good suggestion considering most problems of this nature but not feasible in this case. Appreciate tip.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sun Nov 08, 2015 1:58 pm

Would resizing/rotating another sprite handling the collision work?

It's unclear what you need the collision-polygon change for..
The feature to change at runtime doesn't exist, so logically one would look for other ways to simulate the effect..
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 » Sun Nov 08, 2015 10:06 pm

LittleStain wrote:The feature to change at runtime doesn't exist, so logically one would look for other ways to simulate the effect..


Thats the confirmation I was looking for. I thought it may exist in the sdk but I couldn't find it, thought I would check.

There are plenty of reasons to want to change polygons directly rather than having transforms control them. More from a procedural standpoint, trying to avoid editor side work. Its not something that is needed* but that would be nice.

Rotating combined with resizing works to an extent to solve the problem but again requires more programming work, at least in the sense I need to do some trig to ensure proper placement rotation and stretching.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153

Post » Sun Nov 08, 2015 10:45 pm

It could be there are other options, but that would depend greatly on what you are trying to achieve..
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 » Sun Nov 08, 2015 11:14 pm

Presumably you can access and change the collision polygon at runtime with the sdk. Yann's "polygon" plugin changes the collision polygon as I recall. You could reference that for an example.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Wed Nov 11, 2015 2:25 am

@R0j0hound - I will look into that. Thanks.
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,153


Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION and 57 guests