miwale

Psychedelic Card Table — Game Art Style Spec

A Balatro-like card table: a flowing paint swirl floor, wobbling pixel cards and chip tokens, foil and holo editions, burn dissolves and a CRT screen.

The whole world is one endless card table, and its cloth is alive: a slow paint swirl in three shades of one table colour, poured, folded and twisted around the middle of the screen like a lava lamp. By default the table is green felt; in some areas it turns crimson, violet or teal, and the whole floor eases to that colour as the camera moves there. On the table everything is crisp pixel art in the language of a card game: a walking playing card wearing a two-pointed jester hat, chip tokens with little faces, flipping tarot cards, a big crimson token with one glaring eye, chip stacks, decks, dice and standing cards that shimmer in foil, holographic, polychrome or negative editions. Nothing ever just happens: everything wobbles with a decaying spring ("juice"), throws hard silhouette shadows, bursts into spinning square particles, shows its value in a blue (+) or red (X) bubble, and burns away with a glowing edge. Finally the whole picture sits behind curved CRT glass with scanlines, a chromatic fringe and bloom. It is a design study in the spirit of the visual language of Balatro, built from scratch.

At a glance

FamilyPixel Art · CRT Card Table
Moodhypnotic, playful, snappy, retro, casino-lounge
Best forcard, deck-building and dice projects; casino and puzzle arcade games; menus, shops and reward screens that need juice; playful top-down action
RendererCanvas 2D sprites + two WebGL2 fragment shaders (paint swirl, CRT post pass); CPU and 2D fallbacks
Pixel artYes — 1 art pixel per world unit (360 units tall), integer upscale, sprites rotate inside the art buffer
Complexity4/10 — tiny flat sprites; the look lives in six reusable systems (swirl, juice, silhouette shadow, editions, dissolve, CRT)
FontsJersey 10 (400) for all UI, a hand-made 3x5 pixel digit font in the world; m6x11 if you have it
Key coloursfelt #50846e, chips blue #009dff, mult red #fe5f55, money gold #f3b958, orange #fda200, tarot #a782d1, card white #ffffff / edge #bfc7d5, panel #3a5055 / #26353a, ink #24302f

When to use it

Color palette

SwatchHexRole
Felt#50846eBase colour of the table: swirl colours x0.9 (main), x1.3 (highlight paint), x0.7 (deep paint) — ~75 % of the screen
Crimson Table#b44430Crimson table patches (swirl contrast up to 2.3)
Violet Table#8a71e1Violet table patches
Shop Teal#2b6e8fRare teal patches
Chips Blue#009dffBlue counters, bar fill, blue (+) bubbles, small chip tokens; dark lip #0067b0
Mult Red#fe5f55Red counters, panel bar, red (X) bubbles, number badges, red hat flap; dark lip #c2453e
Money Gold#f3b958Coins, notches, hat band and bells, sparkles, titles; dark #b8862f, light #ffe8a8
Orange#fda200Second chip token colour, caption button, labels, embers; dark #b97500
Green#4bc292Third chip token colour, green chips; dark #2e8a64
Tarot Violet#a782d1Backs of flipping cards, tarot frames; dark #6e4f96
Planet Cyan#13afceThe large collectible card, blue booster packs
Card White#ffffffCard faces, gloves, text, hit flashes
Card Edge#bfc7d51 px edge inside every card, lip of white text boxes; shade row #e6eaf0
Hearts / Diamonds#f03464 / #f06b3fRed suit pips
Spades / Clubs#403995 / #235955Dark suit pips
Token Crimson#c9473aRim of the large token; inner rim #d85a4b, centre #5a1e1a
Card Back Red#da4a41Deck backs; lattice #b83a33, white frame
Panel#3a5055UI panels; cards in the UI #4f6367 with lip #374244
Panel Dark#26353aInner wells, panel lips, empty bar channels
Ink#24302fSprite outlines, eyes, legs

Palette rules

Typography

Rendering technique

