Corvus Web Studio

Nest · 3 playable experiments · 3 incubating

The Nest: bits of games to play with.

This is where the crow keeps what shines. Each experiment comes out of one of the studio's games, stripped to the essentials: a playable demo, how it works, its code under the MIT licence, with no library.

6 experiments

EXP 01PLAYABLEThe studio

The crow that follows the cursor

A spring, not an interpolation: the crow keeps its momentum, slightly overshoots its target and rests when it has nothing left to do. Seeds and the two settings change its temper.

  • animation
  • pixel art
  • spring
  • rAF
How it works
  1. On every frame, velocity is pulled towards the target (stiffness), then slowed down (damping).
  2. Horizontal velocity tilts the sprite and picks its profile, left or right.
  3. Below a movement threshold the loop stops: no computation at rest.
LIVE

move the cursor, click to drop a seed

spring.jsMIT

// Un ressort à deux réglages : raideur (k) et amortissement (d).
// Pas de durée : il s'arrête quand il n'a plus d'élan.
const spring = (apply, k = 0.06, d = 0.86) => {
  let x = 0, y = 0, vx = 0, vy = 0, tx = 0, ty = 0, raf = 0;

  const step = () => {
    vx = (vx + (tx - x) * k) * d;
    vy = (vy + (ty - y) * k) * d;
    x += vx; y += vy;
    apply(x, y, vx, vy);

    const moving = Math.abs(vx) + Math.abs(vy)
      + Math.abs(tx - x) + Math.abs(ty - y) > 0.01;
    raf = moving ? requestAnimationFrame(step) : 0;
  };

  return {
    to(a, b) { tx = a; ty = b; if (!raf) raf = requestAnimationFrame(step); }
  };
};

// La vitesse horizontale incline le corbeau et choisit son profil.
const crow = spring((x, y, vx) => {
  const tilt = Math.max(-14, Math.min(14, vx * 1.6));
  bird.style.transform = `translate(${x}px, ${y}px) rotate(${tilt}deg)`;
  bird.classList.toggle('flip', vx < 0);
});

sky.addEventListener('pointermove', e => crow.to(e.offsetX, e.offsetY));

EXP 02PLAYABLEFrom Fastr

Round timer, Fastr style

120 seconds per round, four rounds, the last ten seconds in the red. Every validated word earns 100 points plus a melting speed bonus: 119 for the first, 118 for the next. Every two words, a penalty flies to the opponent.

  • real time
  • game UI
  • rAF
  • 8-bit
How it works
  1. Remaining time is computed from the clock, not by counting frames.
  2. 24 segments switch off one by one; under 10 seconds, everything turns red.
  3. Scoring follows the game's rule: 100 points, plus a bonus that drops with every word.
LIVE

Round 1 / 4

02:00

  • 0points
  • 0 / 20words
  • +119bonus

round-timer.jsMIT

// Le temps restant vient de l'horloge, pas d'un compteur d'images :
// un onglet ralenti ne fait pas durer la manche plus longtemps.
const ROUND = 120, SEGMENTS = 24;
let left = ROUND, last = 0, running = false, speed = 8;

const loop = now => {
  if (!running) return;
  left = Math.max(0, left - (now - last) / 1000 * speed);
  last = now;
  if (left === 0) running = false;
  paint();
  if (running) requestAnimationFrame(loop);
};

const paint = () => {
  const s = Math.ceil(left);
  clock.textContent =
    String(Math.floor(s / 60)).padStart(2, '0') + ':' +
    String(s % 60).padStart(2, '0');
  const lit = Math.ceil(left / ROUND * SEGMENTS);
  segments.forEach((el, i) => el.classList.toggle('off', i >= lit));
  box.classList.toggle('danger', left > 0 && left <= 10);
};

// Règle de score : 100 points + un bonus qui baisse à chaque mot.
let words = 0, score = 0;
const validate = () => {
  score += 100 + Math.max(0, 119 - words);
  words += 1;
  if (words % 2 === 0) sendMalus(); // tous les 2 mots
};

EXP 03PLAYABLEFrom Iconic

Flip-card icon grid

Eight cards, a pure CSS rotation and a state that keyboards and screen readers understand. In the real game, the owner of the object has to be guessed first: here, every flipped card earns 25 ICoins, like a right answer.

  • CSS 3D
  • a11y
  • game UI
  • aria-pressed
How it works
  1. Every card is a button whose state lives in aria-pressed.
  2. CSS reads that same attribute to rotate the card in 3D.
  3. A single listener handles the whole grid, keyboard and screen reader included.
LIVE

0 / 80 ICoins

flip-card.cssMIT

/* Une carte = un bouton. L'état vit dans aria-pressed :
   le style et l'accessibilité lisent la même source. */
.grid { perspective: 800px; }

.card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 420ms cubic-bezier(.23, 1, .32, 1);
}
.card[aria-pressed='true'] { transform: rotateY(180deg); }
.card:active { transform: scale(.95); }

.face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
}
.face.answer { transform: rotateY(180deg); }

/* Mouvement réduit : la carte change de face sans tourner. */
@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
}

// Côté script, un seul écouteur pour toute la grille.
grid.addEventListener('click', e => {
  const card = e.target.closest('.card');
  if (!card) return;
  const on = card.getAttribute('aria-pressed') !== 'true';
  card.setAttribute('aria-pressed', on);
});

Incubating

EXP 04SOONOne Piexel

Rollback, frame by frame

The engine predicts the opponent's inputs, then rolls back up to 8 frames to replay. Coming: a slider to set the delay and watch the correction happen.

  • real time
  • algo
  • netcode

EXP 05SOONFastr

The brick wall

One of Fastr's 13 penalties: four characters at most in the input area until the wall comes down. To be endured on your own keyboard.

  • game UI
  • animation
  • penalty

EXP 06SOONFastr

Typo tolerance

Fastr forgives one typo per word, two from 12 letters up. A field to type in, the Levenshtein distance computed live.

  • algo
  • game UI
  • Levenshtein

An idea for an experiment, or a glitch in the matrix?

Write to the studio