Polar Games

A card battle game for the web · 1.0.0

Deckwood: Card Battle

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. Languages
  9. Saving and resetting
  10. Development (optional)
  11. Updating and clearing the cache
  12. Licences and credits
  13. Common problems
  14. FAQ
  15. For AI assistants
  16. Support

1 Overview

Deckwood: Card Battle is a complete HTML5 single-player card battle game. You play against the computer on a table with 3 lanes per side. You put critters in the lanes, use tricks, and ring a bell: every critter attacks the critter in front of it, or the rival hero when the lane is free. Each hero has a life total, and you win by bringing the rival to 0.

There are 60 cards: 45 critters and 15 tricks, in 5 families of 12 (Forest, Marsh, Beach, Snow and Storm). The campaign has 5 worlds of 8 duels, 40 in all: Sunny Glade, Mushroom Marsh, Shell Cove, Frost Village and Storm Castle. The 8th duel of every world is a boss. You start with the 12 Forest cards and win the other 48 by winning duels. There is no shop, no pack and no purchase.

Around the duels: deck building with 3 named decks, an album of the 60 cards, card backs and tables to unlock, a Daily Challenge with a borrowed deck, an Arena that opens after the campaign, 3 difficulty levels, up to 3 stars per duel, short picture stories, 14 interface languages, music and sound effects, and a layout for phone, tablet and desktop. Everything is drawn with pictures made for the game, so the cards, bosses and screens can be reskinned by replacing files.

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 deckwood-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/deckwood/.
  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/, data/ and assets/ beside index.html, with names and letter case unchanged.
  5. 5. Open https://your-domain.example/games/deckwood/ 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 and the Web Animations API, so it needs no 3D graphics.
  • About 28 MB of space on the server (521 files). The game makes no request to other websites: the fonts, pictures, sounds and music are all inside game/.
  • Node.js is only needed to run the tests or to rebuild the game from source/ (see the development section).

4 How to play

Goal: bring the rival hero to 0 life. You start a duel with 20 life; the rival has the life of the duel (it grows from 8 to 23 through the campaign and changes with the difficulty). Each turn you get 1 more acorn, up to 8, and every card costs acorns. You may hold up to 7 cards, and a deck has exactly 20 cards, up to 2 copies of the same card.

Playing a card: drag it from your hand to a free lane (a critter) or onto the table or an enemy critter (a trick). A critter put on top of your own critter replaces it. Press and hold any card to read what it does. At the start you may swap up to 2 cards of your opening hand: tap the cards to mark them, then tap Ready.

Ringing the bell: tap the bell and every critter attacks the critter in front of it, or the rival hero when that lane is free. To see the result before you ring, rest your finger on the bell (or point at it with the mouse): arrows and skulls show who will hit whom. If you still have a card you can play, the game can warn you once (an option in Settings).

Extras in the duel: Fox Zap (the button near your medallion) costs 2 acorns and does 1 damage to an enemy critter or the rival hero, once a turn; Undo takes back your last play (not when it drew a card or ended the duel); a button speeds up the rival turn, and the Fast duels option does it for good. 3 critters of one family on your lanes give +1 attack to each. Tap a pile of fallen cards to see them.

Abilities: Shield ignores the first hit, Cheer gives +1 attack to the critters beside it, Thorn hurts whoever hits it, Heal restores 2 life to your hero, Fly goes over the critter in front, Double Strike attacks twice, Grow gains +1 attack each of your turns, Taunt takes the blows aimed at your hero from its lane or beside it, and Last Breath hurts the critter in front when it falls. Tricks heal, damage, boost, blast every enemy critter, draw, freeze one or all, hit the rival hero or push an enemy critter to another lane.

Stars and rewards: every duel gives up to 3 stars: one for the win, one for the life you have left, and one for the challenge of the duel (win losing few critters, win by a given turn, use the fox power, or get the family bonus). Winning the 8th duel of a world beats its boss and opens the next world. Winning on Hard earns a crown. Stars and bosses unlock card backs, tables and golden frames in Style.

Daily Challenge: one duel made from the date, with a borrowed deck. It needs no server, it counts the days in a row, and the first try of a day is the same for everyone (each new try shuffles again). Arena: opens after the campaign; you play duels in a row, your life carries over and heals a little between duels, and the record is kept.

5 Screens

Main menu: the logo, a fan of cards, the Album, Style, Daily and Arena buttons, then Play, Decks and How to
Play. Sound and Settings stay at the top right.
Main menu: the logo, a fan of cards, the Album, Style, Daily and Arena buttons, then Play, Decks and How to Play. Sound and Settings stay at the top right.

