miwale

Toy Bricks — Game Art Style Spec

A toy-box world of glossy plastic bricks: stud-covered baseplates, tiled roads, transparent-blue water plates and a little toy figure.

Everything on screen is built from interlocking plastic parts — bricks, plates, smooth tiles and round bricks — seen from a steep 3/4 front view. A small cell renderer bakes every model once at startup: each part gets a glossy vertical gradient, a sheen band, a lit rim along its top edge, dark gaps where it meets other parts and a round stud with a white highlight crescent on every open top. The ground is an endless green baseplate covered in studs, with raised lime and grey plates whose front edges show, smooth grey road tiles with white lane dashes and transparent-blue water plates one plate lower. The main character is a molded toy figure (yellow cylinder head with a printed face, claw hands, pith helmet); the creatures are a red brick beetle with eye studs, a translucent ghost piece and a brick-built robot. Saturated toy-box primaries, clean studio light, no texture and no outlines.

At a glance

Family3D Look · Toy Bricks
Moodplayful, cheerful, tactile, bright, nostalgic
Best forfamily and kids games, top-down action/arena games, builder and sandbox games, puzzle and party games, casual mobile
RendererCanvas 2D + a small brick-cell renderer and a vector figure painter (sprites baked at init)
Pixel artNo — native resolution, sprites baked at ~1.6× screen scale, blits snapped to screen pixels
Complexity4/10 — props and creatures are a few part() calls; molded figures are hand-written paths
FontsTitan One (titles, counters, step numbers), Fredoka 400–700 (card text, labels)
Key colours#47a347 baseplate · #666d73 road tile · #3d92e8 water plate · #d4231c red · #f7c81e yellow · #1c5fc6 blue · #f7c51e figure yellow · #1b1d22 print black

When to use it

Color palette

SwatchHexRole
Baseplate Green#47a347Main ground plate with studs (~55% of the screen)
Dark Baseplate#2f8540Darker green patches (woods)
Lime Plate#8cc63fRaised plates (+1 plate), front edge visible
Sand Tan#e2cb96Tan baseplate around water
Road Tile#666d73Smooth 2×2 road tiles; lane dashes #eeeee8
Curb Tile#c6cbceOne-stud light grey border of roads
Plaza Grey#a7acb0Raised light grey plates; light grey parts
Water Blue#3d92e8Transparent-blue water plates (−1 plate), deep #2b70d2, studs #8fcaff at 0.75 alpha
Toy Red#d4231cBeetle body, fruit, house walls; dark red #9e1d18
Toy Yellow#f7c81eFruit, robot shoulders, projectiles, bars
Toy Blue#1c5fc6Robot torso, counter panel
Leaf Green#21883fTree crowns with bright green #4caf48, dark green #1d6b34, lime #8cc63f
Toy White#f2f2ecFences, eye studs, windows, white panel
Toy Black#2a2c31Feet, lamp posts, robot hips
Reddish Brown#7b4527Trunks, posts, backpack
Dark Grey#5f666cRobot legs, rocks, roofs
Toy Orange#f07e1fFigure shirt, cones; transparent orange #ff9a26 beacons
Figure Yellow#f7c51eFigure head and claw hands
Figure Blue#1f4f9aFigure legs
Ghost Clear#cde8ffTranslucent ghost (0.5–0.78 alpha)
Collectible Azure#2f9bffSmall stud coins; large coins #ffc81e
Print Black#1b1d22Printed faces, card borders, title outlines

Transparent parts: water #62b0ff @0.62, clear #e6f4ff @0.5, red #ff3b2b @0.88, yellow #ffd84a @0.88, orange #ff9a26 @0.86.

Palette rules

Typography

Titan One 400 — titles, big counters, step numbers, floating numbers. https://fonts.google.com/specimen/Titan+One

