Witch Flight 1.0.0: buyer guide

HTML5 crash game with free fictional credits. Editable source included.

Customization guide (recipes)

EnglishPortuguêsEspañol

Overview

Witch Flight is an HTML5 crash game. The player places a bet, a witch takes off on her broom and a multiplier climbs while she flies. Cash out before she falls to win the bet times the multiplier; if she falls first, the bet is lost. It ships as a ready-to-host game (game/) and as its complete editable source (source/). It runs in any current browser, on phones, tablets, desktops and ultrawide screens, in portrait and landscape, with no server, database or account.

Features: two round modes (Solo, the default, and Room), auto cash out, BIG / MEGA / EPIC WIN celebrations, a fair-play window (hash before take-off, seed after), best-flights list, recent rounds, free refill, sound and music switches, a "reduce motion" option, a 3-step tutorial and 14 interface languages. The witch is animated with a real-time mesh rig: her hair and cape move with physics.

Recreational game only. The player gets free fictional play credits. They have no monetary value and cannot be bought, transferred, sold or redeemed. There are no deposits, withdrawals, prizes or rewards of economic value. The purchase price is for a software licence. Real-money or other real-value gambling use is not permitted under the licence. Read SCOPE.md (at the root of the package and inside game/): it is part of the licence terms.

The game screen (1280×720) during a flight.
The game screen (1280×720) during a flight.

Install on your website

The playable game is the folder game/. It is plain HTML, CSS and JavaScript: no build, no Node.js and no database are needed to host it.

  1. Open your hosting file manager, or connect with an FTP program (for example FileZilla).
  2. Create a folder for the game, for example /games/witch-flight/.
  3. Upload the contents of game/ into it: index.html, the .js and .css files, SCOPE.md, DOCUMENTATION.txt and the folders arte/, audio/, fontes/ and lib/.
  4. Open the address in a browser, for example https://your-site.example/games/witch-flight/.