The art buffer is 1 art pixel per world unit (360 units visible vertically) and is upscaled by an integer factor with nearest neighbour (3× at 900 px). Order per frame:

  1. Swirl floor — a WebGL2 fragment shader renders the swirl for every art pixel into an offscreen canvas of exactly the art-buffer size, which is copied into the buffer with drawImage. Fallback: the same math on the CPU at quarter resolution, refreshed every second frame.
  2. Card zones — dark translucent rounded rectangles from a deterministic 230-unit grid, drawn in screen space at art-pixel positions.
  3. Shadows — for every sprite, its own black silhouette at 33 % alpha, offset down and away from the screen centre, with the sprite's rotation and scale.
  4. Sprites, y-sorted — characters and props, rotated and scaled around their anchor inside the art buffer, so tilted cards stay pixel art. Juice, squash, flip (horizontal scale) and editions are applied here.
  5. Collectibles, orbiting tokens, projectiles, particles, bubbles.
  6. Upscale to the display, then the CRT pass: the finished display image is uploaded as a texture (with mipmaps for bloom) and redrawn through the CRT shader.

Baked once at init: every sprite and its mirror, 8 edition frames per prop that can carry an edition, coin spin frames, icons. Built lazily and cached: silhouettes per sprite and colour, dissolve frames per sprite and step, bubbles per text.

World and ground

Characters

All characters are table objects brought to life: 1 px ink outline #24302f, flat colours, minimal faces, motion from springs instead of long frame sequences.

Props

Table clutter placed in small clusters on a 150-unit grid (50 % of the cells), with lots of empty swirl between them:

Props share the character rules: 1 px ink outline, flat colours, silhouette shadows, no contact ellipses.

Effects and particles

Atmosphere and lighting

UI

Motion and animation

Do and don't

Do

Don't

Implementation recipe

  1. Set up a low-res art buffer (360 units tall, 1 px per unit) and upscale it by an integer factor with imageSmoothingEnabled = false.
  2. Write the swirl shader (code below) and render it into an offscreen WebGL2 canvas of the buffer's size every frame; copy it into the buffer. Add the CPU fallback.
  3. Build sprites from code at init: rounded card rectangles, discs with notches, 3×5 glyphs; then a 1 px ink outline by dilating each silhouette.
  4. Draw every object through one blit(img, x, y, anchor, rotation, scaleX, scaleY) that snaps the anchor to the art grid; draw the silhouette shadow with the same transform first.
  5. Add the juice function and call it from every event (hit, spawn, pickup, hover).
  6. Bake edition frames (8 per sprite) and the lazy dissolve cache (12 steps).
  7. Add square particles and bubbles (3×5 digits) to every event.
  8. Run the CRT shader over the final display image (upload, mipmaps, draw back with globalCompositeOperation = 'copy').
  9. Skin the UI with slate panels, hard lips and shadows, Jersey 10, blue/red pill fills and deal-in cards.

Code

The paint swirl as a WebGL2 fragment shader (world-anchored, twisted around the screen centre):

