A while ago I made a devlog about how I made the water bodies in PokeyPoke, a few people since then have asked for the code and I never shared it on the basis that I didn't really consider it "tutorial worthy" in that while it works for me, I don't know that this is the best way to do this. It feels poorly optimized and I would worry about people blindly leaning on something I threw together for my game.
But I decided, with the above disclaimer in mind, that I would share it with Patrons.
I've extracted the water object and shader from PokeyPoke and put it into its own .yyz for you to uh, poke around in.
It operates on a crude interpretation of "Hookes law" and creates a series of "springs" that can affect their neighbors with a dampening effect. The splash doesn't look amazing without adding some of your own effects IMO. But the general water waves (created by just combining a few sine waves together, and some surface manipulation in order to also wave the background) I think looks quite nice.
Maybe this is helpful for some of you, or maybe serves as a nice spot for creating your own similar systems. I hope it is helpful or at least interesting!











