Log In  

Cart #inkspill-7 | 2023-01-29 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

This is a flood-it clone inspired by the game Ink Spill from the book "Making Games with Python & Pygame". This game and also some of the others that I have already done and published here are part of a personal challenge which consists in doing clones of these games.

How to play

In order to win you have to flood the entire board with one color within a certain number of moves. You can do a flood fill on the tip left tile, changing the color of any adjacent tiles of the same color.


  • Change color - ⬅️/➡️
  • Flood fill - 🅾️/Z/C
  • Highlight init cell - ❎/X/V (Note: Only works in init or free mode. In free mode it also lets changing the init cell with the arrows)


Version 1.3

  • Added free mode, which let you change the position of init cell every time, and renamed unlock/lock init cell to "default mode" and "init mode".

Version 1.2

  • Added menuitems to control seeds, repeat board, and animation effect.

Version 1.1

  • Addded menuitem (in the title and gameover screens) that unlocks selection of the init cell.
  • Saves configuration.
P#124698 2023-01-22 22:12 ( Edited 2023-01-29 06:07)

one square left

are all levels possible?

the bigger the board the easier it gets

P#124716 2023-01-23 14:05 ( Edited 2023-01-23 14:17)

Hello @Tatery1! First of all, thanks for playing it.
Yeah, that also happens to me a lot. Honestly, I just copied the maximum number of moves from https://unixpapa.com/floodit/ and added 2 to make it a little easier as each board is made up randomly and there is no difficulty selector as the original one in the book (in which some cells are changed to the colors of their neighbourhoods), so you will always be playing in the "hard" mode. Boards of the same size sometimes will be easier, sometimes will be harder, and maybe some of them will be impossible. However, all the boards of differents sizes may be resolved at some point with a bit of strategy and luck ;)

P#124756 2023-01-24 03:35 ( Edited 2023-01-24 03:43)

Nice simple yet challenging game. I thought it's free spill until the counter hit me.

P#124760 2023-01-24 08:15

Nice game! Simple and fun

P#124770 2023-01-24 13:31

@liconaj no problem!
i finished all the boards.. the game was super fun!

P#124771 2023-01-24 14:03

What an interesting game, @liconaj !

I was wondering if it would be simpler (albeit quicker solution) to let you choose the square to start flood filling rather than starting at the top every time ?

P#124779 2023-01-24 17:19 ( Edited 2023-01-24 17:19)

@dw817, well that's not hard to implement, the algorithm works with any start position of the board, but making the interface would take some time. Here there is a version with global variables for the start position, so you can change it in the runtime and see if it can be easier. Personally, I would think so. Let me know what you find out.

This is an example about how the global variables (flood_x, flood_y) could be modified:

P#124809 2023-01-25 04:35

@liconaj and @dw817 - changing the start position is a really interesting idea. I would love to see this implemented

P#124815 2023-01-25 09:59

@phil and @dw817, done! See changelogs for more information :)

P#124858 2023-01-25 21:32

@liconaj - Thanks for the update. I now find that what I think is a good starting move (usually right in the center) is nothing of the sort.

On a lose, it would be interesting if you could play the same arrangement of colours again to see if the board actually was possible.

P#124879 2023-01-26 09:00

@phil, love the idea! Let me see what I can do.

P#124898 2023-01-26 19:01

Oh no, @liconaj, I did not explain myself well.

What I mean is EVERY time you do a fill, you can specify the coordinates using the ARROW KEYS each time before you fill.

So when you run your cart and the game is going, you have a flashing cursor. Use the arrow keys UP and DOWN to move it where it quickly goes from one square to the next. If you go too vertically low y<0, it starts back at the bottom back over left by one.

If you go too vertically high y>12, it starts back at the top and over right by one.

if y<0 then
  if x<0 then
elseif y>13 then
  if x>13 then

It could also be done with modulos, % yet I was just showing the format it would follow by pressing UP and DOWN on the arrow keys where LEFT and RIGHT still choose the color.

Also GOLD STAR for your hard work and unique gameplay so far.

P#124907 2023-01-27 02:46 ( Edited 2023-01-27 04:10)

Here is an example showing how you can reach all points with only up and down arrow keys, @liconaj.

Cart #diserawajo-0 | 2023-01-27 | Code ▽ | Embed ▽ | No License

... Of course you could also just hold down the ❎ key which is not in use and then use the UP, DOWN, LEFT, and RIGHT arrow keys to select a new point to paint at.

P#124911 2023-01-27 04:18 ( Edited 2023-01-27 04:50)

@phil - Now you can control the seed, and there is a repeat mode to repeat board instead of "restart" (create new board) when the seed is "random".

@dw817 - Liked the idea of using the ❎ key, but with arrows pressed at the same time for speed and simplicity, because it was the easiest to implement with the existing code. Without that hint I wouldn't know how to do it easily. Now you can do that enabling the free mode in the menuitems. Hope you like it and enjoy!

P#124971 2023-01-29 05:57

Hi @liconaj. Glad you like the idea !

For those of you having difficulty finding the Free Mode. It is in the menu BEFORE you start playing the game. If you are already playing the game itself - it will not appear.

P#124979 2023-01-29 14:36 ( Edited 2023-01-29 14:37)

[Please log in to post a comment]