.title   { font: 400 66px/1 'Titan One', 'Fredoka', system-ui, sans-serif; color: #f7c81e; letter-spacing: 2px;
           -webkit-text-stroke: 3px #1b1d22; paint-order: stroke fill;
           text-shadow: 0 5px 0 #1b1d22, 0 9px 0 #d4231c, 0 12px 0 #1b1d22, 0 22px 24px rgba(20,40,80,.35); }
.counter { font: 400 34px/1.05 'Titan One', sans-serif; color: #1b1d22; text-shadow: 0 2px 0 rgba(255,255,255,.55); }
.step    { font: 400 40px/1 'Titan One', sans-serif; color: #1b1d22; }   /* booklet step number */

Fredoka 400/500/600/700 — card titles, body copy, labels, hints. https://fonts.google.com/specimen/Fredoka

.card-title { font: 700 20px/1.15 'Fredoka', system-ui, sans-serif; color: #1b1d22; }
.card-text  { font: 500 15px/1.3 'Fredoka', system-ui, sans-serif; color: #3b4652; }
.label      { font: 700 11px/1 'Fredoka', sans-serif; letter-spacing: 3px; color: #5a4300; }

Titles are outlined with a 3 px #1b1d22 stroke and "built up" from hard stacked shadows (black, red, black) like a sticker on a box. Floating in-world numbers (canvas): Titan One 7.5 units (emphasised 10), stroked twice with #1b1d22 (1.7 / 2.2 units, the first stroke offset 0.6 down), white fill (emphasised #f7c81e).

Rendering technique

Grid. A model is w × d × h cells: x right, y toward the viewer, z up. One cell = 1 stud × 1 stud × 1 plate. On screen: 1 stud = SX = 6 units across and SY = 4.2 units deep, 1 plate = PH = 2.1 units tall (a brick = 3 plates = 6.3 units). Each cell stores a colour and the id of the part it belongs to; parts are added with part(x, y, z, w, d, h, colour, { tile, round, print }), plus shortcuts brick (h = 3), plate (h = 1) and tile (h = 1, no studs).

Projection. Straight front view, no yaw: screen x = (x − w/2)·SX, y = (y − d/2)·SY − z·PH. Only top faces and front faces exist, and every face is an axis-aligned rectangle — so coordinates can be rounded to whole pixels and neighbouring cells of one part never show hairline seams.

Order. Rows back to front (y ascending), within a row plates bottom to top (z ascending). A cell can only hide cells behind and below it, so this simple loop is a correct painter's order — studs drawn with their cell are automatically covered by anything in front.

Per cell.

  1. Front face if the cell in front is empty (or round): fill with the part's vertical gradient (spans the whole part, not the cell: ×1.2+12 at 0, ×1.02 at 0.13, ×0.88 at 0.6, ×0.7 at 1), then the part's horizontal sheen (white 0.05 → 0.24 at 10% → 0.03 at 22% → clear → black 0.12 at the right end).
  2. Edges: top rim rgba(255,255,255,.6) on the part's top plate; gap line rgba(0,0,0,.4) at the bottom of a part resting on another; left end light .3 (open) or dark gap .36 (different part); right end dark .2 when open. Line width max(1, round(0.28·K)) px.
  3. Top face if nothing is above: flat colour ×1.06+4, white back rim .5 (open behind) or dark seam .3 (different part behind), dark seam on the right when the right neighbour is another part, and a stud unless the part is a tile.
  4. Print: after the part's last front cell, print(ctx, rect, k, mirrored) draws decoration over its whole front face (eyes, grin, windows, arrows, chest panels).

Round parts (1×1 or 2×2) are drawn as cylinder slices when the loop reaches their front row: a rectangle plus the bottom half of the footprint ellipse filled with a horizontal cylinder gradient (×0.95, ×1.2 at 20%, ×1.02, ×0.8, ×0.62), a dark gap arc where they rest on a part, and on the top slice an ellipse (×1.16 → ×1.0) with a white front rim arc, an inner highlight arc and studs.

Studs are baked sprites per colour and resolution: contact shadow ellipse rgba(10,20,40,.26) offset (+0.42, +0.2), cylinder (radius 1.8, height 1.05 units, footprint ry = 1.26) with a horizontal gradient, lighter top ellipse, a faint dark rim, a white highlight crescent (0.34 units wide, angles 1.02π–1.52π at 70% radius) and a faint lit front rim.

Molded figures (main character, ghost, coins) are canvas paths with the same light: horizontal cylinder gradients, white streak highlights on the left, flat prints. They are painted once per frame and facing into sprites.

Baking. K = clamp(round(screenH/360 × 1.6 × 2)/2, 2.5, 7) sprite px per world unit — about 1.6× screen scale so zoomed views stay crisp; sprites are drawn down-scaled with smoothing. Facing left = the grid mirrored in x and baked again (prints receive mirrored), never a flipped sprite, so the light stays on the upper left.

Draw order per frame: ground chunks → water glints → shadows → y-sorted props, creatures and main character → orbiting beacons → projectiles → particles → floating numbers → x-ray copy of the hidden main character → vignette.

World and ground

The ground is an endless baseplate seen from the same front view, drawn row by row into cached 256-unit chunks with integer pixel coordinates (round((x − chunkX)·res)), so chunks line up seamlessly.

Characters

All characters share the upper-left studio light and cast a soft shadow to the lower right. Two construction methods: molded figures (paths) and brick-built creatures (cell grids).

Main character — toy explorer figure (~31 units tall, ~15 wide, feet at the anchor):

Small creature — red brick beetle (4 × 3 × 6 cells, ~24 × 26 units): a dark grey 2×3 base plate, a 2×3 red brick body with a printed black grin and two white fangs, a dark red 2×2 shell plate on the back, two white 1×1 round bricks (2 plates tall) on the front as eyes with black pupils looking toward the facing direction, and black 1×2 side feet that jump one stud forward/back per frame.

Fast creature — translucent ghost piece (~20 wide, ~20 tall): a sheet with a round head (radius 6.2), raised stubby arms and a four-scallop wavy hem; fill is a radial gradient from rgba(250,253,255,.5) to rgba(150,200,245,.78) at the edges, a 0.75-unit white rim, an inner rgba(110,165,225,.45) rim, a white gloss arc on the head and a streak on the left. Printed face: black oval eyes (1.05 × 1.5) with white glints and an O-mouth. Hovers 4 ± 1.6 units with a faint additive blue glow; 4 frames animate hem and arms.

Large creature — brick robot (7 × 3 × 18 cells, ~42 × 52 units): dark grey 2×3 feet and 2×2 legs (one leg lifts a plate per step), a black hip plate, a blue 5×3 torso of two stacked bricks (lower one printed with a 4-slot grille, upper one with a yellow chest panel, three dark lines and a glowing red core), light grey 1×2 arms with yellow shoulder plates and red hands (arms swing one stud), a light grey 3×2 head printed with two glowing red eyes and a mouth grille, a black round antenna with a transparent red tip. Additive red glows sit on the eyes, core and tip.

Rules

Props

Props are cell grids on the same stud grid as the ground. Their footprint snaps to whole studs (x = i0·6 + w·3, y = j0·4.2 + d·2.1), they are lifted by 2.1 units on raised plates, y-sorted with the figures (sort key = anchor + 0.3·depth) and each has a baked footprint shadow.

Placement: a jittered 46-unit grid; a prop stands only if every footprint cell has the anchor's material and the row in front does too (never on plate edges, roads or water; cones and lamps may stand on curbs). Tall props (trees, pines, lamp, house) fade to 0.32 when the main character is behind them; the figure is then redrawn over them at 0.72.

Effects and particles

Atmosphere and lighting

UI

The HUD is brick-built; the cards are instruction-booklet pages.

Motion and animation

Do and don't

Do

Don't

Implementation recipe

  1. Define the grid constants (SX = 6, SY = 4.2, PH = 2.1) and a colour list of flat toy colours (transparent ones with alpha).
  2. Write the cell grid: part(x, y, z, w, d, h, colour, {tile, round, print}) storing colour + part id per cell; add brick/plate/tile helpers and mirror().
  3. Write the stud sprite baker (cylinder gradient, top ellipse, crescent, contact shadow), cached per colour and resolution.
  4. Write the renderer: loop y, z, x; draw front faces with the part gradient + sheen + rims/gaps, top faces + studs, round parts as cylinder slices, prints last. Round all coordinates.
  5. Bake a shadow per grid (sheared footprint, blurred).
  6. Paint the molded figures with paths and bake idle/walk/dash frames for both facings.
  7. Build the baseplate: per-cell material + level, rows back to front, front faces on level drops, seams, studs, toy parts; cache 256-unit chunks.
  8. Place props on whole studs, y-sort with figures, fade tall props over the figure and redraw it as an x-ray copy.
  9. Effects: tumbling baked loose parts, star sparkles, stud rings, stud coins.
  10. HUD: brick panels with CSS stud rows, stud-covered bar fills, booklet cards with step numbers and callout boxes.

Code

1. Parts on a grid

const SX = 6, SY = 4.2, PH = 2.1;               // stud across, stud deep, plate height (world units)
function model(w, d, h) { return { w, d, h, cell: new Int32Array(w * d * h), parts: [null] }; }
function part(m, x, y, z, w, d, h, col, o = {}) {
  const id = m.parts.length;
  m.parts.push({ x, y, z, w, d, h, col, tile: !!o.tile, round: !!o.round, print: o.print || null });
  for (let zz = z; zz < z + h; zz++) for (let yy = y; yy < y + d; yy++) for (let xx = x; xx < x + w; xx++)
    if (xx >= 0 && yy >= 0 && zz >= 0 && xx < m.w && yy < m.d && zz < m.h) m.cell[(zz * m.d + yy) * m.w + xx] = id;
  return m;
}
// a beetle: base plate, body brick with a printed grin, shell plate, two round eye bricks
const m = model(4, 3, 6);
part(m, 1, 0, 0, 2, 3, 1, '#5f666c'); part(m, 1, 0, 1, 2, 3, 3, '#d4231c', { print: grin });
part(m, 1, 0, 4, 2, 2, 1, '#9e1d18'); part(m, 1, 2, 4, 1, 1, 2, '#f2f2ec', { round: true, print: eye });

2. Glossy front face, rims and gaps

// inside the loop over y (back to front), z (bottom to top), x — p = part of the cell, b = its id
const gr = g.createLinearGradient(0, PY(y + 1, p.z + p.h), 0, PY(y + 1, p.z));      // spans the whole part
gr.addColorStop(0, shade(p.col, 1.2, 12)); gr.addColorStop(0.13, shade(p.col, 1.02));
gr.addColorStop(0.6, shade(p.col, 0.88));  gr.addColorStop(1, shade(p.col, 0.7));
g.fillStyle = gr; g.fillRect(x0, y0, x1 - x0, y1 - y0);
const sheen = g.createLinearGradient(PX(p.x), 0, PX(p.x + p.w), 0);
sheen.addColorStop(0, 'rgba(255,255,255,.05)'); sheen.addColorStop(0.1, 'rgba(255,255,255,.24)');
sheen.addColorStop(0.22, 'rgba(255,255,255,.03)'); sheen.addColorStop(0.72, 'rgba(0,0,0,0)'); sheen.addColorStop(1, 'rgba(0,0,0,.12)');
g.fillStyle = sheen; g.fillRect(x0, y0, x1 - x0, y1 - y0);
if (z === p.z + p.h - 1 && !above) { g.fillStyle = 'rgba(255,255,255,.6)'; g.fillRect(x0, y0, x1 - x0, lw); }  // lit rim
if (z === p.z && z > 0 && at(x, y, z - 1)) { g.fillStyle = 'rgba(0,0,0,.4)'; g.fillRect(x0, y1 - lw, x1 - x0, lw); } // gap
const left = at(x - 1, y, z);
g.fillStyle = !left ? 'rgba(255,255,255,.3)' : left !== b ? 'rgba(0,0,0,.36)' : 'transparent';
g.fillRect(x0, y0, lw, y1 - y0);

3. The stud

function stud(g, cx, cy, col, k) {                // (cx, cy) = centre of the stud base, k = px per unit
  const rx = 1.8 * k, ry = rx * 4.2 / 6, hh = 1.05 * k;
  g.fillStyle = 'rgba(10,20,40,.26)'; g.beginPath(); g.ellipse(cx + .42 * k, cy + .2 * k, rx * 1.06, ry * 1.12, 0, 0, 2 * Math.PI); g.fill();
  const s = g.createLinearGradient(cx - rx, 0, cx + rx, 0);
  s.addColorStop(0, shade(col, .98)); s.addColorStop(.24, shade(col, 1.16, 6)); s.addColorStop(.55, shade(col, .92)); s.addColorStop(1, shade(col, .64));
  g.fillStyle = s; g.beginPath(); g.moveTo(cx - rx, cy - hh); g.lineTo(cx - rx, cy);
  g.ellipse(cx, cy, rx, ry, 0, Math.PI, 0, true); g.lineTo(cx + rx, cy - hh); g.fill();
  g.fillStyle = shade(col, 1.12, 6); g.beginPath(); g.ellipse(cx, cy - hh, rx, ry, 0, 0, 2 * Math.PI); g.fill();
  g.strokeStyle = 'rgba(255,255,255,.88)'; g.lineWidth = Math.max(1, .34 * k); g.lineCap = 'round';
  g.beginPath(); g.ellipse(cx, cy - hh, rx * .7, ry * .66, 0, Math.PI * 1.02, Math.PI * 1.52); g.stroke();   // crescent
}

4. Baseplate row with a raised plate edge

for (let j = j0; j <= j1; j++) {                  // rows back to front
  for (let i = i0; i <= i1; i++) {
    const m = MATS[mat(i, j)], lv = m.lvl, below = MATS[mat(i, j + 1)].lvl;
    const x0 = X(i * 6), x1 = X((i + 1) * 6), y0 = Y(j * 4.2 - lv * 2.1), y1 = Y((j + 1) * 4.2 - lv * 2.1);
    g.fillStyle = m.top; g.fillRect(x0, y0, x1 - x0, y1 - y0);
    if (below < lv) {                              // glossy front edge of a raised plate
      const fy = Y((j + 1) * 4.2 - below * 2.1), gr = g.createLinearGradient(0, y1, 0, fy);
      gr.addColorStop(0, m.f0); gr.addColorStop(.25, m.f1); gr.addColorStop(1, m.f2);
      g.fillStyle = gr; g.fillRect(x0, y1, x1 - x0, fy - y1);
    }
  }
  for (let i = i0; i <= i1; i++) if (MATS[mat(i, j)].stud) drawStudSprite(i, j);   // studs after the row
}

5. Molded figure head with a printed face

function head(g, top, bottom, facing) {            // yellow cylinder, 7.2 units wide
  const gr = g.createLinearGradient(-3.6, 0, 3.6, 0);
  gr.addColorStop(0, '#ecbd1d'); gr.addColorStop(.2, '#ffe33a'); gr.addColorStop(.45, '#fcc91f'); gr.addColorStop(1, '#b28e15');
  g.fillStyle = gr; g.beginPath(); g.moveTo(-3.6, top); g.lineTo(-3.6, bottom - .9);
  g.ellipse(0, bottom - .9, 3.6, .95, 0, Math.PI, 0, true); g.lineTo(3.6, top); g.fill();
  const fo = facing * .85, ey = top + 3.2;
  g.fillStyle = '#1b1d22';
  for (const ex of [-1.35, 1.35]) { g.beginPath(); g.ellipse(fo + ex, ey, .5, .76, 0, 0, 2 * Math.PI); g.fill(); }
  g.strokeStyle = '#1b1d22'; g.lineWidth = .48; g.beginPath(); g.arc(fo, ey + .7, 1.5, .22 * Math.PI, .78 * Math.PI); g.stroke();
}

Adapting it to your project

Performance notes

Copy-paste prompt

Use the Toy Bricks art style for my project: a glossy plastic toy-brick world in Canvas 2D, no image assets.
- Grid: 1 cell = 1 stud x 1 stud x 1 plate; on screen a stud is 6 units across and 4.2 deep, a plate 2.1 units (brick = 3 plates).
  The screen shows 360 units vertically. Straight front 3/4 view, no yaw: only top and front faces, all axis-aligned rectangles.
- Models are lists of parts (brick, plate, smooth tile, round brick) stored per cell with a part id; bake them to sprites once.
  Draw rows back to front, plates bottom to top. Front faces: vertical gradient over the whole part (x1.2 rim, x1.02, x0.88, x0.7)
  + a white sheen band at 10% of its width; white rim on top edges, dark gap lines between parts, light left / dark right ends.
- A stud on every open top (cylinder gradient, lighter top, white highlight crescent upper left, soft contact shadow); tiles have none.
- Flat saturated toy colours only (red #d4231c, yellow #f7c81e, blue #1c5fc6, green #21883f, white, black, tan, greys); transparent parts
  at 0.5-0.88 alpha. No outlines, no texture, no noise. Light from the upper left, blurred shadows sheared to the lower right.
- Ground: a stud-covered green baseplate #47a347 with raised lime/grey plates (front edge visible), smooth grey road tiles #666d73
  with light curbs and white lane dashes, transparent-blue water plates one plate lower, flowers and leaf plants as small toy parts.
- Main character: a molded toy figure ~31 units tall: cylinder yellow head with a printed face, claw hands, orange torso, blue legs,
  explorer helmet; stiff-leg walk in 4 frames. Creatures: a red brick beetle with round eye bricks, a translucent ghost piece,
  a big brick robot with glowing red eyes. Brick creatures move in whole studs/plates.
- Effects: flying single bricks and plates that tumble and bounce, star sparkles, rings with studs on them, spinning stud coins.
- UI: brick panels with a row of studs on top and hard drop edges, bars filled with stud-covered plates, instruction-booklet cards
  (white page, black border, big step number, parts-callout box with "1x"); fonts Titan One + Fredoka.