Polar Games

A dragon tap puzzle game for the web · 1.0.0

Lucky Dragon Escape

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. Internal names in the code
  8. Customizing
  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

Lucky Dragon Escape is a complete HTML5 dragon tap puzzle game. Colorful dragons are tucked into a festival board, each one pointing the way it will fly. The player taps a dragon and it flies out of the board head first, but only if no other dragon is in its path. The goal is to send every dragon home. Tapping a blocked dragon costs a mistake, and finishing a level with no mistakes earns 3 stars.

It has 100 levels in 5 worlds of 20 levels: Lantern Festival, Bamboo Grove, Jade Lake, Blossom Mountain and Moonlit Temple. The boards grow from a few dragons to dozens, and many boards are shaped like a picture. New pieces arrive with the worlds: sleepy dragons that need one extra tap (from level 21), lucky clouds, where what is under the cloud blocks nobody (from level 41), pairs tied with lucky knots that only leave together (from level 61) and gong dragons that must leave before their number runs out (from level 81).

Around the puzzle: free undo and hint, a daily challenge on a new board every day, a level select with one page per world, a final screen after level 100, festival fireworks when you clear a level, petals and leaves that drift across each world (with a switch to turn them off), painted dragons in 6 colors, a mascot that reacts, combo words and rising notes when dragons leave in a row, 12 sound effects, 2 festival music tracks, vibration, a less-motion option, full screen, 14 interface languages and layouts for phone, tablet, desktop and ultrawide screens, in portrait and landscape.

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 lucky-dragon-escape-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/lucky-dragon-escape/.
  3. 3. Upload only the contents of the game/ folder, so that index.html sits directly inside the target folder.
  4. 4. Keep assets/, css/ and src/ beside index.html, with names and letter case unchanged.
  5. 5. Open https://your-domain.example/games/lucky-dragon-escape/ 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: Chrome, Edge, Firefox, Safari or Opera, on desktop or mobile.
  • About 6 MB of space on the server. The game makes no request to other websites: fonts, pictures, sounds and levels 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

Tap a dragon and it flies out of the board head first. If another dragon is in its way, it bumps into it, the dragon in the way flashes, the tap costs one mistake and nothing moves. Tap the dragon that is in the way first. Every board can be solved: there is always a dragon that can leave.

Every level gives 1 to 3 stars: 3 for no mistakes, 2 for one or two mistakes and 1 for more. Finishing a level opens the next one whatever the stars. Undo takes back the last dragon and Hint makes a dragon that can leave right now glow. Both are free and unlimited.

New pieces: a sleepy dragon (closed eyes and Zzz) needs one tap to wake up, which costs nothing, and then a tap to leave. A lucky cloud floats over some cells: a dragon under it blocks nobody. Two dragons tied with lucky knots are chained: they leave together, when the way is clear for the pair. A gong dragon wears a number: it must leave before that many other dragons have left, or the game says Too slow! and the level starts again.

During a level, Pause (top left) opens Resume, Restart, Levels and Home. The sound button (top right) opens the music and effects volume sliders and the gear opens Settings. The Daily button on the menu opens a new board every day; it never changes the progress of the 100 levels, which is saved automatically after every level. The game is played with a finger or a mouse.

5 Screens

Title screen: tap anywhere to start. Sound and Settings stay in the top corner of every screen.
Title screen: tap anywhere to start. Sound and Settings stay in the top corner of every screen.

Marks on the screenshot

  1. Logo
  2. Start prompt
  3. Sound: music and effects volume
  4. Settings
Menu: Play continues with the first level not finished yet. The level plate opens the level select, Daily starts
the board of the day and How to play shows the rules.
Menu: Play continues with the first level not finished yet. The level plate opens the level select, Daily starts the board of the day and How to play shows the rules.

Marks on the screenshot

  1. Play
  2. Level select
  3. Daily challenge
  4. How to play
Level select: one red and gold board per world with its 20 levels and their stars. Use the arrows or swipe to
change world. The next level to play is highlighted, and a locked world can be looked at before it opens.
Level select: one red and gold board per world with its 20 levels and their stars. Use the arrows or swipe to change world. The next level to play is highlighted, and a locked world can be looked at before it opens.

Marks on the screenshot

  1. World name
  2. Levels of this world
  3. Next level
  4. Change world
  5. World pages
A level (landscape): the board fills the screen. Pause, the level number and your stars are at the top, Undo
and Hint at the bottom. The glowing dragon is the hint.
A level (landscape): the board fills the screen. Pause, the level number and your stars are at the top, Undo and Hint at the bottom. The glowing dragon is the hint.

