Polar Games

A pipe puzzle game for the web · 1.0.0

Otter Flow

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

Otter Flow is a complete HTML5 pipe puzzle game. Tap the pipes to turn them and lead the water from the valve to the tub with no leaks. An otter engineer in a hot-spring valley cheers you on.

It has 100 levels in 5 worlds of 20 levels: Pine Springs, Cedar Dam, Mill Creek, Stone Viaduct and Twin Geysers. Each world adds something new: straight pipes and curves, then T-junctions, rocks and locked pipes, waterwheels, overpass bridges and, at the end, a cold spring and a hot spring that must each reach their own tub.

Every level gives 1 to 3 stars by the number of moves. There is also a Daily Puzzle (a new board every day, with a streak counter) and a Pressure Mode with a timer. The board, the pipes and the water are drawn in code; the levels are built by the game from fixed seeds and every one of them is checked by the automated tests.

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 otter-flow-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/otter-flow/.
  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/otter-flow/ 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 9 MB of space on the server. The game makes no request to other websites: fonts, pictures and sounds 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 (or click) a pipe to turn it a quarter turn. Water runs from the valve through every pipe that is joined to it. Join the valve to the tub so that no pipe end is left open: an open end is a leak and the level is not complete. In Mill Creek every waterwheel must turn, and in Twin Geysers the cold water and the hot water must each reach the tub of their own colour.

Stars: finish at par (the number of moves shown next to yours) or below for 3 stars, up to 3 moves over par for 2 stars, and with more moves for 1 star. Rocks never move and locked pipes cannot be turned.

Buttons during a level: Pause (Escape on a keyboard) opens Resume, Restart, Levels and Menu. Hint turns one pipe into place and can be used 3 times per attempt. Reset puts the board back to the start.

Daily: Today's Puzzle is a new board each day, the same for every player on that date, and the streak counts the days you solved it. Pressure Mode is a run of boards against a timer that grows harder every few rounds; when the time runs out you can try the round again. Progress is saved automatically.

5 Screens

Title screen: the otter on the pier of the hot spring. Tap the button to start.
Title screen: the otter on the pier of the hot spring. Tap the button to start.

Marks on the screenshot

  1. Logo
  2. Start button
Main menu: Play continues from your next level; Daily, Levels and How to play. Sound and Settings stay in the
corner.
Main menu: Play continues from your next level; Daily, Levels and How to play. Sound and Settings stay in the corner.

Marks on the screenshot

  1. Play
  2. Daily
  3. Levels
  4. How to play
  5. Sound: music and effects volume
  6. Settings
Level map: 20 levels per world, each with 0 to 3 stars. Use the arrows to change world; the stars of the world
are at the top.
Level map: 20 levels per world, each with 0 to 3 stars. Use the arrows to change world; the stars of the world are at the top.

Marks on the screenshot

  1. Back
  2. World name
  3. Stars in this world
  4. A level and its stars
  5. Next world
Pine Springs: straight pipes and curves. The bar at the top shows the level, the stars you would get now and
your moves against par.
Pine Springs: straight pipes and curves. The bar at the top shows the level, the stars you would get now and your moves against par.

Marks on the screenshot

  1. Level, stars and moves against par
  2. Pause
  3. Hint (3 per attempt)
  4. Reset the board
Cedar Dam: T-junctions, rocks and locked pipes (with a padlock).
Cedar Dam: T-junctions, rocks and locked pipes (with a padlock).
Mill Creek: the water must pass through every waterwheel.
Mill Creek: the water must pass through every waterwheel.
Stone Viaduct: an overpass bridge lets two pipes cross without mixing.
Stone Viaduct: an overpass bridge lets two pipes cross without mixing.
Twin Geysers: cold and hot water, each to the tub of its own colour.
Twin Geysers: cold and hot water, each to the tub of its own colour.
Level complete: stars, moves and par, then Next, Replay and Levels.
Level complete: stars, moves and par, then Next, Replay and Levels.

Marks on the screenshot

  1. Stars earned
  2. Next world
  3. Replay
  4. Levels
Daily: Today's Puzzle, your streak and Pressure Mode.
Daily: Today's Puzzle, your streak and Pressure Mode.

Marks on the screenshot

  1. Today's Puzzle
  2. Streak
  3. Pressure Mode
Pressure Mode: the bar under the top bar is the time left.
Pressure Mode: the bar under the top bar is the time left.

Marks on the screenshot

  1. Time left
Settings: vibration, less motion, full screen and language.
Settings: vibration, less motion, full screen and language.

Marks on the screenshot

  1. Vibration
  2. Less motion
  3. Full screen
  4. Language
  5. Close
A phone in portrait: the board fills the screen, with Pause, Hint and Reset below it.
A phone in portrait: the board fills the screen, with Pause, Hint and Reset below it.

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 script. Plain HTML, CSS and JavaScript ES modules: there is no compile step and no npm dependency.

