comander derp
comander derp

Reputation: 63

How would I implement the flood fill algorithm in GameMaker?

So, I have implemented cellular automata into one of my games in GameMaker. But there are tons of disconnected caves... So does anyone know how to implement an algorithm like Flood Fill?

Upvotes: 0

Views: 661

Answers (1)

mystery
mystery

Reputation: 19513

Have your automata check their immediate neighbours (the four pixels above, below, left and right). If the checked neighbour is the colour they're targeting, spawn an automaton there.

Upvotes: 0

Related Questions