Polar Games

Recruit, merge and defend the star base · 1.0.0

Starfort: Merge Defense

A merge tower defense in landscape, set in deep space. Recruit cannon turrets, drag two equal turrets together to build a stronger one, and place your best turrets in the front column so they shoot at the pirate ships flying at the star base barrier. 12 turret levels, each with its own weapon (cadet shots, twin blasters, bursts, a turbo gatling, meteor shells, solar piercers, cryo pulses, guided swarms, electric arcs, plasma orbs, a star lance and a vortex core). 30 campaign waves in 3 worlds (Bright Orbit, Asteroid Belt and Violet Nebula) with pirate fighters, drones and gunships, and a boss every 10 waves (Ram Destroyer, Star Corsair, Void Driller), then an Endless mode. A robot captain teaches the first game. The Star Base sells upgrades (Recruitment, Power Boost, Strong Barrier, Quick Patch). 14 interface languages, recorded sound effects and music, no external services.

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. Installation
  3. Requirements and sound
  4. How to play
  5. Interface guide
  6. Files and customization
  7. Languages
  8. Local saves
  9. Development
  10. Updating and cache
  11. Licenses
  12. Troubleshooting
  13. Support

1 Overview

A merge tower defense in landscape, set in deep space. Recruit cannon turrets, drag two equal turrets together to build a stronger one, and place your best turrets in the front column so they shoot at the pirate ships flying at the star base barrier. 12 turret levels, each with its own weapon (cadet shots, twin blasters, bursts, a turbo gatling, meteor shells, solar piercers, cryo pulses, guided swarms, electric arcs, plasma orbs, a star lance and a vortex core). 30 campaign waves in 3 worlds (Bright Orbit, Asteroid Belt and Violet Nebula) with pirate fighters, drones and gunships, and a boss every 10 waves (Ram Destroyer, Star Corsair, Void Driller), then an Endless mode. A robot captain teaches the first game. The Star Base sells upgrades (Recruitment, Power Boost, Strong Barrier, Quick Patch). 14 interface languages, recorded sound effects and music, no external services.

2 Installation

Extract the ZIP. Open DOCUMENTATION.html for this guide. Upload only the contents of game/ to your static HTTP(S) hosting, keeping all folders beside index.html. Open that address in a browser. No database, PHP, account or Node.js runtime is needed to play. Keep source/ and the full ZIP outside your public website.

3 Requirements and sound

Use a current browser with JavaScript, Canvas 2D, Web Audio and local storage enabled. Mouse and touch are supported. The first click, tap or key press unlocks sound; check browser autoplay settings and the in-game sound controls. Files are bundled locally; normal play makes no request to Polar ranking, advertising or payment services. Host the complete folder; opening game HTML through file:// is not the supported installation method.

4 How to play

Tap Recruit (or press Space) to deploy a turret: it appears in a free slot. Drag a turret onto an identical one to merge them into the next level; drag it to a free slot to move it, or onto the bin to recycle it for half its price. Turrets in the front column shoot along their row. Each wave starts by itself after a short countdown; Call Wave starts it early for a small bonus. Squadron (from wave 3: tap the battlefield to send it) and Overdrive (from wave 7) are free powers with a cooldown. Supply pods sometimes drift across the field: tap them for coins or a turret. If the barrier falls, Retry resets the formation to the start of the wave and repairs the barrier. The 1x/2x button changes the game speed. Pause opens Resume, Restart wave, Sound, Language and Main menu.

5 Interface guide

Title screen
Title screen

Marks on the screenshot

  1. Play
  2. Continue the saved campaign
  3. Settings
  4. Reset progress (tap twice)
First-game tutorial with the robot captain
First-game tutorial with the robot captain

Marks on the screenshot

A wave in progress
A wave in progress

Marks on the screenshot

  1. Wave
  2. Enemies coming next
  3. Coins
  4. Barrier health
  5. Pause
  6. Recruit a turret (Space)
  7. Squadron power
  8. Overdrive power
  9. Star Base
  10. Game speed 1x/2x
Boss wave
Boss wave

Marks on the screenshot

  1. Boss health
Star Base (turret levels and upgrades)
Star Base (turret levels and upgrades)

Marks on the screenshot

Wave held: reward card
Wave held: reward card

Marks on the screenshot

Pause and settings
Pause and settings

Marks on the screenshot

6 Files and customization

All balance numbers are in src/game/data.js: turrets (damage, rate, range), enemies (health, speed, reward), the wave lists, the bosses and the economy (BAL: start coins, prices, rewards, upgrades, barrier). Game feel numbers (shake, hit-stop, particles, coin flight, boss intro) are in src/render/feel.js. Texts are in src/i18n/ (game names in starfort-theme.js). Images and sounds are files in assets/: replace them keeping the same names and sizes. After a balance change, run npm test. Internal code names: this game shares its engine with a garden-themed template, so the code keeps neutral internal keys. Turrets are plants (p1..p12, files assets/plants/pN-F.webp), pirate ships are pests (aphid, hopper, beetle, snail, slug, stinkbug, bombardier, ladybug; bosses rhino = Ram Destroyer, wasp = Star Corsair, megasnail = Void Driller), the barrier is fence, the Star Base is shed, the Squadron power is bees, the Overdrive power is fertilizer, the falling supply pod is packet and the robot captain poses are assets/ui/hazel-*.webp. Player-facing names come from src/i18n/starfort-theme.js, so renaming in the texts never breaks the code.

game/                       upload these contents
source/                     editable source, tests and tools
documentation/index.html    offline illustrated guide
DOCUMENTATION.html          guide shortcut
THIRD-PARTY-LICENSES/       font license

