Chris Jones
Chris Jones

Reputation: 857

Creating 2D liquid with SpriteKit

What's the easiest way of creating a 2D liquid surface in SpriteKit? I don't mind using any external libraries.

So far I've used LiquidFun by Google and LiquidKit - a folder I found on github.

This is the effect I want to create. Fluid that fills half the screen: https://j.gifs.com/m8aQ5X.gif

Upvotes: 1

Views: 845

Answers (1)

Cluny
Cluny

Reputation: 41

If you just want something like what's in the image you posted, you're probably best off just texturing a rectangle with a water-like animation.

If you really want to simulate liquid, that LiquidKit repo looks very promising, I'd just read the Usage section in their readme.

Otherwise you could look into: https://en.wikipedia.org/wiki/Shallow_water_equations

or: https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics

both of which will be significantly more mathematically intensive but overall is just depends what you want to achieve.

Upvotes: 4

Related Questions