Skip to content

keithadler/dominoes27

Repository files navigation

🁣 All Fives Dominoes

A feature-rich, zero-dependency browser domino game. Pure HTML/CSS/JS β€” no build step, no server, no frameworks.

β–Ά Play Now

Version MIT License Pure JS No Dependencies Languages


Features

Gameplay β€” Full All Fives rules with spinner mechanics, 1–3 AI opponents or 2v2 teams, 3 difficulty levels, 5 AI personality types, minimax hint system, drag-and-drop tile placement, board pinch-zoom/pan, and auto-play detection.

AI β€” Each opponent gets a random generation (Gen Z, Millennial, Gen X, Boomer) that determines how they trash-talk. 300+ culturally authentic phrases across 4 languages. Personalities affect play style: Aggressive, Defensive, Chaotic, Calculated, Bully.

Visuals β€” 3D tiles with 6 skins (Classic, Marble, Wood, Neon, Gold, Midnight), felt grain texture with table-lamp lighting, animated dealing with cinematic player intros, tile fly-in animations with landing shockwaves, cursor-following 3D tilt on hand tiles, score orbs that fly to the scoreboard, avatar emote reactions, letterboxed "DOMINO!" stamp, combo fire streaks, particle effects, score combo counter, screen shake on big plays, pulsing spinner highlight, match-point drama mode, bone counting ceremony, and a victory finale with fireworks and a toppling domino-chain cascade.

i18n β€” English, Spanish, Arabic (full RTL), Chinese. Auto-detects browser language. Language picker on first visit. Culturally appropriate AI names, cities, and dialogue per language. Rules and tutorial fully translated.

Progression β€” XP leveling, 17 achievements, lifetime stats, head-to-head records vs each AI, daily first-game bonus.

Quality of Life β€” Save/resume games, export game log, colorblind mode, haptic feedback, keyboard shortcuts for everything, dark/light theme, 6 table themes, game speed control, AI trash talk frequency slider, prefers-reduced-motion support.

Mobile β€” Responsive across phones, tablets, and desktop. PWA installable. Touch drag-and-drop, pinch-zoom on board, safe area support for notched devices.

Quick Start

No install needed. Just open index.html in any browser.

# Or serve locally:
python3 -m http.server 8080
# β†’ http://localhost:8080

Keyboard Shortcuts

Key Action
1–9 Select tile by position
L R N S Place on Left/Right/North/South end
D Draw from boneyard
H Use hint (βˆ’5 pts)
P Pass turn
M Open menu
G Game log
T Tile tracker
A Stats & Achievements
E Preferences
? Toggle shortcuts panel
Esc Close any overlay

Project Structure

β”œβ”€β”€ index.html       β€” Single-page app shell (all screens/overlays)
β”œβ”€β”€ styles.css       β€” Styles, animations, responsive breakpoints
β”œβ”€β”€ locales.js       β€” i18n: 4 languages, phrases, names, UI strings, rules
β”œβ”€β”€ tile.js          β€” Tile class, set creation, shuffle
β”œβ”€β”€ board.js         β€” Board state, open ends, scoring logic
β”œβ”€β”€ player.js        β€” Player model (human + AI)
β”œβ”€β”€ ai.js            β€” AI engine: 3 difficulties, minimax with alpha-beta
β”œβ”€β”€ renderer.js      β€” Canvas board renderer with 3D tile effects
β”œβ”€β”€ audio.js         β€” Synthesized SFX + dynamic jazz music engine
β”œβ”€β”€ stats.js         β€” Win/loss records, achievements, XP, player name
β”œβ”€β”€ ui-helpers.js    β€” Avatars, themes, skins, tutorial, personalities, particles
β”œβ”€β”€ game.js          β€” Main game controller (~3800 lines)
β”œβ”€β”€ manifest.json    β€” PWA manifest
β”œβ”€β”€ CONTRIBUTING.md  β€” Contribution guidelines
└── LICENSE          β€” MIT

Tech Stack

  • Rendering β€” Canvas API with auto-fit zoom, 3D bevels, fly-in animations
  • Audio β€” Web Audio API oscillator synthesis (no audio files)
  • Persistence β€” localStorage for stats, achievements, settings, save games
  • Avatars β€” DiceBear Adventurer (CC BY 4.0)
  • Font β€” Inter (SIL Open Font License 1.1)

