Cutting/Slicing an object while maintaining physic

Get help using Construct 2

Post » Sat Dec 01, 2012 4:50 pm

I'm relatively new here so I would like to take this opportunity to thank all the other users for the great tutorials and "How do I...".

This topic has been brought up a couple of times before, but I just had to confirm it myself. Is it possible for an object to be sliced in half and maintain it's physics behaviors, like become 2 separate polygons (think fruit ninja). and if not available will it become available and can it be done via a plugin?

All help appreciated !   
B
2
Posts: 2
Reputation: 404

Post » Sat Dec 01, 2012 5:17 pm

The graphical aspect could be done in R0J0's Canvas Plugin , But the plugin himself doesn't support Physics
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Sat Dec 01, 2012 9:52 pm

Or you could have 2 different sprites pinned to each other, and then whatever happens to break them apart just unpins them.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Sun Dec 02, 2012 2:04 am

Hmm. I would suggest looking into internal graphics work. Canvas plugin obviously also a way to copy and inject/paste the graphics. Also have a empty sprite with physics.

What you would need to do.

1. Create Physics Sprite
2. Paint physics sprite with image

3. On Cut Condition
- determine angle of cut and point of cut
- create two physics sprites based on the larger size.
- paint two new sprites with by copying the 2 sections(includes the overlap angel.
- use some trig to determine which part of the 2 new sprites need to be set to transparent. Looking up some canvas features. something like fillpath might work.

4. show 2 new sprites and remove old sprite


Now here is the thing. I haven't done anything like this, but I know plugins like canvas give you the ability to alter the image base. This is a requirement and only way to do it. good luck.

Here is a sample image of what I think you want to do.
https://docs.google.com/drawings/d/1X5Ai_mFPNjT1bDcLquGqTmU6wnmG9q5Y18YFfuHmANI/edit

This way you can make the graphics changes nessisary and then cut them into to new sprites. Good luck :)jayderyu2012-12-02 02:21:09
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Dec 02, 2012 7:39 pm

Thnx for the help jayderyu, I'll give it a whirl! :D
B
2
Posts: 2
Reputation: 404

Post » Sun Dec 02, 2012 8:18 pm

@jayderu
That wouldn't work because the collision polygon isn't affected by the canvas plugin and physics would work ...
Conclusion , You can try it but you will only waste your time ...
Source : R0j0hound response on a similar post ...

...

Only if you do the physics by yourself ... That would be possible !Whiteclaws2012-12-02 20:23:25
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589


Return to How do I....?

Who is online

Users browsing this forum: spacedoubt, Yahoo [Bot] and 3 guests