Color flood

Hi! I’d like to make a little game like this http://www.lemoda.net/javascript/flood-it/

Do you have any suggestions on the best way to do it? also general ideas. whatever node comes to your mind.
thanks

i remember this: https://discourse.vvvv.org/

thank you ton!
what I want to do is a little bit different.
I have a grid of quads with different colours and, starting from the quad at slice 0, I need the logic to check the colours of the nearby quads. If the colour is the same then it should check the nearby and so on.

What I’m doing now is using a lot of ADD, EQUAL, >, < and AND nodes :) and I don’t know if I’m doing right. I’ll see.

yes, that is exactly what the shader is doing. so create an initial colored texture with the pixel size of your game and set the start pixel of the shader where in the upper left corner. then change the color of the start pixel for every move and it will fill the surrounding pixels. to draw your game scale up the texture in nearest neighbour mode to get nice fat square pixels…

your approach with a lot of patch logic will get very complicated since you have to find out whats your active area and then only flood neighbours from there.

thank you again ton!
my approach got soon very complicated :)!
I’m trying what you suggested, but I think I didn’t understand it very well.

color_flood_shader.v4p (16.5 kB)

yes some modifications of the shader are necessary. the color management got a bit simpler, but you also have to check for the ‘active’ area. in this example i used the alpha channel to encode whether the pixel is already flooded or not. this means you have to take care of the correct texture formats and i’ve written some comments in the shader.

nice game!

FloodGame.zip (6.8 kB)

awesome! thanks

Thanks for the shader tonfilm

somehow i like the game, therefore now even with game logic:

FloodGame2.zip (432.2 kB)

it is very addictive

awesome!.. no text …