More of a Question - Physics related

For questions about using Classic.

Post » Mon Aug 10, 2009 3:32 pm

This is more of a general "ideas" question than a help request... but this was the best place I could think of to ask.

Trying to come up with ideas in order to build some simple objects using physics, as in objects made up of a single sprite... and have them "destructible". Whatever it is with me and destructible physics objects, I don't know.

Anyway the idea would mainly consist of (multiple) simple objects of varying Mass and Size, colliding with each other at a variable "shoot" velocity. Upon collision, based on (velocity*mass) will determine which object will "break" (hense the destructible) and shatter into smaller physics pieces.

I have already thought of ways this might work, but I was hoping someone out there might have some other methods I could try.

Some methods I have thought of:
1. Having the main (sprite with texture) object, upon destruction, spawn several smaller objects using smaller "chunks" of the original texture. IE. Having to cut the "bits" out of a full texture in Photoshop for each "chunk" of the original object.

This would certainly work but be more time consuming than it's worth, since the amount of different/unique objects I would like to use, would be considered by most people as being "excessive".

I was hoping someone had some ideas to improve this. I was thinking maybe I could use the canvas object to snapshot the texture before breaking, but I don't know how well 1000's of small canvas objects with physics on them would perform....

2. Same as above, but the smaller objects are textured very generically instead of being composed of "chunks" of the original.

This saves time, but doesn't look good at all... not for the final effect I would be looking for.



That's about it really...

Sorry if I haven't been very clear with what I am trying to get at. Sometimes it's hard to explain an idea you have in your head.

If it helps, think of something along the lines of this as an analogy: A bag breaking open and fruit falling out of it... the bag goes into a couple of pieces and 5 random fruits fall out of the bag.

Or, a wooden spoon gets smashed into 3 pieces.

I guess if I figure something out in the meantime I will post it up.

Cheers in advance for any help or suggestions.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Aug 10, 2009 5:13 pm

Do you want the pieces to have physics as well?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Aug 10, 2009 5:30 pm

[quote="newt":19l7l0rs]Do you want the pieces to have physics as well?[/quote:19l7l0rs]

Oops, yes... forgot to mention that part. xD

I've been messing around for awhile now, and not getting anywhere past my original idea/method... which is going to be completely infeasible if I want a polished finished product.

Also, would like to be able to "crush" objects as well.. using height and width would be fine but I think I can probably figure this one out relatively easy.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Aug 10, 2009 6:26 pm

You'll have to use some dummy sprites for that as you cant change width and height on a physics object.
Now as to the breaking into smaller pieces, you will probably have to go with spawning new objects, as getting a group of physics objects to stay together is next to impossible... unless we some how get a way to disable physics when we want. There was some talk about that, but it was said it was probably not going to happen for the same reason you cant change width and height. Physics generates a map, and if you turn off the behavior, or change the attributes of an object, the map would have to be rescanned.
So what you could do is have the main object have a bunch of image points, then when it breaks destroy the main, and have the new objects spawn at(random?) image points.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 8 guests