const FS_SWIRL = `#version 300 es
precision highp float;
uniform vec2 uRes, uCam;            // art-buffer size, camera world position
uniform float uS, uFlow, uSpin;     // art px per world unit, time*7, 302.2 (+ pulse)
uniform float uContrast, uLight;    // 1.4, 0.28
uniform vec3 uC1, uC2, uC3;         // base*0.9, base*1.3, base*0.7 (0..1)
out vec4 o;
void main(){
  vec2 px = vec2(gl_FragCoord.x, uRes.y - gl_FragCoord.y);
  vec2 off = (floor(px) + 0.5 - 0.5 * uRes) / uS;          // world offset from the screen centre
  float l = length(off / 612.);
  float a = uSpin - 20. * (0.25 * l + 0.75);                // twist around the middle of the screen
  vec2 w = uCam + off;
  vec2 p = vec2(0.26 * sin(w.x / 150.) + 0.2 * sin((w.x * 0.6 + w.y * 0.8) / 131. + 1.3),
                0.26 * sin(w.y / 150. + 0.7) + 0.2 * sin((w.y * 0.6 - w.x * 0.8) / 127. + 2.1));
  vec2 uv = mat2(cos(a), sin(a), -sin(a), cos(a)) * p * 30.;
  vec2 uv2 = vec2(uv.x + uv.y);
  for (int i = 0; i < 5; i++) {
    uv2 += sin(max(uv.x, uv.y)) + uv;
    uv += 0.5 * vec2(cos(5.1123314 + 0.353 * uv2.y + uFlow * 0.131121), sin(uv2.x - 0.113 * uFlow));
    uv -= cos(uv.x + uv.y) - sin(uv.x * 0.711 - uv.y);
  }
  float cm = 0.25 * uContrast + 0.5 * 0.25 + 1.2;
  float pv = min(2., max(0., length(uv) * 0.035 * cm));
  float c1 = max(0., 1. - cm * abs(1. - pv)), c2 = max(0., 1. - cm * abs(pv)), c3 = 1. - min(1., c1 + c2);
  float lt = (uLight - 0.2) * max(c1 * 5. - 4., 0.) + uLight * max(c2 * 5. - 4., 0.);
  float b = 0.3 / uContrast;
  o = vec4(b * uC1 + (1. - b) * (uC1 * c1 + uC2 * c2 + uC3 * c3) + lt, 1.);
}`;

The CRT pass over the finished display image (upload the display canvas as a texture with mipmaps; uUp = upscale factor):

const FS_CRT = `#version 300 es
precision highp float;
in vec2 vUv; uniform sampler2D uTex; uniform vec2 uRes; uniform float uTime, uUp, uMip;
out vec4 o;
float h12(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233))) * 43758.5453); }
void main(){
  vec2 p = vUv * 2. - 1.;
  p *= 1. + 0.045 * dot(p, p) - 0.018;
  vec2 uv = p * 0.5 + 0.5;
  vec2 e = smoothstep(vec2(0.), vec2(0.008), uv) * smoothstep(vec2(0.), vec2(0.008), 1. - uv);
  vec2 ca = (uv - 0.5) * 0.004 + vec2(0.45 / uRes.x, 0.);
  vec2 t = vec2(uv.x, 1. - uv.y), tc = vec2(ca.x, -ca.y);
  vec3 col = vec3(texture(uTex, t + tc).r, texture(uTex, t).g, texture(uTex, t - tc).b);
  vec3 bl = textureLod(uTex, t, uMip).rgb * 0.55 + textureLod(uTex, t, uMip + 2.).rgb * 0.45;
  col += max(bl - 0.3, 0.) * 0.55;
  float lum = dot(col, vec3(0.2126, 0.7152, 0.0722));
  col *= 1. - 0.2 * (0.5 + 0.5 * cos(gl_FragCoord.y / max(uUp, 2.) * 6.2831853)) * (1. - 0.55 * clamp(lum, 0., 1.));
  col += (h12(floor(gl_FragCoord.xy / 2.) + fract(uTime * 7.31) * 91.7) - 0.5) * 0.03;
  col *= mix(1., smoothstep(1.6, 0.45, length(p * vec2(0.92, 1.))), 0.55);
  o = vec4(col * 1.04 * e.x * e.y, 1.);
}`;
// per frame: gl.texImage2D(..., displayCanvas); gl.generateMipmap(...); draw; then
// displayCtx.globalCompositeOperation = 'copy'; displayCtx.drawImage(glCanvas, 0, 0);

Juice, blit on the art grid and the silhouette shadow:

