Polar Games

A Brazilian truco card game for the web · 1.0.0

Truco Showdown

This guide explains how to install, play, customize and update the game. Pick your language at the top; screenshots stay in English.

Version 1.0.0 Edition Standalone buyer edition

This guide works without internet. Images, styles and scripts are already inside this file.

Contents
  1. Overview
  2. Installing on your website
  3. Requirements
  4. How to play
  5. Screens
  6. Files and folders
  7. Customizing
  8. Music, voices and sounds
  9. Languages
  10. Saving and resetting
  11. Development (optional)
  12. Updating and clearing the cache
  13. Licences and credits
  14. Common problems
  15. FAQ
  16. Support

1 Overview

Truco Showdown is a complete HTML5 single-player truco card game. You play against the computer at the tables of a Brazilian neighbourhood bar: 2 vs 2, with your partner Dona Nena against two rivals, or 1 vs 1. Win the tricks, call TRUCO to raise the stakes and be the first team to 12 points.

There are two rule styles: Paulista (the turned card, the vira, picks the trumps) and Mineiro (fixed trumps). The deck has 40 cards (no 8, 9 or 10), each player gets 3 cards and a hand is the best of 3 tricks. Three house rules (Face-down cards, Hand of eleven and Iron hand), partner signals and 3 computer levels (Easy, Normal and Hard).

Two modes: Quick Match, and the Circuit of 5 tables x 10 matches (50 matches and up to 150 stars) in 5 places, each with its own rivals, ending with a Champions screen. 11 cartoon characters with 4 faces each, 231 recorded voice lines in Portuguese and English, 2 music tracks, 12 sound effects, 14 interface languages, and layouts for phone, tablet, desktop and ultrawide screens. There is no money, betting or coin: the points are only a score.

2 Installing on your website

Installing takes a few minutes if you have FTP access or a file manager in your hosting panel.

  1. 1. Extract truco-showdown-static-1.0.0.zip on your computer.
  2. 2. Connect to your hosting by FTP or its file manager and open the folder where the game should live, for example public_html/games/truco-showdown/.
  3. 3. Upload only the contents of the game/ folder, so that index.html sits directly inside the target folder.
  4. 4. Keep css/, src/ and assets/ beside index.html, with names and letter case unchanged.
  5. 5. Open https://your-domain.example/games/truco-showdown/ in a modern browser.
Warning Do not upload the source/ folder, the documentation/ folder or the ZIP itself. Players need no Node.js, PHP, database or account.