Marks on the screenshot

  1. Pause
  2. Level number
  3. Stars
  4. Undo
  5. Hint
Level 25: sleepy dragons (closed eyes and Zzz) wake up with one tap. A one-line help appears the first time a
new piece shows up.
Level 25: sleepy dragons (closed eyes and Zzz) wake up with one tap. A one-line help appears the first time a new piece shows up.
Level 45: a lucky cloud. What is under the cloud blocks nobody.
Level 45: a lucky cloud. What is under the cloud blocks nobody.
Level 65: dragons tied with lucky knots leave together.
Level 65: dragons tied with lucky knots leave together.
Level 85: a gong dragon must leave before its number runs out.
Level 85: a gong dragon must leave before its number runs out.
Many boards have the shape of a picture instead of a plain rectangle.
Many boards have the shape of a picture instead of a plain rectangle.
Level complete: the stars depend on the mistakes. Replay the level or go to the next one.
Level complete: the stars depend on the mistakes. Replay the level or go to the next one.

Marks on the screenshot

  1. Stars
  2. Replay
  3. Next level
Settings: vibration, less motion, wind and leaves, full screen and language.
Settings: vibration, less motion, wind and leaves, full screen and language.

Marks on the screenshot

  1. Vibration
  2. Less motion
  3. Wind and leaves
  4. Full screen
  5. Language
How to play: the rules in four lines, with pictures.
How to play: the rules in four lines, with pictures.
A phone in portrait: the board fills the screen, with Pause and the stars above it.
A phone in portrait: the board fills the screen, with Pause and the stars above it.
The menu on a phone.
The menu on a phone.

6 Files and folders

game/ is the ready-to-host game. source/ has the same editable files plus the tests, a local preview server, the level generator 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: every screen and panel
  css/                       layout and look (base.css, screens.css)
  src/config.js              START HERE: layout, colors, game feel, volumes
  src/main.js                start-up, loop, input, saving, flow between screens
  src/app/                   the board scene (game.js) and the screens (ui.js)
  src/game/                  rules, level generator, worlds, difficulty
  src/game/levels/           the 100 levels (pack-1.js to pack-5.js)
  src/render/                dragons, painted skin, board tray, particles, ambient petals
  src/audio/                 sound effects and music
  src/lib/                   languages, text fitting, fullscreen, vibration, saving
  src/lib/locales/           interface texts, one file per language
  assets/                    backgrounds, dragons, interface art, mascot (WebP), icon
  assets/sfx/, assets/music/ sound effects and music (MP3)
  assets/fonts/              Lilita One, Fredoka and their licenses
  DOCUMENTATION.txt          short note that points to this guide
source/                      the same editable files, plus:
  package.json, package-lock.json
  README.md
  tests/                     npm test (25 checks)
  tools/build.mjs            copies the game into dist/
  tools/serve.mjs            local preview server (npm run dev, npm run preview)
  tools/generate-levels.mjs  the level generator (npm run levels)
  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/        Lilita One and Fredoka licenses
  • src/config.js: the first file to edit. LAYOUT (board and screen sizes), COLORS (the 6 dragon colors), FEEL (every animation and game-feel number, including the festival fireworks), AUDIO (volumes and pitch steps) and STARS (the mistakes allowed for 3 and for 2 stars).
  • src/game/: rules.js (the rules, with no drawing and no sound), levels/pack-1.js to pack-5.js (the 100 levels), generator.js (the level generator, also used for the daily challenge), difficulty.js and worlds.js.
  • src/main.js: start-up, the main loop, input, saving and the reaction to each event. src/app/game.js: the board scene. src/app/ui.js: screens, panels, level select, settings and the mascot.
  • src/render/: dragons, painted skin, board tray, particles, ambient petals and leaves and the pictures of How to play. src/audio/: sound effects and music.
  • index.html: every screen and panel. css/: layout and look. src/lib/: languages, text fitting, fullscreen, vibration and saving. src/lib/locales/: one text file per language.
  • assets/: backgrounds, dragon pictures, interface art and the mascot (WebP), assets/sfx/ and assets/music/ (MP3) and assets/fonts/ (fonts with their licenses). tools/generate-levels.mjs: the level generator.

7 Internal names in the code