function juice(age, A) {               // age = seconds since the event
  if (age < 0 || age > 0.4) return { s: 0, r: 0 };
  const k = (0.4 - age) / 0.4;
  return { s: A * Math.sin(50.8 * age) * k * k * k, r: A * 0.5 * Math.sin(40.8 * age) * k * k };
}
function blit(ctx, img, sx, sy, ax, ay, rot, scx, scy, alpha = 1) {   // sx, sy: art-buffer pixels
  ctx.save();
  ctx.globalAlpha = alpha;
  ctx.translate(Math.round(sx), Math.round(sy));
  ctx.rotate(rot); ctx.scale(scx, scy);
  ctx.drawImage(img, -ax, -ay);          // nearest-neighbour inside the low-res buffer
  ctx.restore();
}
function silhouette(img) {               // cache this per sprite
  const c = document.createElement('canvas'); c.width = img.width; c.height = img.height;
  const g = c.getContext('2d');
  g.drawImage(img, 0, 0); g.globalCompositeOperation = 'source-in'; g.fillStyle = '#000'; g.fillRect(0, 0, c.width, c.height);
  return c;
}
function drawWithShadow(ctx, img, x, y, ax, ay, rot, s, screenCx, lift = 0) {
  const dx = Math.max(-6, Math.min(6, (x - screenCx) * 0.025)) + 1 + lift * 0.35;
  blit(ctx, silhouette(img), x + dx, y + 3 + lift, ax, ay, rot, s, s, 0.33);
  blit(ctx, img, x, y, ax, ay, rot, s, s);
}

The burn dissolve (mask once per sprite, frames cached per step):

function dissolveFrame(img, mask, k, burn = true) {   // mask: Float32Array, fbm(x/5, y/5)*0.78 + 0.22*(1 - edgeDistance)
  const step = Math.min(11, Math.floor(k * 12)), th = ((step + 0.5) / 12) * 1.18 - 0.08;
  const [a, b] = burn ? [[255, 232, 160], [254, 95, 85]] : [[255, 255, 255], [0, 157, 255]];
  const g = img.getContext('2d'), data = g.getImageData(0, 0, img.width, img.height), d = data.data;
  for (let i = 0; i < mask.length; i++) {
    if (d[i * 4 + 3] < 20) continue;
    if (mask[i] < th) { d[i * 4 + 3] = 0; continue; }
    if (mask[i] < th + 0.09) {
      const t = (mask[i] - th) / 0.09;
      for (let c = 0; c < 3; c++) d[i * 4 + c] = a[c] + (b[c] - a[c]) * t;
      d[i * 4 + 3] = 255;
    }
  }
  const out = document.createElement('canvas'); out.width = img.width; out.height = img.height;
  out.getContext('2d').putImageData(data, 0, 0);
  return out;
}

Adapting it to your project

Performance notes

Copy-paste prompt

Use the "Psychedelic Card Table" art style for my project:
- A Balatro-like card-table look. The floor is one slow paint swirl (domain-warped, twisted around the screen
  centre) in three shades of one table colour: base x0.9 / x1.3 / x0.7. Default green felt #50846e; whole areas
  or moments switch the table to crimson #b44430 or violet #8a71e1, easing over about a second.
- Everything else is crisp pixel art on a low-res buffer (1 px per world unit), integer upscaled, 1 px ink outline
  #24302f, flat saturated colours, rotated and scaled inside the buffer so it stays pixel art.
- Cast: a walking white playing card with a red/blue jester hat, chip tokens with faces (blue #009dff, orange
  #fda200, green #4bc292), flipping violet tarot cards #a782d1, a big crimson token with one eye.
- Props in small clusters: chip stacks, coin piles, decks with red backs, dice, standing cards, tarot cards,
  booster packs; some in foil / holographic / polychrome / negative editions (animated pixel shaders).
- Every reaction wobbles: scale += A sin(50.8t)((0.4-t)/0.4)^3, rotation += A/2 sin(40.8t)((0.4-t)/0.4)^2.
- Shadows are the sprite's own silhouette, black 33 %, offset down and away from the screen centre.
- Effects: spinning shrinking square particles, blue (+N) / red (XN) / gold ($N) bubble popups with 3x5 pixel
  digits, burn dissolves with a gold-to-red edge and embers, plus-shaped sparkles.
- Finish with a CRT pass: barrel curve, chromatic fringe, bloom, one scanline per art-pixel row, noise, vignette.
- UI: slate panels #3a5055 with a hard lip #26353a and hard offset shadow, Jersey 10 (or m6x11) in white with a
  hard shadow, blue/red pill bars, white description boxes, red number badges, cards that deal in with overshoot.