3 Requirements

  • Any static web hosting with HTTPS (or HTTP). Opening index.html directly from the disk (file://) does not work, because browsers block JavaScript modules there.
  • A current browser on desktop, tablet or phone: Chrome, Edge, Safari, Firefox or Opera. The game draws with HTML, CSS, a canvas layer for the effects and the Web Animations API, so it needs no 3D graphics.
  • About 29 MB of space on the server. The game makes no request to other websites: the fonts, pictures, sounds, music and voices are all inside game/.
  • Node.js is only needed to run the tests, preview or rebuild the game from source/ (see the development section).
  • Tested on a computer in Chromium (the engine of Chrome and Edge), also in phone-sized windows. It has not been formally tested on physical phones or tablets.

4 How to play

Goal: be the first team to 12 points. In every hand each player gets 3 cards from a 40-card deck (no 8, 9 or 10), and the hand is played as up to 3 tricks: win 2 tricks to take the hand. On your turn, tap a card to play it. The strongest card wins the trick; without trumps the order is 3 2 A K J Q 7 6 5 4. You sit at the bottom; in 2 vs 2 your partner Dona Nena sits across from you and the two rivals at the sides.

Trumps: in Paulista the turned card (the vira) picks the trumps, the next rank up (turn a 6 and every 7 is a trump), and between trumps clubs beat hearts, spades and diamonds. In Mineiro there is no vira and the trumps are fixed: the 4 of clubs, the 7 of hearts, the ace of spades and the 7 of diamonds.

TRUCO: on your turn, before you play a card, you can call TRUCO to make the hand worth more. The other team accepts, folds (your team scores what the hand was worth before the call) or raises. In Paulista a hand is worth 1 and the calls go to 3, 6, 9 and 12; in Mineiro a hand is worth 2 and the calls go to 4, 6, 10 and 12. The computer players call and bluff too, and their faces react.

House rules, all on at the start (each one can be switched off in Quick Match > House rules): Face-down cards (Cover): from the 2nd trick on you can play a card face down, and it never wins. Hand of eleven: when only one team has 11 points (10 in Mineiro), that team chooses to play the hand for 3 points (4 in Mineiro) or to fold and give 1 point (2 in Mineiro); in 2 vs 2 it also sees the partner's cards. Iron hand: when both teams have 11 points (10 in Mineiro), everybody plays blind.

Signal: in 2 vs 2, tap Signal to ask Dona Nena for a sign about her cards; she answers "Got a trump!", "I'm strong" or "I'm weak" (Settings > Partner signals switches it off). Levels: Easy, Normal and Hard. Hard imagines 48 possible deals of the cards it cannot see and plays each one to the end before it chooses. Every computer player only receives what its own seat can see, never your cards (an automated test checks it). At the end of a hand, See the cards shows what everybody held.

Quick Match: choose the style, the players and the level, then press Deal; you play at the Corner Boteco against Zeca and Tico (1 vs 1: Zeca). Circuit: 5 tables of 10 matches, played in Paulista 2 vs 2 and opened in order: Corner Boteco (Zeca and Tico, Easy), Night Bar (Bira and Lola, Easy), Beach Kiosk (Kadu and Tia Cida, Normal), Street Fair (Seu Juca and Vó Zuleica, Normal) and Rooftop (Doutor and Madame Zap, Hard). A match won gives up to 3 stars: 1 for the win, 1 for never folding and 1 for winning after being 4 or more points behind (150 stars in all). Winning match 10 opens the next table, and winning the last table opens the Champions screen.

Settings: Vibration (only where the device supports it), Less motion (it also follows the system setting), Partner signals, Fast game (a quicker pace), Full screen (only where supported), Voices and Language. The Sound panel has the Music and Effects volumes. Play with touch or the mouse. On the table, the gear button pauses the match (Resume, Settings, How to Play, Quit match), and Esc closes the top panel or pauses. In the first hands a "Your turn" plate appears, and if you wait, the cards you can play hop.

5 Screens

Main menu: the logo, then Play (Quick Match), Circuit and How to Play. Sound and Settings stay in the top corner
on every screen.
Main menu: the logo, then Play (Quick Match), Circuit and How to Play. Sound and Settings stay in the top corner on every screen.

Marks on the screenshot

  1. Logo
  2. Play: Quick Match
  3. Circuit
  4. How to Play
  5. Sound
  6. Settings
Quick Match: choose the style, the players and the level, open the house rules and press Deal. The choices are
remembered.
Quick Match: choose the style, the players and the level, open the house rules and press Deal. The choices are remembered.

Marks on the screenshot

  1. Style: Paulista or Mineiro
  2. Players: 2 vs 2 or 1 vs 1
  3. Level: Easy, Normal or Hard
  4. House rules
  5. Deal: start the match
House rules: Face-down cards, Hand of eleven and Iron hand, each with a short help line. All three start on;
the choice is saved.
House rules: Face-down cards, Hand of eleven and Iron hand, each with a short help line. All three start on; the choice is saved.

Marks on the screenshot

  1. The three house rules
A match, 2 vs 2. The score of both teams, the value of the hand and the trick dots on top; Dona Nena across
from you and the rivals at the sides; the deck with the turned card; your cards at the bottom with TRUCO, Cover and Signal.
A match, 2 vs 2. The score of both teams, the value of the hand and the trick dots on top; Dona Nena across from you and the rivals at the sides; the deck with the turned card; your cards at the bottom with TRUCO, Cover and Signal.

Marks on the screenshot

  1. Score: us and them
  2. Value of the hand
  3. Tricks of this hand
  4. Dona Nena, your partner
  5. A rival
  6. Deck and the turned card
  7. Your cards
  8. TRUCO button
  9. Cover
  10. Signal
  11. Settings and pause
A rival calls TRUCO. The call stays beside the rival who made it, and your team answers with Accept, Fold or
Raise.
A rival calls TRUCO. The call stays beside the rival who made it, and your team answers with Accept, Fold or Raise.

Marks on the screenshot

  1. The call of the rival
  2. Accept, Fold or Raise
Hand of eleven: your team has 11 points, so you see Dona Nena's cards under her name and choose to play
the hand for 3 points or to fold.
Hand of eleven: your team has 11 points, so you see Dona Nena's cards under her name and choose to play the hand for 3 points or to fold.

Marks on the screenshot

  1. Hand of eleven
  2. Dona Nena's cards
  3. Play or Fold
A phone in portrait at the Beach Kiosk: the same table, laid out for the tall screen.
A phone in portrait at the Beach Kiosk: the same table, laid out for the tall screen.

Marks on the screenshot

  1. Score: us and them
  2. Dona Nena, your partner
  3. The trumps of this hand
  4. Your cards
  5. Cover
  6. Signal
A Circuit match won: the final score, the stars of the match and the buttons to go on.
A Circuit match won: the final score, the stars of the match and the buttons to go on.

Marks on the screenshot

  1. Result
  2. Stars of the match
  3. Score: us and them
  4. Buttons
The Circuit: the table and its place, its 10 matches with the stars won (a padlock on the matches not open
yet), the two rivals, and the arrows to the other tables.
The Circuit: the table and its place, its 10 matches with the stars won (a padlock on the matches not open yet), the two rivals, and the arrows to the other tables.

Marks on the screenshot

  1. Table and place
  2. The 10 matches
  3. The rivals of this table
  4. Other tables
Settings: Vibration (where the device has it), Less motion, Partner signals, Fast game, Full screen (where
supported), Voices and Language.
Settings: Vibration (where the device has it), Less motion, Partner signals, Fast game, Full screen (where supported), Voices and Language.

Marks on the screenshot

  1. Switches
  2. Language
The language list: 14 languages, each written in its own language. The choice is saved.
The language list: 14 languages, each written in its own language. The choice is saved.

Marks on the screenshot

  1. Languages
How to Play: 6 illustrated pages (trump cards, card order, tricks, Truco!, Cover and Signal, hand of eleven),
from the menu or from the pause.
How to Play: 6 illustrated pages (trump cards, card order, tricks, Truco!, Cover and Signal, hand of eleven), from the menu or from the pause.

Marks on the screenshot

  1. The page and its arrows

6 Files and folders

game/ is the ready-to-host game. source/ has the same editable files plus the automated tests (tests/), package.json with its lock file (the tests, a local preview server and the copy command) and a README. The code is plain JavaScript ES modules with no compile step and no npm dependency.

game/  -  upload these contents to your web host
  index.html  -  the page with every screen
  css/  -  base, table, calls, screens, panels and effects styles
  src/main.js  -  start and screen flow
  src/config.js  -  START HERE: feel numbers (FEEL), sound mix (AUDIO), save prefix
  src/game/  -  cards, rules, match and the computer players (ai.js, ai-eval.js)
  src/ui/  -  cast.js (characters and the 5 tables), the table, screens, panels, effects
  src/audio/  -  sfx.js (sound effects) and voice.js (voice lines)
  src/lib/  -  languages (i18n.js, locales.js, locales/), save (storage.js), text fitting, frames
  assets/img/  -  avatars, bg (backgrounds), cards, fim (end), mesa (table), ui, vida (effects)
  assets/sfx/  -  sound effects (MP3)
  assets/music/  -  2 music tracks (MP3): menu.mp3, mesa.mp3
  assets/audio/voz/  -  voice lines: pedidos/ (Portuguese), pedidos-en/ (English)
  assets/fonts/  -  Fredoka and its license
source/  -  the same editable files, plus:
  package.json, package-lock.json  -  npm test, npm run dev (local preview), npm run build (copy to dist/)
  tests/  -  the automated tests (npm test)
  tools/build.mjs  -  copies the game into dist/ (npm run build)
  tools/serve.mjs  -  local preview server (npm run dev, npm run preview)
  tools/check-node.mjs  -  checks the Node.js version before the commands
  README.md, DO-NOT-UPLOAD.txt
documentation/index.html  -  this guide (offline, 14 languages)
documentation/customization*.html  -  step-by-step customization guide (14 languages)
documentation/img/  -  the screenshots of the guides
DOCUMENTATION.html  -  shortcut to this guide
CUSTOMIZATION.html  -  shortcut to the customization guide
START-HERE.txt, CHANGELOG.txt
THIRD-PARTY-LICENSES/  -  Fredoka license (SIL Open Font License 1.1)
  • src/config.js: FEEL (every time and effect number, and fastFactor, the pace of Fast game), AUDIO (the sound mix) and STORAGE_PREFIX (the name of the save). src/ui/cast.js: the 11 characters (PEOPLE), the partner (PARTNER), the 5 tables of the Circuit (TABLES) and MATCHES_PER_TABLE.
  • src/game/: the rules and the computer players, with no drawing and no timers: cards.js (the deck and the strength of the cards), rules.js (SCALES, DEFAULT_HOUSE, tricks and hands), match.js (a match: commands in, events out, and each seat only gets its own view) and ai.js with ai-eval.js (the 3 levels).
  • src/ui/: the screens and effects: director.js and table.js (the match on screen), screens.js (Quick Match, the Circuit and starsFor), panels.js (the panels, settings and house rules), help.js (How to Play), scenery.js and scenes.js (the backgrounds) and the effect files.
  • src/lib/: the languages (i18n.js, locales.js and the 14 files of locales/), the save (storage.js), text fitting (fit.js), frames (nine.js) and vibration (haptics.js). src/audio/: sfx.js (the sound engine and the effects) and voice.js (which voice line plays, and from which folder).
  • assets/img/: avatars/ (44 faces), bg/ (backgrounds), cards/ (the 6 court cards), fim/ (the end of a match), mesa/ (the snacks and the call balloons), ui/ (buttons, panels, suits, the card back, the trophy), vida/ (effect sprites and switches) and logo.webp. assets/sfx/: the sound effects. assets/music/: the 2 music tracks. assets/audio/voz/: the voice lines. assets/fonts/: Fredoka.
  • Some names are in Portuguese because the game was built that way: voz is voice, pedidos is calls, fim is end and mesa is table. The backgrounds use inicio (title), menu, jogo (table), circuito (circuit), pe (portrait) and deitado (landscape), and the places are boteco, noite, praia, feira and laje. Keep every name: the code builds them, so a renamed file would not load.

7 Customizing

Note Not a programmer? The Customization Guide shows the most common changes step by step. Open CUSTOMIZATION.html in the main folder of the download, or documentation/customization.html.

Customizing

Feel and pace: FEEL in src/config.js has every time and effect number (how long the computer thinks, the card flights, the deal, the call balloons, the particles, the end of a match). fastFactor (0.55) multiplies the times when Fast game is on. These numbers never change a rule.

Characters and tables: src/ui/cast.js has the names and the bluff and boldness of the 11 characters (PEOPLE), the 5 Circuit tables with their two rivals and their level (TABLES) and the number of matches per table (MATCHES_PER_TABLE). The raise values are SCALES in src/game/rules.js, and the stars are starsFor in src/ui/screens.js.

Pictures: replace a file in assets/img/ with another WebP of the same name and a similar size. Each character has 4 faces in assets/img/avatars/, the court cards are in assets/img/cards/, the number cards are drawn by the code with the suit pictures of assets/img/ui/, and every place has backgrounds for portrait and landscape in assets/img/bg/.

Texts: every interface text is in src/lib/locales/, one file per language. The names of the characters are not translated; they are written once, in src/ui/cast.js.

Warning Save prefix: everything is saved in the browser under names that start with trucoshowdown: (STORAGE_PREFIX in src/config.js). If you host two different versions of the game on the same domain, give one of them another prefix, otherwise they share progress and settings. A new prefix starts with fresh progress.

8 Music, voices and sounds

Music: assets/music/menu.mp3 plays on the menu, the Circuit and the Quick Match setup, and assets/music/mesa.mp3 at the table. Each track loops, with a short crossfade at the seam, and starts after the first tap. To replace a track, save another MP3 with the same name. To choose which track plays where, or to play none, edit the setMusic line in src/main.js (null means no music).

The voice lines are MP3 files in assets/audio/voz/: pedidos/ in Portuguese (121 files) and pedidos-en/ in English (110 files), with one folder per character, named with its id (the key in PEOPLE, for example zeca or tia-cida). The lines are truco, seis, nove, dez and doze (the calls), aceito (accept), corro (fold), ganhei-mao and perdi-mao (a hand won or lost), provoca (a tease) and vitoria (victory).

With the Portuguese interface the characters speak Portuguese; with any other language they speak English. The call TRUCO! is always the Portuguese recording, so truco.mp3 is only in pedidos/. Players switch the voices off in Settings > Voices. Which line plays, and from which folder, is the LINES list in src/audio/voice.js.

The sound effects are MP3 files in assets/sfx/, named in SFX_IDS in src/audio/sfx.js. Replace a file and keep its name. A few short sounds (a card landing on the table, the rising notes) are made by the code in sfx.js, which also plays a small synthesized version of an effect until its file has loaded.

The mix is AUDIO in src/config.js: master for everything, music for the music, sfx for the effects, voice for the voice lines and duck (how low the music goes while somebody speaks). In the Sound panel the player sets the Music and Effects volumes; the voices follow Effects.

9 Languages

The game has 14 languages: English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese. The first visit uses the browser language; the player can change it in Settings.

To change a text, edit the same key in src/lib/locales/<code>.js. A key missing in another language falls back to English. To add a language, copy en.js, translate it, then import it and add it to LANGS, LANG_NAMES and STRINGS in src/lib/locales.js.

The language comes from ?lang= at the end of the address (any of the 14 codes, for example ?lang=de), then from the saved choice, then from the browser, and finally English. The Latin alphabets use the included Fredoka font; Russian, Japanese, Korean and Chinese use the fonts of the device. The voices are Portuguese for the Portuguese interface and English for every other language.

10 Saving and resetting

  • The stars of every Circuit match, the open tables, the Champions trophy, the Quick Match choices, the house rules, the volumes, the settings and the language are saved automatically in the browser of each player (localStorage). Nothing is sent to a server.
  • Every value is stored under a name that starts with the prefix below, for example trucoshowdown:circuit. The game keeps working if the browser blocks storage, but then the progress lasts only until the page is closed.
  • To start over, delete these keys in the developer tools (F12), under Application, Local Storage, or clear the site data in the browser.
trucoshowdown:

11 Development (optional)

This section is only for changing the code. The game/ folder already contains the finished game, so installing it needs no Node.js. The game has no npm dependencies and no compile step: npm run build only copies the files into dist/.

1. Install Node.js. Open https://nodejs.org/en/download and choose the latest Node.js 26 LTS installer for your system (minimum 26.13.0). npm is included.

Windows: run the .msi installer, keep npm and Add to PATH enabled, finish the installation and reopen Command Prompt. macOS: run the official .pkg installer and reopen Terminal. Linux: follow the instructions on the same page for your distribution.

2. Check the installation. Run node --version and npm --version separately. Both must print a version number, and Node.js must be 26.13.0 or newer. If a command is not found, reopen the terminal and check that Node.js is in PATH.

node --version
npm --version

3. Extract the complete ZIP first and open its source/ folder, where package.json is. Windows: type cmd in the address bar of that folder in File Explorer. macOS and Linux: open Terminal and use cd with the path of the folder.

4. Run the commands below one by one. npm ci checks the lock file (nothing is downloaded, the project has no dependencies). npm test runs the automated checks: the rules, the computer players (each one only receives what its own seat can see), the match and the limits of the game, among others.

npm ci
npm test

5. Preview: npm run dev starts a local server; open the address it prints in your browser, play for a while, and stop the server with Ctrl+C.

npm run dev

6. Build: npm run build empties source/dist/ and copies index.html, css/, src/ and assets/ into it. dist/ is what you publish; while the source is unchanged it is identical to game/.

npm run build

7. Publish: back up the game on your website, then upload the contents of dist/ in place of the old files, keeping the folders. If you deleted or renamed a file, delete the old one on the server yourself. Clear the cache afterwards.

Note Troubleshooting: ENOENT or a missing package.json means the terminal is in the wrong folder. If a command reports an old Node.js version, install the current LTS version and open a new terminal. If PowerShell blocks npm.ps1, use Command Prompt or run npm.cmd.

12 Updating and clearing the cache

Clearing the cache without losing progress

Progress is stored in this browser, not on the server. Clearing cached images and files, or doing a hard reload, keeps your progress.

Computer: press Ctrl+F5 on Windows and Linux, or Cmd+Shift+R on macOS. Phone: in the browser settings, choose the option to clear cached images and files.

Do not choose cookies and site data, or clear site data, for the game's address. That deletes the local save.

13 Licences and credits

The game code, the artwork, the sound effects, the music and the voice recordings are supplied under the license of the item you purchased.

Third-party part, with its complete license text in THIRD-PARTY-LICENSES/: the Fredoka font (Latin and Latin Extended), under the SIL Open Font License 1.1, also in assets/fonts/. The game has no third-party code library.

14 Common problems

  • Blank page or a game that never opens: the game was opened from the disk or a file is missing. Use a web host and keep every file and folder of game/ next to index.html.
  • No sound: browsers start audio only after the first tap, click or key press. Check the Music and Effects volumes in the Sound panel, the Voices switch in Settings and the volume of the device.
  • A blank page after you edit a code file: a typo in the file. Open the browser console (F12) to see the message, then fix the line or put the original back.
  • The game feels slow on an old phone: turn on Less motion in Settings, which replaces most movements with short fades.
  • The old version still appears after an update: clear the cache (see the section above). Two copies on the same domain share their save (see the save prefix).
  • A picture or a voice is missing or does not change: the file has another name than the one the game asks for, or the letter case differs (servers are case sensitive). Keep the exact names.
  • A script error about the MIME type: your server must send .js files as JavaScript. Most hosts already do; if yours does not, ask them to enable it.

15 FAQ

Does the game need a database or a server language?
No. It is a static website: HTML, CSS, JavaScript, pictures and sounds. There is no PHP, database or account.
Does it use a game engine or a library?
No. It is plain JavaScript ES modules. The rules are pure functions with a seeded shuffle and automated tests, and a canvas layer is used only to draw the backgrounds and the particles.
Can I change the rivals, the tables and the art?
Yes. The Customization Guide shows each change step by step: the feel numbers, the characters and their faces, the rivals and the level of each table, the matches per table, the stars, the house rules, the raise values, the texts, the voices, the sounds, the music, the backgrounds and the logo.
Does it work on phones?
Yes, in portrait and landscape, with touch. It also works on tablets and desktops with a mouse, and on ultrawide screens.
Does it have online play, accounts, a ranking or purchases?
No. There is no online mode, account, ranking, purchase, betting or coin in this edition. The points are only a score, and the progress stays in the browser of the player.
Can two people play against each other?
No. The game is single player against the computer, and your partner Dona Nena is a computer player too. There is no local two-player mode and no online mode.
Which truco rules does it use?
Paulista and Mineiro, chosen in Quick Match (the Circuit is played in Paulista, 2 vs 2). The house rules can be switched off, and the hand values are SCALES in src/game/rules.js.
Can I embed it in my own site?
Yes. Host the game/ contents and show that address in an iframe. Add allow="fullscreen" if you want the full screen option to work.

16 Support

Questions or problems: write to willian@polargames.com.br with your purchase code, the browser and a short description or screenshot.

Support request

When you write to support, include the browser and device, the game version, the page address, the steps that caused the problem, a screenshot and the first error shown in the browser console. Never send passwords, payment details or secret keys.