The game uses relative paths, so it works in any folder or subdomain. Opening index.html straight from your disk (file://) does not work, because browsers block the sounds and data files there: test it on a web host or with npm start (see "Editing the source").

Put it inside a page (iframe)

<iframe src="/games/witch-flight/" style="width:100%;aspect-ratio:16/9;border:0" allow="fullscreen; autoplay"></iframe>

Keep the on-screen notice "Virtual credits only." visible and keep SCOPE.md with the game when you publish it to the public.

Requirements

  • Any static HTTP or HTTPS web host (shared hosting, a CDN, GitHub Pages, Netlify...). No PHP, database or server code.
  • A current browser with WebGL: Chrome, Edge, Firefox, Safari (macOS and iOS), Samsung Internet or Opera.
  • Only for the tests, the local server and the build: Node.js 26 LTS (the current LTS line) and npm, see "Editing the source".
  • No internet connection is needed to play: art, sounds, fonts and the PixiJS library are all inside game/. The game makes no requests to other sites.

How to play and the screens

The player chooses a bet with – and + and taps BET. The witch takes off and the multiplier climbs; the big button becomes CASH OUT and shows what the bet is worth right now. Tapping it pays the bet times the multiplier. If she falls first ("FLEW AWAY"), the bet is lost. All amounts are fictional play credits.

The game screen (1280×720) during a flight. 1 2 3 4 5 6 7 8 9 10 11 12 13 14
The game screen (1280×720) during a flight.
  1. Home button (address set in WF_CONFIG, or hidden)
  2. Play credits balance
  3. Free refill (+10,000 play credits)
  4. Sound on/off
  5. Best flights
  6. Menu
  7. Multiplier (the title above shows the round phase)
  8. Recent rounds
  9. Lower bet
  10. Higher bet
  11. Auto cash out on/off
  12. Auto cash-out target
  13. BET / CASH OUT / CANCEL (shows the bet, or what it is worth now)
  14. Notice "Virtual credits only." (keep it visible)

Auto cash out

Tick the box next to AUTO CASH OUT and choose a target (x1.20 to x100) in the list: the game cashes out by itself when the multiplier reaches it.

A cash out: the prize appears next to the witch and the coins fly to the balance.
A cash out: the prize appears next to the witch and the coins fly to the balance.

Celebrations

A cash out of 10 times the bet or more opens BIG WIN, 25 times MEGA WIN and 50 times EPIC WIN: the plate counts the prize up while coins fly to the balance. A tap skips the counting.

BIG WIN: a cash out of 10 times the bet or more (amounts are fictional play credits).
BIG WIN: a cash out of 10 times the bet or more (amounts are fictional play credits).
EPIC WIN: 50 times the bet or more.
EPIC WIN: 50 times the bet or more.
FLEW AWAY: she fell before the cash out and the bet is lost.
FLEW AWAY: she fell before the cash out and the bet is lost.

Menu, best flights and fair play

The menu button opens sound effects, music, "reduce motion", the language, the tutorial (HOW TO PLAY) and FAIR PLAY. The crown opens the best flights of this browser. The green + next to the balance gives a free refill of 10,000 play credits.

The menu: sound, music, reduce motion, language, how to play and fair play. 1 2 3 4 5 6
The menu: sound, music, reduce motion, language, how to play and fair play.
  1. Sound effects
  2. Music
  3. Reduce motion
  4. Language (14)
  5. How to play (tutorial)
  6. Fair play (hash and seed)
Best flights of this browser.
Best flights of this browser.
Phone held upright (390×844): the same game, rearranged.
Phone held upright (390×844): the same game, rearranged.

Round modes

The game has two ways of running rounds. Choose the one that fits your site.

Solo (default) Room
When a round starts when the player presses BET (0.8 s later; the bet can still be cancelled) by itself, after a 5-second countdown
No bet placed the witch hovers, the title says PLACE YOUR BET, nothing flies flights keep going; a player who missed the countdown watches and joins the next one
Other players' cash-out tags hidden shown (simulated players)
Recent rounds on the first visit empty 5 random flights, so the row is not empty
Tutorial, step 1 "Place your bet: the witch takes off right away." "Place your bet during the countdown."
Solo mode: the witch hovers and waits for a bet.
Solo mode: the witch hovers and waits for a bet.
Room mode: the countdown to the next flight.
Room mode: the countdown to the next flight.

Why Solo is the default: in a single-player game there is no shared round to wait for. Making a player watch a flight they did not bet on only slows them down, and rounds without a bet create results nobody played. Room keeps the classic rhythm of multiplayer crash games, with a countdown between flights.

How to switch

Open index.html (in game/ on your host, or in source/) and find this block near the end:

<script>
  window.WF_CONFIG = { modo: 'solo' };
</script>

Change 'solo' to 'sala' ("room" in Portuguese, the language of the code) and reload the page. To test without editing, add ?modo=sala or ?modo=solo to the address: the address wins over the block.

What is in the package

witch-flight-static-1.0.0/
  START-HERE.txt          first steps
  DOCUMENTATION.html      opens this guide
  CUSTOMIZATION.html      opens the customization guide (recipes, no coding)
  CHANGELOG.txt
  SCOPE.md                what the product is and what the licence does not allow
  documentation/          this guide and the customization guide (EN/PT/ES), screenshots
  game/                   UPLOAD THE CONTENTS OF THIS FOLDER
    index.html            the page and the settings block WF_CONFIG
    estilo.css            the styles
    jogo.js               the game (rounds, buttons, scene, effects)
    motor.js              the math
    idiomas.js            the 14 languages
    som.js, justo.js, bruxa.js, rig.js, ui.js
    lib/pixi.js           PixiJS 7.4.2 (MIT), not minified
    arte/, audio/, fontes/  images, sounds, fonts
    SCOPE.md, DOCUMENTATION.txt
  source/                 the complete editable project
    the same game files as game/
    tests/                npm test
    tools/                build.mjs (npm run build), serve.mjs (npm start)
    package.json, package-lock.json, .prettierrc, README.md
    licenses/             licences of PixiJS and Prettier
  THIRD-PARTY-LICENSES/   PixiJS, Prettier and the two fonts

game/ is exactly what npm run build makes from source/ (checked file by file before packaging).

File What it is
index.html the page: top bar, scene, panel, windows and the settings block
estilo.css layout for phone, desktop and ultrawide, buttons, windows, celebrations
jogo.js the game: rounds, buttons, scene, effects, celebrations
motor.js the math: crash point, multiplier curve, payout
idiomas.js texts in 14 languages
som.js saved data and sound (effects, music, countdown bells)
justo.js SHA-256 for the fair-play window
bruxa.js the witch skeleton: bones, hair and cape chains, layer order
rig.js the animation engine: deforms the witch layers, hair and cape physics
ui.js stretched panels and buttons drawn without seams

Settings

The settings block (index.html)

window.WF_CONFIG is read every time the page opens, so you can change it on your host with a text editor and no build.

window.WF_CONFIG = { modo: 'solo', home: '/games/', bots: false };
Option What it does
modo 'solo' (default) or 'sala' (room). See "Round modes"
home address of the home button at the top left (default '../', the folder above the game), or false to hide the button
bots true or false shows or hides the simulated players' cash-out tags. When it is not set, they appear only in room mode

Game values (jogo.js)

These are constants near the top of jogo.js. Edit source/jogo.js and run npm run build, or edit game/jogo.js directly on your host (the file in game/ is the same readable file, nothing is compiled).

What Where Default
Bet amounts (the – and + buttons) const APOSTAS 10, 20, 50, 100, 200, 500, 1000, 2000, 5000
Auto cash-out targets const AUTOS x1.2, 1.5, 2, 3, 5, 10, 20, 50, 100
Starting balance and free refill search for 10000 10,000 play credits
Room countdown, Solo pause, time the crash is shown FEEL.aposta, FEEL.apostaSolo, FEEL.depois 5 s, 0.8 s, 2.6 s
Multiplier milestones (bell and flash) FEEL.marcos 2, 3, 5, 10, 20, 50, 100, 200, 500
BIG / MEGA / EPIC WIN thresholds (times the bet) FEEL.tiers 10, 25, 50
Coins flying to the balance FEEL.moedas 42 per second (24 on touch screens)
Screen shake FEEL.tremor at most 10 px

Math and return to player

The rules live in motor.js (about 20 lines):

Value Default What it does
RTP 0.97 Return to player. The chance that a flight reaches x is RTP / x, so cashing out at any target returns 97% on average
K 0.00009 Speed of the curve: x2 at about 7.7 s, x5 at 17.9 s, x10 at 25.6 s
MAX 1000 Highest multiplier a flight can reach

After changing them, run npm test: it simulates 2 million flights for six cash-out targets and fails if the return drifts from RTP.

Fair play

  1. When a betting phase starts, the game draws a random seed and computes its SHA-256 hash. The crash point comes from the seed, so it is fixed before any bet.
  2. The hash is shown in Menu > FAIR PLAY before take-off.
  3. After the flight, the seed of that flight appears in the same window, so anyone can check that SHA-256(seed) is the hash shown earlier.
FAIR PLAY: the hash of the next flight before take-off, the seed of the last one after.
FAIR PLAY: the hash of the next flight before take-off, the seed of the last one after.

In Solo mode a seed is only used when the player bets; cancelling and betting again keeps the same seed.

Test addresses

On your own computer (localhost, 127.x, 192.168.x, 10.x) two address options help testing: ?crash=40 forces the next crash at x40, and ?congela=3.47 freezes the screen at x3.47 for screenshots. On a public domain both are ignored, so players cannot use them.

Languages

The interface is translated into 14 languages: English, Portuguese, Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese (simplified). The game opens in the device language and the player can change it in the menu (LANGUAGE). The painted words (the BET / CASH OUT / CANCEL button, the logo and the BIG / MEGA / EPIC WIN plates) are images and stay in English in every language. Numbers use the 1,250 format, because the gold number font is an image with those characters.

The menu in Japanese, one of the 14 languages.
The menu in Japanese, one of the 14 languages.

All texts are in idiomas.js, one block per language with the same keys as en. {0} and {1} are replaced by numbers and <br> is a line break. To add a language, copy the en block, give it a new code (for example sv), translate the values and add its name to WF_NOMES. npm test checks that every language has every key and keeps the placeholders.

Saved data

The game keeps the balance, bet, auto cash-out, recent rounds, best flights, language, sound and tutorial state in the browser's localStorage, under keys that start with witch-flight.template.save.v1. (the constant SALVO in som.js). Nothing is sent anywhere. Clearing the site data in the browser resets the game. If you publish two copies of the game on the same domain, give each one its own SALVO prefix.

Editing the source (Node.js for beginners)

The game needs no build: every file in game/ is the readable source file. Node.js is only used to run the tests, a local server and the copy from source/ to a fresh dist/. You can also edit the files in game/ with any text editor.

1. Install Node.js

  1. Go to https://nodejs.org and download the LTS version (Node.js 26 LTS). Windows and macOS: run the installer with the default options. Linux: use your package manager or the official binaries.
  2. Close and open your terminal again (Windows: PowerShell or Command Prompt; macOS: Terminal).
  3. Check the versions: both commands must print a number, and Node must be 26.13.0 or newer.
node --version
npm --version

2. Install the project tools

Open the terminal in the source/ folder (Windows: open the folder in Explorer, click the address bar, type powershell and press Enter; macOS: drag the folder onto the Terminal icon). Then run:

npm ci

This installs the exact version of Prettier written in package-lock.json into node_modules/. It needs an internet connection once. The game itself has no npm dependencies.

3. Test, play and build

npm test
npm start
npm run build
  • npm test checks the math and the return to player, the fair-play hash, the translations and that every file the game asks for exists. All tests must pass.
  • npm start starts a local server at http://localhost:8080/. Open it in the browser; reload after saving a file. Press Ctrl+C to stop. Another port: PORT=8090 npm start (Windows PowerShell: $env:PORT=8090; npm start).
  • npm run build copies the game to source/dist/ (the folder is emptied first, so a deleted file also leaves it). Upload the contents of dist/: it replaces game/.
  • npm run format formats every file with Prettier; npm run check only checks.

Common problems

  • node or npm is not recognised: Node.js is not installed or the terminal was opened before installing it. Reinstall and open a new terminal.
  • Windows says running scripts is disabled (npm.ps1): use the Command Prompt, or run npm.cmd ci.
  • ENOENT ... package.json: the terminal is not in the source/ folder.
  • EBADENGINE: your Node.js is older than 26.13.0. Install the current LTS.
  • npm ci fails with a network error: check the connection or the proxy of your company network, then run it again.
  • npm ci says the lock file is out of sync: you changed package.json; run npm install once, then npm ci works again.
  • EADDRINUSE with npm start: port 8080 is busy; use another port as shown above.

Customize and reskin

The customization guide (CUSTOMIZATION.html) has step-by-step recipes for people who do not program: replacing the witch, the background, the buttons, the logo, the sounds and music, the colours and the texts, and changing bets, celebrations and the round mode. In short:

  • Art: arte/ (WebP images and PNG masks). Replace a file with another of the same name and the same size.
  • Sounds: audio/ (MP3). Replace a file with another of the same name.
  • Layout and colours: estilo.css.
  • Texts: idiomas.js.
  • Values and effects: FEEL, APOSTAS and AUTOS in jogo.js; math in motor.js.

Internal names

The code was written in Portuguese. The names are only names; this is what they mean:

Name in the code What it is
jogo, motor, som, justo, bruxa, idiomas, estilo, fontes, arte game, engine (math), sound, fair, witch, languages, style, fonts, art
camadas, fundo, novo layers, background, newer art set
Luma the witch's name in the animation engine (Luma.Rig)
S.saldo, S.aposta, S.m, S.quebra balance, current bet, multiplier, crash point
S.fase: aposta, voo, caiu round phase: betting, flight, crashed
apostar, decola, sacar, caiu place the bet, take off, cash out, she fell
MODO (solo, sala) the settings block: solo or room mode
FEEL, APOSTAS, AUTOS timings and effects, bet amounts, auto cash-out targets
guarda, SALVO saved data in the browser, its key prefix
festa, placa, moedas, painel, botao win celebration, plate, coins, panel, button

Updating the game and clearing the cache

After you upload a new version, browsers and hosts may keep the old files for a while. If a change does not show:

  • Reload without the cache: Ctrl+F5 or Ctrl+Shift+R (Windows/Linux), Cmd+Shift+R (macOS). On a phone, close the tab and open it again.
  • Clear the cached files of the site in the browser settings ("Cached images and files"). Do not clear "cookies and site data" unless you want to reset the saved game.
  • Try a private (incognito) window.
  • If your host or CDN (for example Cloudflare) has a cache, purge it.
  • Add a version to the address once, for example index.html?v=2, or to a changed file inside index.html (jogo.js?v=2).

Saved data survives an update as long as the SALVO prefix does not change.

What the product is (and is not)

  • Free, fictional play credits only, with no monetary value. They cannot be bought, transferred, sold or redeemed. No prizes of any kind.
  • No payment, deposit, withdrawal, account or wallet system: none is hidden, switched off or shipped in the package.
  • The standard licence does not allow using this game, or any modified version of it, for gambling with real money or anything of real value: no buying credits, no cash-out of credits, no prizes based on results, no connection to a gambling wallet, payment system or real-money operator, no advertising of real-money gambling.
  • You must follow the laws of every place where you publish the game (age ratings, minors, consumer protection). Keep the notice "Virtual credits only." visible.
  • Support does not cover wallet, deposit, withdrawal or any real-money integration; such requests are declined.

The full text is SCOPE.md.

Questions and problems

  • The page is blank or shows only the loading bar. Check that you uploaded the contents of game/ (with lib/, arte/, audio/ and fontes/) and that you open it through http(s), not file://. The browser console (F12) shows the missing file.
  • No sound. Browsers allow sound only after the first tap. Check the speaker button, the menu (sound effects, music) and the device volume.
  • Can I change the RTP? Yes, RTP in motor.js; run npm test afterwards.
  • Can I go back to rounds with a countdown? Yes: modo: 'sala' in WF_CONFIG (see "Round modes").
  • Can players buy credits or win prizes? No. The game has no payment or prize system, and the licence does not allow adding one.
  • Does it work offline? Once loaded, yes; it needs no other site.
  • Can I remove the "Virtual credits only." notice? For a public release it must stay visible (see SCOPE.md).
  • The game is slow on an old phone. Turn on "reduce motion" in the menu: it removes the screen shake and calms the effects.

Support and credits

Support e-mail: willian@polargames.com.br (bugs, installation, layout on supported browsers, translations, visual and audio customization and the settings in this guide). Please include your purchase code, the browser and device, and a screenshot.

Third-party code in the package: PixiJS 7.4.2 (MIT). Fonts: Cinzel and Merriweather (SIL Open Font License 1.1). Development tool: Prettier (MIT). Licence texts in THIRD-PARTY-LICENSES/. Art, music, voice and effects are part of the game and covered by the licence of your purchase.