Build a Meccha Chameleon-Style Camouflage Game in Phaser 3


Controls: WASD or arrow keys to move, click the room to eyedropper its colour, or tap a swatch, and press Space to taunt. On a phone, use the on-screen buttons. To open it full-screen, go to the game page.

By the end of this tutorial you will have a working browser game in which you paint a chameleon to match the room around you, then survive AI hunters sweeping the space with vision cones — the same camouflage idea that made Meccha Chameleon a breakout hit, rebuilt as a single-player Phaser 3 prototype you can extend.

A note on honesty before we start: the prototype embedded at /games/meccha-chameleon-phaser.html was built and shipped separately by the site team. What follows describes what that build does, feature by feature, so you can read the code with the finished game open in another tab. This article is written from the sources linked below and from the shipped build’s own specification — it is not a first-person account of building, playtesting, timing or benchmarking it.

The facts behind the inspiration

  • Meccha Chameleon is a multiplayer casual hide-and-seek game made by two Japanese indie developers: Lemorion_1224 (director, designer, artist, publisher) and Haganeiro (programmer), built in Unreal Engine 5 in two months (Wikipedia).
  • It released for Windows on 10 June 2026 and for Nintendo Switch 2 on 9 September 2026 (Wikipedia).
  • It won the Movement Award at the 2026 Japan Game Awards (Wikipedia).
  • It sold more than 20 million copies by August 2026 and peaked at over 340,000 concurrent players on Steam (Wikipedia).
  • It sold 1,000,000 copies in its first four days (Epic Games developer interview).
  • Its Steam page is the product listing if you want to see the game itself.

What Meccha Chameleon actually does

Meccha Chameleon puts white bipedal characters into a room and splits them into hunters and chameleons. Chameleons blend in by painting their characters; hunters have to find them before the timer runs out (Wikipedia). The painting tools are a color picker and an eyedropper — the eyedropper samples a colour straight from the world, which is exactly the shortcut our prototype takes.

The chameleons themselves are configurable. There are five body shapes — blobby, cubic, Macho, Octopus and Polygon — and three sizes: petite (half normal), normal and plump (twice normal). Two poses let you curl up or lie down, and chameleons can also create clones to split the hunters’ attention (Wikipedia).

Four modes structure the play: Infection (a caught chameleon becomes a hunter), Double (everyone hides first, then everyone hunts; most finds — or first to find everyone — wins), Reverse Chicken Race (a paint phase, paint jobs displayed on pedestals, then a hunt after an observation window) and Team Battle (teams take turns as hider and seeker) (Wikipedia).

Two smaller systems matter more than they sound. Chameleons can whistle to taunt hunters, which helps hunters locate them, and a forced taunting setting forces a taunt after a set period — so hiding is never fully safe. There is also a free camera mode (Wikipedia).

The design came from an artist on television painting themselves to blend into their surroundings, and the lineage is a twist on Prop Hunt: hiders do not turn into props, they paint themselves, and seekers find them and shoot them (Epic Games developer interview). The Lumen rendering system mattered because baked lighting made dynamic characters look disconnected from the scene; dynamic lighting let players disappear into dark areas and among objects (Epic Games developer interview).

The director puts the whole design in one line: “It’s not just hiding spots and poses, but how well you can paint—your drawing skill—that determines the outcome.” (Epic Games developer interview)

The mechanic, as a number

Camouflage in our prototype is a distance between two colours — the colour you painted yourself and the colour of the paint zone you are standing on — plus a movement penalty. That single formula is the entire game.

We use a weighted RGB distance, the “redmean” approximation. It gives the green channel a fixed weight of 4, and scales the red and blue weights by how red the pair of colours is — red carries 2 + r̄/256, blue carries 2 + (255 − r̄)/256, where r̄ is the average red value of the two colours. It is cheap, and it is a stand-in for perceptual metrics such as CIE76 and CIEDE2000, which exist for exactly this job (color difference). To be plain about it: this approximation makes no claim to numeric perceptual accuracy. It is a heuristic that happens to behave sensibly, and that is all it needs to be.

Why does one number make the game tunable? Because every difficulty question becomes a question about coefficients rather than about content. How fast should a hunter notice you? That is the fill rate on the suspicion meter. How much should running cost you? That is the movement penalty. How many hunters, how long per room? Those are escalation tables. You can change the feel of the game without drawing a single new sprite.

