How to create game like where's my water

I have no idea how to code the effect like where’s my water ipad game. I’d like to create something like that using the mouse. I was planning to add an entry like that for java4k this year… but no idea. Or maybe something like worms armaggedon.

Any tips? Thanks!

I’m used to create very simple games using tiled maps. Is it possible to create such effect using tiles? thanks

Perhaps you could be more specific: what exactly is the effect you’re looking at creating? I’ve never heard of the game you’re talking about, and you might be talking about different aspects of it.

So, what specific effect or mechanism are you trying to achieve?

I would assume he probably means the water/physics based model

Although I haven’t ever designed/implemented something like that.
For the physics/water itself, one way to implement it that I could think of is to have balls/nodes/particles.

Each node would attempt to keep itself a minimum distance(not forced minimum) from other nodes. If the node was too close, it would simply exert a repulsion force. however would have some mild elasticity to other nodes to keep it ‘together’, up to a particular distance.

here is an example using ‘square nodes/particles’


This example has no special effects or modifications to the graphics.

As you can see I’ve highlighted in red what I believe are the individual nodes, occasionally in the game, you can sorta see the artifacts of this approach. Most of the time they are ‘bundling’ or ‘grouping’ together, but each droplet can be represented as such.
Although I am sure there are some defined shapes/colors as static images, I’d imagine there is some procedural manipulation/generated imagery going on.

Depending on how big your particular node/particle is, would influence a lot on the water’s appearance. However fluid mechanism in game has always been a very difficult thing to do, at least in larger scale. Since it is usually represented as entities or object, in water you will often have a high order of magnitude to represent more realistic water.


6 million particle engine simulation.

Whereas in where is my water, they are representing water in very low amounts of particles/nodes, for 2 reasons. Mobile devices can’t handle the higher amounts of calculations. Also its quite apparent in the way the water looks and moves, that its being represented with a relatively low number of particles.

I would suggest you start looking at physics simulations and particle engines as a good place to start.

I’ve used steering behaviors before to good success. I used a separation and cohesion behavior, as well as a simple gravity behavior. To render the particles was “simple”. Group up the particles based on their distance from each other, then compute the convex hull for each group, then add some buffer around that hull (to round of corners and what not). If you don’t want to go the computational geometry route for drawing, you could just render particles larger than the separation distance. If you’re using OpenGL you could use blending to blend the particles together.