Skip to content

laverneth/godot_water_splash_gdscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

water_node

What is it?

A 2d water node in pure gdscript for Godot 3.2. You can bring it easily to your project to simulate water like a small river or a pond.

alt tag

Parameters:

  • nb tiles: number of tiles in the x direction
  • Width: width in pixel of each tile (the image in the repo is 32 width by 64 height)
  • Height: height in pixel of each tile
  • Damping: damping of the oscillations of the waves
  • Tension: rigity of the water (high is stiff, low is "fluid")
  • Spread: affect the size of the waves
  • Drag: how velocity of colliding body create wave depending on the x or y component.

Just add a texture to see the water, otherwise nothing is displayed. I have put a sample water texture for you. You can also modify the code to only display a polygon with a color and no texture.

In general, I prefer to have a smaller drag in y than in x if the bodies have to walk inside the water and have a nice wave in front of them. Also it avoids to have a big wave rising when the player jumps in the water.

Sometimes it's better to play a little bit with the parameters to understand how it works. You can add particles, shaders, whatever you want to make the water even more realistic.

Feel free yo use in your awesome project, and do not hesitate to share, I'll retweet it them!

https://twitter.com/thomas_laverne

keep smiling and love for godot!

About

a 2d water splash node for Godot in gdscript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published