How do I Create A Lava-Like Flow?

Get help using Construct 2

Post » Sat Oct 04, 2014 4:38 am

I would like to create a human body size lava sprite that flows somewhat naturally using the accelerometer. When you turn your phone it flows whatever way you are turning. If you turn your phone 180 degrees it drops down from the ceiling.

Would I use the physics object for this or would i need to animate each flow of movement?

Thanks for any help
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Tue Oct 07, 2014 12:42 am

The physics behavior would be the simplest way. Just use a bunch of circles. Do a search for liquid, fluid or water and you should find some examples, and even a way to make them look gelled together instead of being separate circles.

To make it act like a thicker liquid like lava you could make an attraction force to nearby circles and walls.
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Tue Oct 07, 2014 2:42 am

To test it out I made an example. I was trying to make the fluid stick to the walls and come down in globs.
https://dl.dropboxusercontent.com/u/542 ... ysics.capx
Disable event 4 to disable the sticky forces. You can also fiddle around with the spring forces to change the stickiness between the walls and other water. Unfortunately the wall stickiness only applies to one side the of wall sprites, so placing walls in the middle may not look right with the stickiness.


In more complicated fashion here is another test. It does the fluid physics manually using a paper on sph particle fluids. I've wanted to try this for a bit, and while it's not really usable for most, I suppose this is as good a place as any to post it. If anything it's an amusing toy.
https://dl.dropboxusercontent.com/u/542 ... fluid.capx
It has a lot of variables you can tweak them to get differing fluid types, however the simulation can explode if you use more extreme values. The settings it currently uses were by trial and error. I haven't found any references on good presets for different fluids.

And finally while I'm at it, here's another idea that I've tried before. The idea was to do fluids by just having spring forces pushing the particles apart. Not really successful, but for those who like to fiddle with capx's might find it amusing.
https://dl.dropboxusercontent.com/u/542 ... fluid.capx
It's a bit more stable if the G global is lowered.

-cheers
B
92
S
32
G
107
Posts: 5,274
Reputation: 69,959

Post » Tue Oct 07, 2014 7:37 am

@R0J0hound We are always in for a treat when you make a post :)
B
56
S
15
G
13
Posts: 826
Reputation: 17,645

Post » Tue Oct 07, 2014 5:12 pm

Holy Crap! As they say: "good things come to those who wait."

Thank you a ton, R0J0hound. That's exactly! what i was looking for. Do you mind if i copy your events?

I kneel before you ole wise one.
"I am not worthy. I am not worthy"
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], FacuLNF and 70 guests