Tony ZharoffInteractive portfolio

Game development course

Build Chip’ums

Follow a cozy puzzle game from its first browser board to mobile release prep. Try the decisions that shaped the game, then build a version of your own.

Start the first lesson
Chip’ums: Cozy Circuits12 lessons plannedFirst lesson availableBasic HTML, CSS, and JavaScript

Lesson 1 · Game rules

Make a playable board

Connect two matching chips with a horizontal or vertical wire. It can bend at most twice and can only pass through empty cells between the endpoints. For this practice board, keep the wire inside the grid.

Predict the route

Both A chips are on row 2, in columns 2 and 4. A blocked cell sits between them. Can they still connect?

Practice grid. A marks a matching chip, ■ a blocked cell, and · an empty cell.
12345
1·····
2·A■A·
3·····
4·····
Reveal the route

Go up from the first A, across row 1, then down into the second A. Up to right is one bend. Right to down is the second. The open row below works too.

Build it

  1. Represent the grid as rows of cells. Use a chip type such as A, null for an empty cell, and a separate value for an obstacle.
  2. When a player chooses two cells, check that they are distinct and contain matching chips.
  3. Search out from the first chip in the four cardinal directions. Track the current cell, the direction you entered from, and how many turns you used. The first move is free. Each direction change adds one turn.
  4. Skip occupied cells other than the destination, neighbors outside the grid, and moves that would add a third bend. Remember each visited combination of cell, direction, and turn count so the search terminates.
  5. Return a path when you reach the second chip. Draw the wire and clear the pair only after a valid path comes back.

Check your work

  • Accept straight paths and paths with one or two bends.
  • Reject a path that needs three bends, a pair of different chips, and a double-click on the same chip.
  • Keep the board unchanged when a move is rejected.

Try it on your own

Move the obstacle and add a second one. Make a board where the upper route fails and the lower route still works. Trace the answer before running your code.

This board is a teaching reconstruction of the browser game’s core rule. The original build journal starts with the browser game already running.