source/index.html              entry page: loads css/game.css, css/screens.css and src/main.js
source/css/game.css            HUD, title, tutorial and bottom bar (sizes in --u = 1% of the stage height)
source/css/screens.css         Star Base, wave held, barrier fell, pause/settings, victory
source/src/main.js             boot, fixed-step loop, save/load, input, wiring
source/src/game/data.js        every tunable number: turrets, enemies, waves, bosses, prices (BAL)
source/src/game/rules.js       pure rules (no drawing): recruiting, merge, waves, combat; used by the tests
source/src/render/scene.js     the Scene class: game events -> particles, shots, shake, sound cues
source/src/render/scene-draw.js  the draw passes of the Scene (barrier, shots, engines, particles, texts)
source/src/render/scene-art.js image loading, baked sprites, turret and ship views, background
source/src/render/feel.js      every game-feel number (shake, hit-stop, merge pop, coin flight)
source/src/render/view.js      16:9 stage fitted to the window, lanes and turret slots
source/src/app/                HUD, overlay screens, first-game tutorial (DOM)
source/src/audio.js            sound effects and music (Web Audio, mobile unlock)
source/src/i18n/               one file per language (14) + starfort-theme.js (game names)
source/src/debug.js            testing panel (?debug=1, localhost only)
source/assets/                 images (WebP/PNG), sounds and music (MP3), font
source/tools/                  build.mjs (copy to dist/), serve.mjs (local server)
source/test/                   node --test tests (rules, bosses, sound files)

Internal code names: this game shares its engine with a garden-themed template, so the code keeps neutral internal keys. Turrets are `plants` (`p1`..`p12`, files `assets/plants/pN-F.webp`), pirate ships are `pests` (`aphid`, `hopper`, `beetle`, `snail`, `slug`, `stinkbug`, `bombardier`, `ladybug`; bosses `rhino` = Ram Destroyer, `wasp` = Star Corsair, `megasnail` = Void Driller), the barrier is `fence`, the Star Base is `shed`, the Squadron power is `bees`, the Overdrive power is `fertilizer`, the falling supply pod is `packet` and the robot captain poses are `assets/ui/hazel-*.webp`. Player-facing names come from `src/i18n/starfort-theme.js`, so renaming in the texts never breaks the code.

7 Languages

The game interface offers 14 languages (English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese). The game picks the browser language on the first visit and the player can change it in Settings. This guide is in English, Brazilian Portuguese and Spanish; screenshots stay in English. Each language is one file in src/i18n/; English fills any missing key. Edit the texts without changing placeholders such as {n}.

8 Local saves

Progress belongs to this browser and origin. This buyer edition uses its own storage namespace, separate from the Polar website game. Clearing site data, using another browser or changing the hosting origin does not transfer progress. Private browsing and blocked storage may prevent persistence. There is no account, online ranking or cloud synchronization.

starfort.template.save.v1      campaign: wave, coins, turrets, upgrades, best level, Endless
starfort.template.settings.v1  language, music and sound volume, speed, less motion, tutorial done
(keys set by SAVE and SETTINGS at the top of source/src/main.js)

9 Development

The game is plain HTML, CSS and JavaScript (ES modules): there is no compile step. Edit the files in source/ and reload the page. npm run build copies index.html, css/, src/ and assets/ into an empty dist/ folder, which is the same as game/. On localhost, ?debug=1 opens a testing panel (coins, win or lose a wave, jump to a wave, next boss, unlock turret levels) and window.__bb exposes the game state for automated tests; both are off on any public host.

New to Node.js? 1) Install the LTS version from nodejs.org (Windows or macOS installer) or with your package manager on Linux; it must be 26.13 or newer. 2) Close and reopen the terminal, then run node -v and npm -v to confirm both print a version. 3) Open the terminal inside the source/ folder (the one containing package.json). 4) Run npm ci to install the exact tools from package-lock.json (only Prettier). 5) Run npm test for the tests, then npm run build to write the game to dist/. 6) Try it with npm run serve (http://localhost:5191/; the page needs a web server, it does not run from a double-clicked file), then upload the contents of dist/ like game/. Common errors: node or npm not found (reopen the terminal or fix PATH); on Windows PowerShell, npm.ps1 cannot be loaded (run npm.cmd ci or use Command Prompt); ENOENT package.json (you are not inside source/); EBADENGINE (Node.js is older than 26.13); network or proxy failures during install (check your connection and proxy); npm ci complaining about the lock file (do not edit package-lock.json; delete node_modules and retry).

cd source
npm ci
npm test
npm run build
npm run serve
# http://localhost:5191/

10 Updating and cache

Keep a backup of your edited files before replacing a release. Upload all updated assets together and keep the public URL unchanged to preserve the browser save. Clear hosting or CDN caches when applicable. Test a private window after deployment; adding ?v=2 to the entry URL can help diagnose stale HTML but does not replace updating all assets.

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.

11 Licenses

The game artwork, audio and editable game code are supplied under the purchased item license. Included fonts retain their complete SIL Open Font License notices in game/licenses/ and THIRD-PARTY-LICENSES/. Developer dependencies retain their own upstream licenses. Original production PNG masters and artwork-generation tools are not included.

12 Troubleshooting

If the page is blank, check that every folder was uploaded, the URL is served over HTTP(S), and the browser console and Network panel have no missing files. Module builds need correct JavaScript MIME types. If sound is silent, interact once and inspect browser and game volume. If progress resets, inspect storage permissions and origin changes. The guide itself also opens offline through file://.

13 Support

For support and customization contact willian@polargames.com.br. Include the product version, browser, device, hosting URL, reproduction steps and a screenshot. No backend, native app, ad SDK or real-money purchasing system is included.

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.