2

I'd like to know what is the best method for creating a water line in SpriteKit or even in SceneKit (if this is a better option)?

By water line I mean, an animated wavey line that indicates the level of water in a 2D game - like the game "Jumping Fish" as an example or the game "Fish out of water."

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
AJ_
  • 311
  • 2
  • 12
  • I'd like to see this myself, but if no one decides to post, the easiest result will probably involve creating a row of physics bodies emulating springs that are bounded by joints so as to produce a wave. Then, carefully made emitter nodes would be used for the splash effects... – MaxKargin Aug 02 '15 at 14:07

1 Answers1

0

Chipmunk2D, with a rig of connections that recreates a faux soft body dynamics for the surface and surface tension, with a limitation to "stretch" that's different for down vs up so waves created by surface tension release form crests when the fish goes up, but nothing as sharp when the fish dives in.

I imagine he's using fake fish objects to "break" the surface, both up and down. The moment these objects bounce because they've reached the extents of the surface "soft body" constraints movement range, he's probably deleting them and giving the fishSprite the anticipated breakthrough velocity. Or some other kind of "hacky" way to create the impression of breaking the surface.

The harmonics of movement throughout the chain of surface units via their connection as a fake soft body chain will need fine turning to get something you desire.

Plus buoyancy for any and all floating objects.

Probably not quick to do with anywhere near the visual conviction apparent in that game.

If you wanted to try for a more creative approach than exact replication, you could use an approach similar to this:

http://google.github.io/liquidfun/

Another way of doing this is also available via google:

https://www.youtube.com/watch?v=Ss89OpQ_u54

And here's another inspirational video on how to possibly do it the hard way:

https://www.youtube.com/watch?v=_rCowyFle6c

Confused
  • 6,048
  • 6
  • 34
  • 75