Marks on the screenshot

  1. Logo
  2. Album
  3. Style
  4. Daily challenge
  5. Arena
  6. Play
  7. Decks
  8. How to Play
  9. Sound
  10. Settings
How to Play: the illustrated steps of the game. Turn the pages with the arrow or by sliding, and the last page
has a Play button.
How to Play: the illustrated steps of the game. Turn the pages with the arrow or by sliding, and the last page has a Play button.

Marks on the screenshot

  1. How to Play
  2. Buttons
The campaign map, one world at a time. The arrows beside the world name change the world; the next duel to play
glows. Stars are counted at the top.
The campaign map, one world at a time. The arrows beside the world name change the world; the next duel to play glows. Stars are counted at the top.

Marks on the screenshot

  1. Back
  2. Stars
  3. World name and arrows
  4. Your deck
  5. Play
Before a duel: the rival and a line of the story, the difficulty, the challenge for the third star, and a
button to change your deck.
Before a duel: the rival and a line of the story, the difficulty, the challenge for the third star, and a button to change your deck.

Marks on the screenshot

  1. Story and rival
  2. Difficulty
  3. Challenge for the third star
  4. Your deck
  5. Start the duel
A duel. Rival hero and hand on top, three lanes per side, your hand below, the acorns, the pile of cards and the
bell. The fox power and Undo sit near your medallion.
A duel. Rival hero and hand on top, three lanes per side, your hand below, the acorns, the pile of cards and the bell. The fox power and Undo sit near your medallion.

Marks on the screenshot

  1. Rival hero and life
  2. Lanes
  3. Your hand
  4. Acorns
  5. Bell
  6. Fox Zap
  7. Your hero
The deck builder: a table of 20 places (tap a card of the collection to add it, tap a place to take it out), the
acorn curve, an advice line, filters by family and Build for an automatic deck.
The deck builder: a table of 20 places (tap a card of the collection to add it, tap a place to take it out), the acorn curve, an advice line, filters by family and Build for an automatic deck.

Marks on the screenshot

  1. The 20 places of the deck
  2. Cards in the deck
  3. Filters by family
  4. The cards
  5. Build an automatic deck
  6. Save
The Album: the 60 cards, with filters by family. Tap a card you own to see it big. Style opens from here.
The Album: the 60 cards, with filters by family. Tap a card you own to see it big. Style opens from here.

Marks on the screenshot

  1. Filters by family
  2. The cards
  3. Style
The end of a duel: stars, new cards won and the buttons to go on, try again or go back to the map.
The end of a duel: stars, new cards won and the buttons to go on, try again or go back to the map.

Marks on the screenshot

  1. Result and stars
  2. Buttons
Settings: vibration (where the device has it), less motion, camera motion, fast duels, the warning about
plays left, full screen and language.
Settings: vibration (where the device has it), less motion, camera motion, fast duels, the warning about plays left, full screen and language.

Marks on the screenshot

  1. Less motion
  2. Fast duels
  3. 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
A phone in portrait: the table fits the screen and the hand sits at the bottom.
A phone in portrait: the table fits the screen and the hand sits at the bottom.

6 Files and folders

game/ is the ready-to-host game. source/ has the same editable files plus the tests, a local preview server and the build command. 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/  -  the look of the screens (ui-art.css holds the 9-slice frames of the interface art)
  data/cards.js  -  START HERE: the 60 cards (cost, attack, life, ability, family)
  data/campaign.js  -  the 5 worlds, 40 duels, opponents, terrains, boss powers, difficulty and rewards
  src/config.js  -  the "feel" numbers (speeds, sizes, times) and the name of the save
  src/game/  -  the rules (rules.js), the computer player, the campaign builder, decks, Daily and Arena
  src/battle/  -  the duel screen: layout, drag and drop, the bell, the hand, the timeline of events
  src/render/  -  effects: particles, impact marks, the juice of the duel
  src/app/  -  map, story, deck builder, album, style, result, panels and the save
  src/audio/audio.js  -  sound effects and music
  src/lib/  -  language (i18n.js), the 14 locales/, storage, full screen, 9-slice frames
  assets/cards/  -  one picture per card
  assets/chars/  -  the fox and the 5 bosses
  assets/bg/, ui/, fx/, screens/  -  maps, tables, interface and effects
  assets/story/, tutorial/  -  the story pictures and the How to Play pictures
  assets/audio/  -  sound effects and music (MP3)
  assets/fonts/  -  Fredoka and Rubik, with their licenses
  DOCUMENTATION.txt  -  short note that points to this guide