Building it in Phaser 3

The shipped prototype is one Phaser 3 scene on a 960x600 logical canvas, scaled with Phaser.Scale.FIT and Phaser.Scale.CENTER_BOTH — the scale manager’s combination that lets one canvas fit phones and desktop (Scale manager).

Everything visible is drawn at runtime with Graphics, which draws shapes and geometry with no image assets needed (Graphics). That is how the room’s flat-coloured paint zones, the crates, the rugs and the player’s bipedal blob all exist without a single sprite file.

Paint zones with hex colours

const ZONES = [
  { x: 40,  y: 300, w: 260, h: 220, color: 0x3d6b4a },
  { x: 340, y: 300, w: 280, h: 220, color: 0x8a4b3c },
  { x: 660, y: 300, w: 260, h: 220, color: 0x4b4a7a },
];

this.zoneGraphics = this.add.graphics();
for (const z of ZONES) {
  this.zoneGraphics.fillStyle(z.color, 1);
  this.zoneGraphics.fillRect(z.x, z.y, z.w, z.h);
  this.zoneGraphics.fillStyle(0x000000, 0.25);
  this.zoneGraphics.fillRect(z.x, z.y + z.h - 14, z.w, 14);
}

Eyedropper sampling, colour lerp and swatch fallback

this.painted = new Phaser.Display.Color(0xffffff);
this.target = new Phaser.Display.Color(0xffffff);

this.input.on('pointerdown', (pointer) => {
  const zone = zoneAt(pointer.x, pointer.y);
  if (!zone) return;
  const c = Phaser.Display.Color.HexStringToColor(zone.color.toString(16).padStart(6, '0'));
  this.target.setColor(c.color);
});

// each frame: lerp displayed colour toward the sampled colour, then tint the whole body
this.painted.lerp(this.target, 0.18);
this.player.setTint(Phaser.Display.Color.GetColor(
  Math.round(this.painted.r), Math.round(this.painted.g), Math.round(this.painted.b)));

// fallback: a wheel of swatches, click one to adopt that colour
this.swatches.forEach((hex, i) => {
  const s = this.add.circle(60 + i * 34, 560, 14, hex).setInteractive();
  s.on('pointerdown', () => this.target.setColor(hex));
});

Weighted RGB distance against the standing zone

function redmean(a, b) {
  const r = (a.r + b.r) / 2;
  const dr = a.r - b.r, dg = a.g - b.g, db = a.b - b.b;
  const wr = 2 + r / 256, wg = 4, wb = 2 + (255 - r) / 256;
  return Math.sqrt(wr * dr * dr + wg * dg * dg + wb * db * db);
}

function zoneAt(x, y) {
  return ZONES.find(z => x >= z.x && x <= z.x + z.w && y >= z.y && y <= z.y + z.h);
}

Hunters sweeping with vision cones

this.hunters.forEach(h => {
  const toPlayer = Phaser.Math.Angle.Between(h.x, h.y, this.player.x, this.player.y);
  const diff = Phaser.Math.Angle.Wrap(toPlayer - h.facing);
  const seen = Math.abs(diff) < h.coneHalfAngle
    && Phaser.Math.Distance.Between(h.x, h.y, this.player.x, this.player.y) < h.range;

  const zone = zoneAt(this.player.x, this.player.y);
  const contrast = redmean(this.painted, Phaser.Display.Color.HexStringToColor(zone.color.toString(16).padStart(6, '0')));
  const rate = seen ? (0.25 + contrast / 255) * (this.player.moving ? 1.8 : 1) : 0;
  if (seen) {
    this.suspicion = Phaser.Math.Clamp(this.suspicion + rate * h.fillScale, 0, 1);
  } else {
    this.suspicion = Math.max(0, this.suspicion - 0.28 * dt);   // decay keeps hiding viable
  }
});

The taunt, in three lines

// Space: pull every hunter toward the noise for 2.6 seconds, then pay for it.
doTaunt() {
  if (this.tauntCooldown > 0) return;
  this.tauntCooldown = 6;
  this.tauntTimer = 2.6;      // hunters retarget to the player while this runs
  this.suspicion += 8;        // and you are momentarily louder than your paint
}

Rooms, escalation and a saved best time

