Contents
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. Extract
truco-showdown-static-1.0.0.zipon your computer. -
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. Upload only the contents of the
game/folder, so thatindex.htmlsits directly inside the target folder. -
4. Keep
css/,src/andassets/besideindex.html, with names and letter case unchanged. -
5. Open
https://your-domain.example/games/truco-showdown/in a modern browser.
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.htmldirectly 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
Marks on the screenshot
- Logo
- Play: Quick Match
- Circuit
- How to Play
- Sound
- Settings
Marks on the screenshot
- Style: Paulista or Mineiro
- Players: 2 vs 2 or 1 vs 1
- Level: Easy, Normal or Hard
- House rules
- Deal: start the match
Marks on the screenshot
- The three house rules
Marks on the screenshot
- Score: us and them
- Value of the hand
- Tricks of this hand
- Dona Nena, your partner
- A rival
- Deck and the turned card
- Your cards
- TRUCO button
- Cover
- Signal
- Settings and pause
Marks on the screenshot
- The call of the rival
- Accept, Fold or Raise
Marks on the screenshot
- Hand of eleven
- Dona Nena's cards
- Play or Fold
Marks on the screenshot
- Score: us and them
- Dona Nena, your partner
- The trumps of this hand
- Your cards
- Cover
- Signal
Marks on the screenshot
- Result
- Stars of the match
- Score: us and them
- Buttons
Marks on the screenshot
- Table and place
- The 10 matches
- The rivals of this table
- Other tables
Marks on the screenshot
- Switches
- Language
Marks on the screenshot
- Languages
Marks on the screenshot
- 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, andfastFactor, the pace of Fast game),AUDIO(the sound mix) andSTORAGE_PREFIX(the name of the save).src/ui/cast.js: the 11 characters (PEOPLE), the partner (PARTNER), the 5 tables of the Circuit (TABLES) andMATCHES_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) andai.jswithai-eval.js(the 3 levels). -
src/ui/: the screens and effects:director.jsandtable.js(the match on screen),screens.js(Quick Match, the Circuit andstarsFor),panels.js(the panels, settings and house rules),help.js(How to Play),scenery.jsandscenes.js(the backgrounds) and the effect files. -
src/lib/: the languages (i18n.js,locales.jsand the 14 files oflocales/), 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) andvoice.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) andlogo.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:
vozis voice,pedidosis calls,fimis end andmesais table. The backgrounds useinicio(title),menu,jogo(table),circuito(circuit),pe(portrait) anddeitado(landscape), and the places areboteco,noite,praia,feiraandlaje. Keep every name: the code builds them, so a renamed file would not load.
7 Customizing
CUSTOMIZATION.html in the main folder of the download, or
documentation/customization.html.
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.
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.
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 toindex.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
.jsfiles 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?
Does it use a game engine or a library?
Can I change the rivals, the tables and the art?
Does it work on phones?
Does it have online play, accounts, a ranking or purchases?
Can two people play against each other?
Which truco rules does it use?
SCALES in src/game/rules.js.
Can I embed it in my own site?
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.