source/  -  the same editable files, plus:
  package.json, package-lock.json
  README.md, DO-NOT-UPLOAD.txt
  tests/  -  npm test
  tools/build.mjs  -  copies the game into dist/
  tools/serve.mjs  -  local preview server (npm run dev, npm run preview)
  tools/check-node.mjs  -  checks the Node.js version before the commands
documentation/index.html  -  this guide (offline, 14 languages)
documentation/customization.html  -  step-by-step customization guide
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 and Rubik licenses
  • data/cards.js: the 60 cards (cost, attack, life, ability, family) and data/campaign.js: the 5 worlds, the 40 duels, the opponents, the terrains, the boss powers, the difficulty and the rewards. These two files are the first to edit.
  • src/game/: the rules (rules.js, a pure machine with tests), the computer player (ai.js), the campaign builder, the decks and the Daily and Arena modes. src/config.js has every "feel" number: speeds, sizes and times of the animations, sound levels and the name of the save.
  • src/battle/: the duel screen (layout, drag and drop, the bell, the hand, the swap of the opening cards, the timeline that shows the events). src/render/: the effects (particles, impact marks, the juice of the duel).
  • src/app/: the other screens (map, story, deck builder, album, style, result, panels) and the save (store.js). src/audio/audio.js: sound effects and music. src/lib/: language, storage, full screen and the 9-slice frames.
  • index.html: the page with every screen. css/: the look of the screens; ui-art.css holds the 9-slice frames of the interface art.
  • assets/cards/: one picture per card. assets/chars/: the fox and the 5 bosses. assets/bg/: maps, tables and scenes. assets/ui/, assets/fx/ and assets/screens/: interface and effects. assets/story/ and assets/tutorial/: pictures of the stories and of How to Play. assets/audio/: sounds and music. assets/fonts/: Fredoka and Rubik with their licenses.

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

Cards: data/cards.js has one line per card with its cost, attack, life and ability. The picture of a card is assets/cards/<id>.webp (512 x 512, transparent). The names of tricks are texts (c_<id> in src/lib/locales/); critter names are the same in every language.

Campaign: data/campaign.js holds the opponent life and level of each duel, the terrain of each world, the boss powers, the three difficulty levels, the challenges and the star prizes. World and boss names are texts (world_0 to world_4, b_moss, b_croak, b_marola, b_frost, b_caw).

Pictures: replace a file in assets/ with another WebP of the same name and a similar size. The card backs are assets/ui/back-<family>.webp, the tables assets/bg/table-<family>.webp, the maps assets/bg/map-<family>.webp, and the story pictures assets/story/.

Feel and speed: FEEL in src/config.js (the speed of the duel, how long a card takes to fly, the shake and the pauses). The numbers of the rules (life, deck size, hand size, acorns) are RULES at the top of src/game/rules.js.

Sounds and music

Every effect is an MP3 in assets/audio/, named with its id, and the music is m-menu, m-battle, m-battle-b, m-menu-b and m-boss. Replace a file and keep its name.

The game plays 89 sound effects and 5 music tracks. The list of effects is SFX in src/audio/audio.js, and tracks and duelTracks in src/config.js choose the music of the menu, the duels and the bosses. To add a sound, put the MP3 in the folder and add its name to SFX.

Warning Save key: everything is saved in the browser under one name, deckwood.v1 (GAME.save in src/config.js). If you host two different versions of the game on the same domain, give one of them another name, otherwise they share progress and language.

8 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 STRINGS and LANG_NAMES in src/lib/i18n.js; the automatic test counts 14 languages, so change that number in tests/locales.test.mjs too.

There is no address switch for the language: the first visit uses the language of the browser and the player changes it in Settings, where it is remembered. Critter names are the same in every language. The Latin alphabets use the included Fredoka font and Russian uses the included Rubik font. Japanese, Korean and Chinese use the fonts of the device.

9 Saving and resetting

  • Stars, cards won, decks, style, settings, volumes, language, the Daily Challenge and the Arena record are saved automatically in the browser of each player (localStorage). Nothing is sent to a server.
  • Everything is stored as one object under the key deckwood.v1. 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.
deckwood.v1

10 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 checks: the rules, the 40 duels, the decks, the save, the 14 languages, the pictures and sounds and the package.

npm ci
npm test

5. Preview: npm run dev starts a local server; open http://localhost:5180/ 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/, data/ 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. EBADENGINE, or the Node.js message printed before npm test, means Node.js is too old. If PowerShell blocks npm.ps1, use Command Prompt or run npm.cmd.

11 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.

12 Licences and credits

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

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

