Baize
A pool table you could hold, with real physics: felt with its nap under one raking lamp, rails of wood or metal, six pockets with depth. Pull back anywhere on the table to aim, let go to strike.
What it is for
A game you could hold, and a table that plays like one.
Everything you set here is what the Code and Prompt tabs give you.
Seats open in 8 days. Want one email that morning?
Datasheet
- Mechanism
- Shared handheld case, Rigid ball physics, Slide to roll friction, Follow and draw spin, Pocket lip capture, Fixed step substeps, Per pixel ball shading, Raking lamp light, Token driven materials, Pull back aim, Two way case, Pointerdown keys, Synthesised sound, Scale as an object
- Stack
- Vanilla ES modules, CSS, Canvas 2D, Web Audio
- Needs
- Nothing, no dependencies
- States
- 12 documented
- Version
- 0.1.0
- Licence
- With a Pass
States
- How to playEight-ball: Player 1 breaks from behind the head string. The table is open until someone pots a ball after the break; that kind, solids or stripes, is theirs. Pot your own and you shoot again; a foul (the cue ball in a pocket, no ball struck, or the wrong ball struck first) hands the other player the cue ball, anywhere. Clear your seven, then pot the eight to win the rack; pot it early and you lose it. Practice: clear the table in as few shots as you can.
- KeysOn the table, press anywhere and pull back: the cue and a short aim line show the shot, which goes the other way, as hard as you pull; let go to strike, or bring the pointer back to let the cue down. With the cue ball in hand, drag the ball. Left and Right (or A and D) aim, comma and full stop a tenth of a degree at a time; Up and Down (or W and S) set the tip for follow or draw; hold Space and let go to strike (Escape lets the cue down); Shift and the arrows move the ball in hand; N racks again; M switches to practice; F fills the screen. The Strike key works as Space does, the Spin dial as Up and Down. Sound is off until the switch is on.
- Made ofThe kit's Panel (the case), LCD (the balls each player has down and the rack, or the shots, the balls left and the best, in seven segments, with a status line), Lamp (whose shot), Key (the round Strike key and the primary Rack key), Tray (the wells), Switch (Practice and Sound), Grille, a slider for the strike point, and the table, drawn on a canvas from the finish's own tokens.
- RackedFifteen balls in a frozen triangle on the foot spot, the eight in the middle of the third row, a solid and a stripe in the back corners; the cue ball behind the head string, in hand, ringed. The LCD says who breaks and the first player's lamp is lit.
- AimingThe cue lies behind the cue ball along the shot, drawn back as far as the pull or the held key; the short aim line runs a few ball widths ahead and fades. The LCD shows the power. The table's description for a screen reader says where the cue ball is and which ball it points at.
- RollingThe balls slide, catch, roll and turn under the lamp: the stripes, numbers and the cue ball's spots turn with them while the highlight stays put. A potted ball drops into its pocket and takes its place in the row in the bezel. The table runs at a fixed step and the loop sleeps when every ball rests.
- FoulThe turn passes and the other player has the cue ball in hand anywhere on the table (behind the head string after a scratch on the break): the ball is ringed and can be dragged, or moved with Shift and the arrows. The LCD and the announcement say why.
- Rack wonThe winner's lamp stays lit and the LCD says so; a tap on the table or the Rack key racks again. In practice, the shots for a cleared table are kept as the best on this device.
- Wide and tallWhere the page has room the case stands landscape: the plate and switches on the left, the table across the middle, Strike, Spin and Rack on the right. On a phone held upright it is the tall handheld and the table turns to portrait, the head of it nearest you. Fullscreen takes whichever the screen is held as.
- SoundOff until the switch is turned on, and silent until the page is touched. Synthesised: a hard knock for ball on ball, a low thud for a cushion, the tip's tock, and for a pocket the knock on its jaw, the drop and the roll away.
- Reduced motionThe cue does not swing through and no ball rolls: as soon as the shot is struck the balls are where they come to rest, and the result is announced. Keys shade but do not move.
- Twelve finishes, two volumesThe case reads the finish and volume tokens; the table reads the object tokens: brushed aluminium or graphite rails and frame, oak or walnut rails with their grain in the Wood finishes (and the cut of wood the page has chosen), the other finishes' own metals, the cloth a deep green each finish tints. Quiet flattens the grain and the gloss.
Notes
A top-down pool table in a machined frame is let into the library's handheld case, beside an LCD for the score, lamps for whose shot it is, a round Strike key, a Spin dial, a Rack key, the switches and a speaker grille. Under it is a small rigid-ball simulation at a fixed step: balls slide until their spin catches up and then roll, the tip's height gives follow and draw, balls meet nearly elastically, cushions give back three quarters, pockets have a lip. It plays eight-ball for two at one table, or practice, where you clear the table and the shots are counted. Press anywhere on the table and pull back, the way you draw a cue, and let go to strike; the cue and a short aim line show the shot. The finish decides the materials: brushed metal or wood with its grain for the rails, the cloth a deep green it tints.
Original. The case is the library's shared handheld (originals/components/shared/handheld), drawn from the kit's parts at one size and scaled as an object, here in two arrangements (a landscape case at 840px, the tall one at 328px). The table and its physics are the game's own (table.mjs, rules.mjs, render.mjs). It needs the Tactile UI Kit's stylesheets on the page; the Code tab's example links them from ./kit/.
Anatomy
Shared handheld case, Rigid ball physics, Slide to roll friction, Follow and draw spin, Pocket lip capture, Fixed step substeps, Per pixel ball shading, Raking lamp light, Token driven materials, Pull back aim, Two way case, Pointerdown keys, Synthesised sound, Scale as an object
Usage notes
A game you could hold, and a table that plays like one. A top-down pool table in a machined frame is let into the library's handheld case, beside an LCD for the score, lamps for whose shot it is, a round Strike key, a Spin dial, a Rack key, the switches and a speaker grille. Under it is a small rigid-ball simulation at a fixed step: balls slide until their spin catches up and then roll, the tip's height gives follow and draw, balls meet nearly elastically, cushions give back three quarters, pockets have a lip. It plays eight-ball for two at one table, or practice, where you clear the table and the shots are counted. Press anywhere on the table and pull back, the way you draw a cue, and let go to strike; the cue and a short aim line show the shot. The finish decides the materials: brushed metal or wood with its grain for the rails, the cloth a deep green it tints.
Options
| Option | Type | Description |
|---|---|---|
| mode | enum | What the table racks for first. Eight-ball is two players taking turns at one table; practice is one player clearing the table, the shots counted. The Practice switch on the case changes it too. |
| sound | boolean | The switch on the case, off to begin with. On, the balls knock, the cushions thud and a pocket takes its ball, once the visitor has touched the page (a browser allows sound only after a press). Their own setting is kept on their device. |
| label | text | What a screen reader calls the case. |
Methods
- hooks
- update
- destroy
How it works
Original. The table and its physics are the game's own (table.mjs, rules.mjs, render.mjs). It needs the Tactile UI Kit's stylesheets on the page; the Code tab's example links them from ./kit/.