How do I Create A Lava-Like Flow?

0 favourites
  • 5 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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

  • 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.

  • To test it out I made an example. I was trying to make the fluid stick to the walls and come down in globs. ... 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. ... 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. ... fluid.capx

    It's a bit more stable if the G global is lowered.


  • R0J0hound We are always in for a treat when you make a post

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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"

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)