A few names in the code differ from the words on screen. They are only names: players never see them. In the code the dragons are called snakes (you will see snake in file and function names such as snakes.js), and the lucky cloud is a bridge.

  • The board under the dragons is the tray, the painted head, body and tail of a dragon are its skin, a gong dragon is a rush dragon (r in a level) and a lucky-knot pair is a chain (c in a level).
  • In a level, w and h are the board size, s lists the dragons, sol is the stored solution (the order of the dragons) and t lists the lucky cloud cells. A dragon is a short text such as 2a3DDLLU: color, x, y and then the moves from the head to the tail.
  • Sounds are named by what happens: slide, pop, bump, star, win and so on. The files are assets/sfx/<name>-1.mp3, -2.mp3.
  • Levels are numbered 1 to 100 in order. The save keeps the stars by level number (0 to 99).
  • The game has no debug links and no test hooks: what players see is the whole game.

8 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

Brand: the name in the browser tab is the <title> line of index.html. The logo is assets/logo.webp (1000 x 591 pixels, transparent background) and the page icon is assets/icon-180.png. The mascot is assets/mascot-idle.webp and its four other poses.

Pictures: replace a file in assets/ with another WebP of the same name and a similar size. The 5 world backgrounds are assets/bg-portrait.webp, bg-landscape.webp and the same with bg-w2 to bg-w5.

Levels: src/game/levels/pack-1.js to pack-5.js, 20 levels each. They are made by npm run levels from the recipe in tools/generate-levels.mjs, which writes the packs again (about 45 seconds); you can also edit a pack by hand. Run npm test after every change: it plays the stored solution of every level and tells you which one no longer wins.

Difficulty and feel: COLORS, LAYOUT and FEEL in src/config.js, and the recipe of each level (board size, dragon length, free dragons at the start, how deep the blocking chains are) in tools/generate-levels.mjs.

Sounds and music

Every effect is an MP3 in assets/sfx/, named with its id and a number, for example slide-1.mp3. Most sounds have two versions and the game alternates them. Replace a file keeping its name. The music is assets/music/menu.mp3 and game.mp3.

To add a version, put the file in the folder and raise its number in SFX_FILES in src/audio/sfx-files.js. The volume of each sound is in AUDIO.gains in src/config.js.

Warning Save keys: the progress is saved under the prefix dragon-escape.template: (STORAGE_PREFIX in src/config.js). If you host more than one copy of the game on the same domain, change the prefix in each copy.

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, and add its code and name to LANGS in src/lib/i18n.js (and to the list in tests/locales.test.js). The Settings panel shows it by itself.

The titles use the Lilita One font and the texts use Fredoka, both included (Latin alphabets). Cyrillic, Japanese, Korean and Chinese use the fonts of the device.

10 Saving and resetting

  • Stars, unlocked levels and worlds, settings, volumes and language are saved automatically in the browser of each player (localStorage). Nothing is sent to a server.
  • The progress is stored under the prefix below: level is the furthest level and stars holds the stars of each level. The language is stored under dragon-escape.template:lang.
  • To start over, delete these keys in the developer tools (F12), under Application, Local Storage, or clear the site data in the browser.
dragon-escape.template:level

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 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 25 checks on the 100 levels, the rules, the 14 languages 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/ 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.

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 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 Lilita One and Fredoka fonts (SIL Open Font License 1.1, also in assets/fonts/). The project has no other third-party 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 or click (cutting the rope on the title screen does this). Check both volumes in the Sound panel and the volume of the device.
  • A blank page after you edit a level pack: a typo made the file invalid JavaScript. Run npm test before publishing.
  • The game feels slow on an old phone: turn on Less motion and turn off Wind and leaves in Settings to reduce the effects (Less motion also turns off the fireworks).
  • The old version still appears after an update: clear the cache (see the section above). Two copies on the same domain share their saved games: give each copy its own STORAGE_PREFIX.

15 FAQ

Does the game need a database or a server language?
No. It is a static website: HTML, CSS, JavaScript, pictures and sounds. The levels are JavaScript files next to the game.
Does it use a physics engine or a library?
No. The rules, the dragons and the drawing are original code written for this game on a plain HTML canvas, and the tests play every level.
Can I make my own levels?
Yes. Change the recipe and run npm run levels, or write levels by hand (see the Customization Guide) and run npm test. A level also needs a stored solution (sol): the tests and the hint use it.
Does it work on phones?
Yes, in portrait and landscape, with touch. It also works with a mouse on desktop.
Does it have ads, accounts or an online ranking?
No. There is no ad, account, payment or online service in this edition: progress stays in the browser of the player.

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.