game/                        upload these contents to your web host
  index.html                 the page: start screen, menu, level map, game screen
  css/                       layout and look of every screen and panel
  src/config.js              START HERE: worlds and every game feel number (FEEL)
  src/main.js                screen flow, modes, saving, pressure timer, main loop
  src/game/                  level generator, rules and the solver robots
  src/app/                   screens, panels, level map, layout, interface animations
  src/render/                draws the board: pipes, water, valve, tub, effects, scenery
  src/audio/sfx.js           sound effects, music and ambience
  src/lib/                   languages, text fitting, full screen, saving, 9-slice panels
  src/lib/locales/           interface texts, one file per language
  assets/img/                backgrounds, otter, interface art and effects (WebP)
  assets/audio/              sound effects, ambience and music (MP3)
  assets/fonts/              Fredoka, Nunito, Rubik 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 (17 checks)
  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, Nunito and Rubik licenses
  • src/config.js: the first file to edit. WORLDS (the 5 worlds) and FEEL (every animation, the water speed, the pressure timer, the number of hints, the sound mix and the effects).
  • src/game/generator.js: builds the 100 levels, the daily puzzle and the pressure rounds. buildSpec() sets the board size and the elements of each world. src/game/rules.js: the rules (pipes, rotation, water, leaks, stars, hints), with no interface code.
  • src/main.js: screen flow, the three modes, saving, the pressure timer and the main loop. src/app/: screens, panels, the level map, the layout and the animations of the interface.
  • src/render/: draws the board on the canvas. pipes.js draws the pipes, the valve, the tub, the wheels and the rocks in code; board.js runs the water; fx.js and board-fx.js are the effects; scenery.js the steam and the fireflies.
  • index.html: the start screen, the menu, the level map and the game screen. css/: layout and look. src/app/modals.js: the panels. src/lib/: languages, text fitting, full screen, saving and the 9-slice panels.
  • assets/img/: backgrounds, the otter, interface art and effects (WebP). assets/audio/: sound effects, the ambience and the music (MP3). assets/fonts/: fonts and their licenses.

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.

  • The valve is a source and the tub is a sink. Pipe kinds: straight, elbow (a curve), tee (T-junction), cross, wheel (waterwheel), bridge (overpass) and rock. A locked pipe is a cell with fixed: true.
  • color: 1 is the cold (turquoise) water and color: 2 the hot (amber) water of Twin Geysers. Picture names ending in -w show a pipe with water and -a with hot water.
  • In a level, par is the number of moves for 3 stars and sol is the stored solution used by the tests and by the Hint button.
  • otter-*.webp are the otter poses on the start screen and the menu; peek-*.webp are the otter poses on the panels and at the edge of the game screen.

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/img/logo.webp (portrait) and assets/img/logo-wide.webp (landscape). The texts on buttons and panels are in src/lib/locales/.

Pictures: replace a file in assets/img/ with another WebP of the same name and a similar size. The backgrounds are bg-port.webp (portrait) and bg-land.webp (landscape); the otter poses are otter-*.webp and peek-*.webp.

Pipe and water colours: the colours of the brass rings, the cells and the two waters are in the C object at the top of src/render/pipes.js; the shading of the copper and the brass is in RAMP in the same file, and the pipe thickness is PIPE_W.

Difficulty and levels: buildSpec() in src/game/generator.js sets the size of the board (from 4 by 4 up to 7 by 7) and the elements of each world; the seed in generateLevel() picks the boards. After any change, run npm test: it replays every level and checks that it can be solved at par. The pressure timer is pressureStartSec in src/config.js (plus 0.7 seconds per move of par) and the hints per attempt are hintsPerLevel.

Sounds and music

Every sound is an MP3 in assets/audio/, named with its id, for example rotate.mp3 or tub-fill.mp3. The list of ids is IDS in src/audio/sfx.js. To change a sound, replace the file and keep the name.

The music is menu.mp3 (start screen, menu and map) and game.mp3 (levels); amb-springs.mp3 is the quiet hot-spring ambience. The volumes the player chooses are saved; the starting volumes are in src/lib/storage.js.

Warning Save key: the progress, the settings and the language are saved under otter-flow.template.save.v1. If you host two copies of the game on the same domain, change the key in src/lib/storage.js of one of them.

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, import it in src/lib/i18n.js and add it to TABLES and to LANGS.

10 Saving and resetting

  • Stars, unlocked levels, the daily streak, volumes, settings and language are saved automatically in the browser of each player.
  • Everything is stored under one key, shown below.
  • To start over, delete these keys in the developer tools (F12), under Application, Local Storage, or clear the site data in the browser.
otter-flow.template.save.v1

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 17 checks: the rules, the 100 levels solved by two robots, 30 daily puzzles and 20 pressure rounds, 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 Fredoka, Nunito and Rubik 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 (the start button does this). Check both volumes in the Sound panel and the volume of the device.
  • A level does not finish: look for an open pipe end (a leak shows drops of water) and, in Mill Creek, for a waterwheel the water does not reach. If you changed the generator, run npm test to find the level that cannot be solved.
  • The game feels slow on an old phone: turn on Less motion in Settings, or lower particlesMax and particlesMobileMax in src/config.js.
  • 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 save key.

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 built by the game itself.
Does it use a game engine or a library?
No. The rules, the water and the drawing of the board are original code written for this game, in src/game/ and src/render/.
Can I change the levels?
Yes. Change the sizes and elements in buildSpec() or the seeds in src/game/generator.js (see the Customization Guide) and run npm test, which checks that every level can be solved at par.
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.