13 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 both volumes in the Sound panel and the volume of the device.
  • A blank page after you edit a data or 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. The duel draws many pictures at once, so a very old device may need it.
  • 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 key).
  • A card shows no picture or a wrong picture: the file assets/cards/<id>.webp has another name than the id in data/cards.js, or the letter case differs (servers are case sensitive).

14 FAQ

Does the game need a database or a server language?
No. It is a static website: HTML, CSS, JavaScript, pictures and sounds. The cards and the campaign are JavaScript files next to the game.
Does it use a game engine or a library?
No. It is plain JavaScript ES modules. The rules are a pure, seeded state machine with automated tests, and the computer plans its turn with a beam search.
Can I make my own cards and my own campaign?
Yes. Edit data/cards.js and data/campaign.js (see the Customization Guide) and run npm test. A new card also needs its picture and, for a trick, its name in the 14 language files.
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 ads, accounts, an online ranking or purchases?
No. There is no ad, account, ranking, online mode, shop or payment in this edition: it is a single-player game 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. There is no two-player mode and no online mode.

15 For AI assistants

If you ask an AI assistant to help you change this game, give it the prompt below together with your request. It describes the project so the assistant works on the right files and does not break the rules of the game.

You are helping me change "Deckwood: Card Battle", a finished HTML5 single-player card battle game (version 1.0.0). Read these facts before you edit anything.

PROJECT
- Plain JavaScript ES modules, HTML and CSS. No bundler, no compile step, no npm dependencies, no game engine, no external library.
- The editable project is source/ (the same files as game/, plus tests and tools). Edit source/, never game/ or source/dist/.
- npm run build copies index.html, css/, src/, data/ and assets/ into source/dist/ and nothing else. Upload the CONTENTS of dist/ (or game/) to a static web host. The game does not run from file://.
- Node.js 26.13.0 or newer is needed only for: npm ci, npm test, npm run dev (http://localhost:5180/), npm run build, npm run preview.

GAME
- Single player against the computer. 60 cards (45 critters, 15 tricks) in 5 families of 12: forest, marsh, beach, snow, storm. A duel has 3 lanes per side, a deck of exactly 20 cards (at most 2 copies of a card), 20 life for the player, acorns as energy (1 more per turn, up to 8), at most 7 cards in hand, a swap of up to 2 opening cards, a bell that makes every critter attack the one in front or the rival hero.
- data/cards.js: every card (id, fam, type, cost, atk, hp, ab, fx, name). The picture of a card is assets/cards/<id>.webp (512 x 512, transparent). Trick names are texts: key c_<id> in src/lib/locales/*.js. Critter names are the same in every language.
- data/campaign.js: 5 worlds x 8 duels = 40 duels, the 8th of each world is a boss (moss, croak, marola, frost, caw) with a power in bossPowers; hp and level tables, terrain per world (mud, sand, ice, spark), difficulty (easy, normal, hard), stars (win, life, challenge), daily and arena settings, milestones. src/game/campaign.js builds the duels and has STARTER (the 12 forest cards).
- src/game/rules.js: RULES (hp, deckSize, copies, hand, handMax, lanes, energyMax, powerCost...) and the pure, seeded state machine. src/game/ai.js: the computer player (beam search). Never put screen code in src/game/.
- src/config.js: FEEL (every number of speed, size and time of the animations), FEEL.audio (music tracks, gains) and GAME.save, the name of the save (deckwood.v1).
- src/battle/: the duel screen. src/render/: effects. src/app/: map, story, decks, album, style, result, panels, store.js (the save and the unlocks).
- Texts: src/lib/locales/<code>.js, 14 languages (en, pt, es, fr, de, it, nl, pl, tr, ru, id, ja, ko, zh), same keys in every file; English is the fallback. New text goes in all 14. Languages are listed in src/lib/i18n.js.
- Saving: one object in localStorage under the key deckwood.v1, through src/lib/storage.js. Add nothing to another key.
- Sounds: assets/audio/<name>.mp3 listed in SFX in src/audio/audio.js; music tracks in FEEL.audio.

RULES FOR YOU
1. Make the smallest change that does what I ask. Do not rename or move files. A file name used by the code (assets/..., the card id) must keep matching.
2. Run npm test after every change and fix what it reports. Run npm run build at the end.
3. Test through a web server (npm run dev), never from file://.
4. Add no network request, CDN, analytics, advertising or external font. Keep THIRD-PARTY-LICENSES/ and assets/fonts/*-OFL.txt.
5. Keep comments in English and keep the last line of each own JavaScript and CSS file: // End of <path> (complete file).

MY REQUEST:
(write what you want here)

Replace the last line with what you want, for example: make Forest cards cheaper, add a new critter or change the boss of world 2. Always run npm test after the change.

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.