1. Before you start
- Make a copy of the whole download. If something goes wrong, you can go back to it.
- Install a free code editor such as Visual Studio Code (or Notepad++ on Windows). For pictures, the free GIMP or Krita open and export WebP files. For sounds, the free Audacity exports MP3.
-
Work inside
source/. To see your changes, open a terminal in that folder and runnpm run dev, then openhttp://localhost:5180/. The game does not run by double-clickingindex.html, because browsers block JavaScript modules onfile://. -
No terminal? Edit the files of
game/directly, upload them to your host and reload the page.
2. Your brand: name, logo and icon
- The name in the browser tab is the
<title>line ofindex.html. -
The logo is
assets/logo.webp(1000 x 515 pixels, transparent background). To use your own, save it at the same size with a transparent background. -
The mascot is a red and yellow gummy worm with five poses:
assets/mascot-idle.webp,mascot-hype.webp,mascot-cheer.webp,mascot-oops.webpandmascot-sleepy.webp. Replace each one with a picture of the same size. - The page icon is
assets/icon-180.png(180 x 180 pixels).
3. Colors and the look
Almost every piece of the interface (buttons, panels, plates, stars, the world board) is a picture in
assets/, so you change the look by editing those pictures (see table 4). The few colors of the
text are at the top of css/base.css, inside :root:
--pink: #ff3d9a; /* candy pink */ --rose: #c4125f; /* dark pink */ --mint: #7ff0c8; /* mint */ --gold: #ffd23f; /* gold of the stars and titles */ --font: 'Fredoka', 'Noto Sans', 'Hiragino Sans', 'Malgun Gothic', 'Microsoft YaHei', system-ui, sans-serif; /* text font */
The worm colors are PAIRS in src/config.js: 6 pairs, the color of the head end and
the color of the tail end; the body fades from one to the other. The painted worm is one red picture that the
game recolors (src/render/skin-color.js); the face is never recolored. Change the hex values and
the worms follow:
export const PAIRS = [ ['#f2383a', '#ffd21f'], // red - yellow (head end, tail end) ['#2f8cff', '#35d65a'], // blue - green ['#ff4fae', '#a64cf0'], // pink - purple ['#ff8a1f', '#f4f1fa'], // orange - white ['#36d33f', '#ffe02e'], // green - yellow ['#9b4cf0', '#2f9cff'], // purple - blue ];
4. Replace pictures (reskin)
Replace a file with another of the same name and a similar size. Nothing else needs to change.
| On screen | File |
|---|---|
| Backgrounds of the 5 worlds |
assets/bg-portrait.webp and bg-landscape.webp (Candy Shop); the same with
bg-w2 (Chocolate Factory), bg-w3 (Ice Cream Parlor),
bg-w4 (Lollipop Garden) and bg-w5 (Midnight Bakery)
|
| Background of the menu | assets/bg-menu-portrait.webp and bg-menu-landscape.webp |
| The painted gummy worm |
assets/gummy-head.webp (the head), gummy-body.webp (the beads of the body) and
gummy-faces.webp (five faces in one strip); red, the game recolors head and body
|
| The candy tray | assets/soil.webp, wood.webp and cell.webp |
| Wafer, candy timer, pink ribbon and sleepy sign |
assets/bridge.webp, clock-silver.webp (the number is live text),
collar.webp and gummy-zzz.webp
|
| The little candies that drift over each world |
assets/amb-petal.webp, amb-leaf.webp, amb-seed.webp,
amb-maple.webp and amb-firefly.webp, one per world in this order.
amb-seed.webp is also the sugar crystal of an emptied cell and
amb-firefly.webp the twinkle of the win: changing them changes the board too.
|
| Round buttons (pause, sound, settings, undo, hint, replay, close, home, arrows) | assets/btn-*.webp |
| Play button, plates and the plaque |
assets/cta.webp, plate.webp, plate-red.webp,
plate-tap.webp and plaque.webp
|
| Panels | assets/board-dark.webp (the frame of every panel) |
| Stars | assets/star-on.webp and star-off.webp |
| Level select: the board, the level tiles and the lock |
assets/board.webp, tile-open.webp, tile-now.webp and
tile-locked.webp
|
| Slider knob and the picture of the final screen | assets/badge.webp and assets/end-art.webp |
5. The gummy worms
The worms are painted (assets/gummy-head.webp, gummy-body.webp and
gummy-faces.webp) and drawn by code: the body follows the path of the worm, turning at every
corner, and the whole worm slides out when it leaves. The jelly wobble, the sprinkles, the hint glow and the
white flash of a blocking worm are drawn by src/render/snakes.js and
src/render/skin.js.
The look of the worms is set in FEEL.snake and FEEL.skin in
src/config.js (size of the head and the body, how the tail thins, the soft shadow), the wobble in
FEEL.jelly and the sprinkles in FEEL.sprinkle. The bead outline of the body is
src/render/bead-profile.js.
6. Levels
A level is one line of a pack in src/game/levels/. The board is w cells wide and
h cells high; the top left cell is 0, 0. This is level 3:
{ w: 5, h: 6, s: ['331RDDDLUU', '215RRR', '011DDD', '110LDDDDD', '240LLDDDD'], sol: [4, 3, 2, 1, 0] }
| Field | What it is |
|---|---|
w |
The width of the board in cells. |
h |
The height of the board in cells. |
s |
The worms. Each one is a text such as 233RUULL: the color pair (0 to 5), the x and y of the
head (0 to 9, then a to z), then the moves from the head to the tip of the tail: U,
D, L or R. A z at the end makes it a sleepy worm.
|
sol |
The stored solution: the ids of the worms (their place in s, starting at 0) in an order that
clears the board without a mistake.
|
t, c, r |
Optional: t lists wafer cells as "x,y", c lists pairs tied with a
pink ribbon as [idA, idB] and r lists candy-timer worms as [id, n]:
the worm must leave before n other worms have left.
|
A worm slides out in a straight line in the direction its head points, which is the opposite of its first
move: in 233RUULL the first move is R, so the head points left. A worm is blocked
while another worm (or its own body) is in the way. npm test plays the stored solution of all 100
levels and fails if one no longer wins, or if a worm overlaps another or leaves the board.
After changing a level, run npm test. If you generate levels with npm run levels,
the packs are written again from the recipe: copy your own edits somewhere safe first.
To add a level, add a line to a pack. The tests expect 100 levels in 5 worlds of 20: if you add or remove
levels, change PER_WORLD in src/game/worlds.js and the counts in
tests/rules.test.js and tests/package.test.js.
7. Difficulty and game feel
Open src/config.js. The most useful numbers:
| Setting | What it does |
|---|---|
STARS |
How many mistakes are allowed for 3 stars and for 2 stars (0 and 2). |
LAYOUT.cellMax and LAYOUT.boardPad |
The biggest size of a board cell and the room around the board. Raise the cell size for bigger worms on small boards. |
FEEL.streak |
How many seconds the combo lasts and from which worm the combo words appear. |
FEEL.hint and FEEL.idle |
How long the hint glows and how many seconds without a tap before a free worm wiggles. |
FEEL.exit |
How fast and how far a worm slides out, the crouch before it goes and when it fades. |
FEEL.blocked |
The bump when a worm is blocked: the lunge, the flash of the blocker and the pause. |
recipe() in tools/generate-levels.mjs |
The board size, worm length, colors, how many worms are free at the start and how long the blocking chains
are, level by level. Run npm run levels to apply a change.
|
8. Texts and languages
-
Every text is in
src/lib/locales/, one file per language (en.js,pt.js,es.js...). Change the text after the colon and keep the key. - The first visit uses the language of the browser. The player can change it in Settings.
-
New language: copy
en.jsto a new file, translate it, and add its code and name toLANGSinsrc/lib/i18n.js(and to the list intests/locales.test.js). The Settings panel shows it by itself.
9. Sounds and music
Every effect is an MP3 in assets/sfx/. Replace a file and keep its name.
| Files | When they play |
|---|---|
tap-*, press-* |
Taps on the interface and presses on buttons. |
slide-*, pop-* |
A worm sliding out and leaving the board. The pitch climbs with the combo. |
bump-*, deny-* |
A blocked worm and a tap that cannot do anything (for example Undo with nothing to undo). |
undo-*, hint-* |
Undo, and the hint (also used when a sleepy worm wakes up). |
star-*, win-* |
The stars of the result panel and the victory jingle. |
start-*, panel-* |
Starting a level and opening a panel. |
assets/music/menu.mp3 |
The music of the menus. |
assets/music/game.mp3 |
The music during the levels. |
The number at the end is the version: the game alternates them. 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 vol in AUDIO.sounds in src/config.js.
export const SFX_FILES = { bump: [1, 2], deny: [1, 2], hint: [1, 2], slide: [1, 2] /* ... */ };
10. Save keys and starting over
The progress stays in the browser of each player, under the prefix gummy-escape.template: (STORAGE_PREFIX
in src/config.js). If you host two copies on the same domain, change the prefix in one of them.
To start over, clear the site data in the browser.
11. Publish your version
-
In
source/, runnpm testandnpm run build. This writessource/dist/. -
Back up the game on your website, then upload the contents of
dist/in place of the old files. -
Keep the folders as they are. If you added a new file or folder next to
index.html, add its name toPARTSinsource/tools/build.mjs. - Clear the browser cache to see the new version (see the buyer guide).
Support: willian@polargames.com.br