// Three rooms, 60 seconds of survival in total, one more hunter each time.
this.rooms = [
  { seconds: 24, hunters: 1 },
  { seconds: 20, hunters: 2 },
  { seconds: 16, hunters: 3 },
];

advanceRoom() {
  this.roomIndex++;
  if (this.roomIndex >= this.rooms.length) { this.win(); return; }
  const cfg = this.rooms[this.roomIndex];
  this.timeLeft = cfg.seconds;
  this.spawnHunters(cfg.hunters);
  this.state = 'playing';
}

saveBest(cleared) {
  const best = Number(localStorage.getItem('aigd_meccha_best') || 0);
  if (!best || this.totalSurvived > best) {
    localStorage.setItem('aigd_meccha_best', String(this.totalSurvived));
  }
}

Balancing the difficulty

Every knob below is a number in one place, which is the payoff of the “camouflage as a distance” model.

  • Contrast weight — how much a colour mismatch contributes to the suspicion meter.
  • Movement penalty — the multiplier applied while you are moving; it is what makes standing still meaningful.
  • Suspicion fill rate — how fast a hunter’s meter climbs when it can see you, and how fast it decays when it cannot.
  • Per-room timer — the prototype survives a 60-second timer across three rooms, and each room shortens the timer and adds a hunter.
  • Hunter count — one hunter, then one more per room.
  • Taunt risk/reward — the prototype’s taunt key pulses sound, mirroring the original’s whistle taunt: hunters turn and walk toward the noise for a couple of seconds, so it is a deliberate risk, never a free action.

Controls are WASD / arrow keys, or on-screen buttons on mobile, and the build includes death and win states, restart, and a saved best time.

The method behind that tuning is worth stealing. The developer said: “I first build out the minimum overall system so it runs. Then I add graphics and playtest in parallel.” (Epic Games developer interview) Get the loop running, then tune it against real play rather than theory.

One Phaser detail helps here: tint takes the pixel colour values of a Game Object’s texture and combines them with the tint colour value, and one colour value tints the whole object (Tint). That is why one setTint call carries your whole camouflage state — the entire body shifts at once, because the sprite texture is pure white and the tint supplies the colour.

What you learned

The original game is a multiplayer hit with four modes, five body shapes, three sizes, poses, clones and a whistle (Wikipedia). Our prototype is one scene, one blob and three rooms. That gap is instructive, not embarrassing: the original’s own lineage is a twist on Prop Hunt where hiders paint instead of disguise as props (Epic Games developer interview), and it shipped from a two-person team that had previously built Fortnite experiences in UEFN — Lemorion shipped about 30 UEFN games in roughly 18 months, and Meccha Chameleon is only his second multiplayer game (Epic Games developer interview).

The lesson is that the idea is the hard part and the content is the cheap part. “Camouflage is a distance between two colours plus a movement penalty” is a complete game design on one line. Everything else — rooms, hunters, timers — is a number you can move.

FAQ

Do I need an artist or any image assets to build this?

No. The prototype draws everything with Phaser’s Graphics, which renders shapes and geometry at runtime with no image assets needed (Graphics). The player is a graphics-drawn bipedal blob, the room is flat-coloured paint zones, and the whole thing ships as a single HTML file.

How does the eyedropper decide what colour to sample?

It samples the hex colour of the paint zone under the cursor and sets that as the target colour; the player’s displayed colour lerps toward it each frame, so repainting looks like a wash rather than a snap. A wheel of swatches sits underneath as a fallback if the cursor is over nothing.

Can I play it on my phone?

Yes. The scale manager’s FIT and CENTER_BOTH modes let one canvas fit phones and desktop (Scale manager), and the prototype adds on-screen buttons alongside the WASD and arrow-key controls.

Key takeaways

  • Camouflage can be reduced to a single formula: colour distance plus a movement penalty, and one formula makes a whole game tunable.
  • The original’s own design puts drawing skill above hiding spots and poses, which is why the mechanic survives the translation to a much smaller game.
  • Phaser’s Graphics and tint let you build an entire art-free game: shapes at runtime, one colour value applied across a whole object.
  • FIT and CENTER_BOTH in the scale manager make a single canvas work on phones and desktop.
  • Difficulty lives in a handful of coefficients — contrast weight, movement penalty, fill rate, timer, hunter count, taunt risk — so balance changes do not require new content.
  • Ship the minimum system that runs, then add graphics and playtest in parallel, the way the two-person team behind the original worked.