Adding a New Language

  1. Add a LOCALES.xx entry in locales.js following the LOCALES.en structure
  2. Include: name, flag, dir (ltr/rtl), names[], cities[], ui{}, p{} (phrases)
  3. Add rules HTML to the RULES object at the bottom of locales.js
  4. All UI keys are listed in the English ui object β€” translate every key
  5. Phrases should be culturally authentic, not machine-translated
  6. Test RTL layout if applicable

Contributing

See CONTRIBUTING.md for guidelines. We especially welcome:

  • New languages (with authentic cultural phrases)
  • Accessibility improvements
  • AI strategy enhancements
  • Mobile/touch UX refinements
  • New tile skins or table themes

Changelog

1.4.0 β€” 2026-07-02

  • Avatar emote reactions β€” AI opponents react to big plays with emoji pops and panel shakes (😱 when you score, 😎 when they do, teammates cheer); frequency follows the trash-talk setting
  • "DOMINO!" cinematic stamp β€” letterbox bars slide in and a golden localized stamp slams down with a board shake whenever someone goes out
  • Felt grain + table lamp β€” fractal-noise cloth texture and a soft overhead light pool with edge falloff make the table look physical
  • Victory fireworks β€” rockets streak up and burst into colored sparks over the win celebration (more on a blowout)
  • Combo fire streak β€” the player bar ignites with a glowing edge and rising embers while a scoring streak is alive
  • All new effects respect prefers-reduced-motion

1.3.0 β€” 2026-07-02

  • Score orbs β€” golden orbs fly from the board to the scorer's chip in the score bar, bumping it as each lands
  • Cursor-following 3D tilt β€” playable hand tiles tilt in perspective toward the mouse
  • Landing shockwave β€” expanding ripple rings on the felt where each tile is placed
  • Match Point mode β€” when anyone is within 25 points of the target: one-time localized "MATCH POINT" banner, pulsing red vignette, heartbeat haptics
  • Domino cascade victory β€” a chain of dominoes rises and topples across the screen when you win the game
  • All new effects respect prefers-reduced-motion

1.2.1 β€” 2026-07-02

  • Removed dead code: unused REAL_NAMES/US_CITIES constants and the unused getSeasonTheme() helper

1.2.0 β€” 2026-07-02

  • Fixed 4 unattainable achievements that were never granted: Hat Trick (3 scoring plays in a row), Roadblock (win a blocked round), Comeback Kid (win after trailing by 50+), and Shutout (win with opponents at 0)
  • Clean Sweep now unlocks when you actually go out (play your last tile), not on any game win
  • "First Blood" banner now appears on the round's first scoring play (was dead code due to an off-by-one)
  • Rematch no longer carries over hint usage, which permanently blocked the No Help achievement
  • Rage quit now breaks your win streak, matching its "counts as a loss" label
  • Player names containing HTML/quotes no longer break the info bar or preferences input
  • Localized previously hardcoded English strings: "X's turn" toast, tutorial "Opponent has", stats "Time Played"
  • Fixed malformed preferences markup that nested the Table Theme group inside the Audio group

1.1.1 β€” 2026-07-02

  • Mobile layout: round title no longer overlaps the menu button on narrow screens
  • Mobile layout: bottom-bar controls (Draw/Hint/Tiles) wrap to a second row instead of being clipped behind a horizontal scroll

1.1.0 β€” 2026-07-02

  • Rules fix: spinner arms now only count toward the board total once a tile has been played on them, matching standard All Fives scoring (previously an uncovered arm added the spinner's pip value, inflating counts by 2Γ— the spinner once it was covered on both sides)
  • Fixed hint cost being deducted from both team and individual scores in 2v2 mode
  • Smarter AI draw tracking: playing a tile now only clears the AI's "can't play" intel for that tile's two pip values instead of wiping all of it
  • Rules screen (all 4 languages) now states the arm-counting rule explicitly
  • Saved games from 1.0.0 are migrated automatically

1.0.0

  • Initial release

License

MIT β€” see LICENSE.

Attribution


Made by Keith Adler

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors