💠 MATCH THREE

Swap two shapes to make a line — then watch the chain reaction

← Back to Fun Time
Score
0
Moves
0
Best chain
0
Best score
0

⌨️ Controls

  • Click a shape, then click the one next to it — they swap
  • move  •  SPACE pick and swap
  • N shuffle the board  •  R new game
  • P pause
  • 🎮 Xbox controller? Just plug it in or pair it — the stick and D-pad are the arrow keys, A is SPACE, Menu pauses and View starts again

🎯 How to play

  • Swap two shapes that are touching to make a line of three or more.
  • The line vanishes, everything above falls down, and new shapes drop in.
  • If the falling shapes make another line, that is a chain — and it is worth more.
  • A swap that makes no line is not allowed: the shapes simply swap back.

🏆 Scoring

  • Each shape cleared is worth 10 points.
  • The second link of a chain is worth double, the third triple, and so on.
  • So one big chain beats a lot of small matches.
  • Look for swaps that drop shapes onto other shapes of the same kind.

🧑‍💻 For young coders: build this game yourself

This game is split into small library files inside funtime/lib/, and every function has a comment saying exactly what goes in, what comes out, and the algorithm in plain English. Empty any function out, read its comment, and write it yourself.

File What it does Good functions to try re-writing
lib/match3-rules.js The rules: swapping, matching, falling, cascading swapGems, findMatches, applyGravity, trySwap
lib/match3-draw.js Painting six shapes that need no colour drawShape, drawGrid, renderGame
lib/match3-main.js The glue: clicks, the keyboard, the cursor doAction, connectBoard, setUpGame

💡 The big idea: make a copy, then decide. Every swap happens on a copy of the board first. If it turns out to be a bad move, the copy is thrown away and the real board never knew. Undoing is free when you never changed anything in the first place.

🛠️ Want to be walked through it? Build Match Three Yourself takes you through the key functions one step at a time and tests each one you write. There is a Python version too.