EvonX

Game creation guide

How to make a water sort puzzle game

A water sort puzzle is a set of tubes, each holding stacked layers of colored liquid. The player pours the top color from one tube into another, but only onto the same color or into an empty tube, and only as much as fits. The level is solved when every tube holds a single color. The rules take minutes to code; the real work is generating levels that are always solvable and get harder in interesting ways.

Water sort template made with EvonX: glass bottles of layered colored potion on a shelf
A frame of the water & ball sort template running in EvonX.

A prompt to build your first version

Copy it into EvonX, or send it from the box at the end of this page. Change the theme, the numbers and the twist to make it yours.

Create a water sort puzzle game with glass tubes of colored liquid where I tap a tube and then another to pour the top color onto the same color or into an empty tube, a tube full of one color is sealed, hidden colors appear in later levels, there are undo and extra tube boosters, 20 levels that get harder and a level complete screen.

Other directions to try:

  • A ball sort puzzle with colored balls in test tubes and a calm ocean theme
  • A cocktail bar sort puzzle where each glass must end up as one drink, with locked glasses that open after three pours

How water sort puzzles work

Water sort, ball sort and potion sort games all run on the same stack rules. Understanding them as stacks makes both the code and the level design much simpler.

  • Each tube is a stack

    A tube holds up to a fixed number of units (often four). Only the top run of same-colored units can move. Everything below is locked until the units above it leave.

  • A pour has two conditions

    The target tube must be empty or have the same color on top, and it must have free space. If both are true, move as many units of the top run as fit.

  • Empty tubes are the key resource

    Levels usually include one or two empty tubes. They are the only place to park a color while you dig something out, so how many there are is the main difficulty setting.

  • The win is total, the loss is a dead end

    The level is solved when each tube is either empty or full of one color. Many games have no move limit; the player is stuck only when no legal pour remains, which is why undo and an extra tube are popular boosters.

  • Twists add information or constraints

    Hidden layers show a question mark until uncovered. Locked tubes cannot be poured from, or open only after a condition. Each twist changes what the player knows or can do, not the pour rule itself.

Step by step: building a water sort game

  1. 1. Represent tubes as arrays

    Each tube is an array of color ids from bottom to top, with a capacity. This makes the rules a few lines of code and keeps the game state easy to save and undo.

  2. 2. Select and pour

    First tap lifts a tube; second tap on a valid target pours. Tapping the same tube again puts it down. Show invalid targets clearly so players understand why a pour was refused.

  3. 3. Animate the pour

    Move the tube over the target, tilt it and stream the units across. Update the data immediately and let the animation catch up, so fast players are never blocked.

  4. 4. Detect completion

    After each pour, seal any tube that is full of one color and check whether all tubes are sorted.

  5. 5. Generate solvable levels

    Either start from a solved state and apply random reverse pours, or generate a random shuffle and run a breadth-first or depth-first solver to confirm a solution exists before keeping the level.

  6. 6. Undo and boosters

    Keep a history stack of moves so undo is a pop. An extra empty tube booster is a simple and generous rescue.

  7. 7. Introduce twists one at a time

    Hidden colors, then tubes that only accept pours, then covered tubes that open when a specific color is finished. Give each one an intro level.

  8. 8. Make it calm and satisfying

    This genre is often played to relax. Soft sounds, smooth pours and a pleasing seal effect on finished tubes matter more than speed.

Level design and difficulty

The main levers are the number of colors, the number of empty tubes, and how deeply each color is buried.

Level design and difficulty
StageWhat changes
Early levelsThree or four colors, two empty tubes, colors only one layer deep.
Middle levelsFive colors, one empty tube, colors spread across several tubes.
Twist levelsHidden layers or locked tubes introduced, with slightly easier layouts to compensate.
Hard levelsSix colors, minimal free space, and a solution that requires parking colors in a specific order.

Build it with EvonX

  1. 1. Describe the game

    Paste the prompt above or write your own. Naming the genre is enough for EvonX to start from its water & ball sort template.

  2. 2. Play the first version

    The game runs in a phone preview next to the chat, so you can play it as soon as it is built.

  3. 3. Change it in chat

    Ask for different levels, rules, art or difficulty and test each change straight away.

  4. 4. Publish a link

    Published games open in mobile and desktop browsers, on the free Starter plan too (with the EvonX badge). EvonX does not package games for the App Store or Google Play.

What the water & ball sort template already includes

  • Bottles of colored potion: tap one to lift it, tap another to pour
  • Pours that move the whole top run onto a matching color or into an empty bottle, as much as fits
  • Finished single-color bottles that cork themselves
  • Hidden layers, stone rings (pour in only), cloth covers and lids that count down
  • Undo, extra bottle and hint boosters
  • 20 starter levels, up to six colors, with no move limit

Ways to make it your own

  • Liquid, balls, potions, sand or drinks
  • Tube capacity and how many tubes
  • Number of colors per level
  • Hidden layers, locks and other twists
  • Move limit or no move limit
  • Theme and sounds, from one sentence

Common problems and how to fix them

  • Some levels cannot be solved

    Generate levels by reversing pours from a solved state, or run a solver on each shuffled layout before keeping it.

  • Levels are solvable but boring

    Measure the shortest solution length and how many times a color must be parked in an empty tube. Raise those numbers gradually instead of only adding colors.

  • Colors are hard to tell apart

    Limit the palette to clearly different hues, and consider adding a pattern or symbol per color for color-blind players.

  • Players feel stuck with no way out

    Offer undo and an extra empty tube, and detect when no legal pour remains so you can suggest a booster rather than leaving the player guessing.

FAQ

How do I make sure every water sort level is solvable?

Build each level backwards from the solved state with reverse pours, or run a solver over random layouts. The EvonX template ships with 20 starter levels and you can ask for more.

What is the difference between water sort and ball sort?

Only the look. Both use stacks with a capacity and the same rule about pouring onto a matching color. Ball sort usually moves one ball at a time; water sort moves the whole top run.

Should a water sort game have a move limit?

Many popular versions do not; the challenge is finding the order. A move limit makes it more stressful. The EvonX template has no move limit, and you can ask to add one.

Can I make a sort game without code?

Yes. Describe your theme to EvonX; it starts from the sort template with pours, sealing, twists and boosters working, and you adjust it in chat.

Make your own water & ball sort game

Start from the prompt, or describe something new. Building and playing in the preview are free.

Free to start · Earn money from your games
Try one