Lantern Bites · Customization Guide · version 1.0.1 · Main buyer guide

Customization Guide

Make Lantern Bites your own game: your own numbers, dishes, stalls, districts, texts, music, logo and colors. Every recipe below is a short list of steps and says exactly which file to open. You do not need to know how to program: you change numbers, texts between quotes and picture files. All pictures on this page are real screenshots of the game in this package.

1. Before you start

Free tools you need:

Make a backup first. Copy the whole game/ folder (or source/) to a safe place before you change anything. If something breaks, put the backup back.

Which folder do I edit? The simplest way: edit the files inside game/ and upload that folder. If you also use the developer tools, edit source/ instead and run npm run build, which copies everything to source/dist/ (the same as game/). Both folders have the same file names, so every recipe below works in either one.

Starting a new game while you test: the game saves progress in the browser. Open the pause menu and choose Start over to see a change from the first minute. On your own computer (address localhost) you can also open a district directly with ?debug&bairro=1 at the end of the address (0 is the first district); this shortcut does nothing on a public website.

2. Where everything is

Each number on the screenshot matches a line of the table under it, with the exact file to change. Interface texts are in src/locales.js (English and Portuguese) and in src/locales/ (one file for each of the other 12 languages); the table gives the key of each text. <chain> is one of the 7 foods (grill, steam, tea, sweet, sea, noodle, warm), <stall> uses the same 7 names, and <id> is a district (porto, lotus, neve).

Title screen

Title screen, real screenshot with numbered parts 1 2 3
# What you see File to change
1 Logo assets/ui/logo.png, 900×388 pixels, transparent background (recipe G).
2 Play button Text: key ui.play (recipe E). Button picture: assets/ui/btn-gold-l.png, btn-gold-m.png and btn-gold-r.png (recipe H).
3 Title background assets/ui/splash-land.jpg on wide screens (1672×941) and assets/ui/splash.jpg on phones held upright (941×1672), recipe G.

The counter

The counter, real screenshot with numbered parts 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# What you see File to change
1 Level Star: assets/ui/star.png. The bar fills with the stars of the lanterns: STEP_STARS and STARS_PER_LEVEL in src/config.js (recipe A).
2 Flames (energy) Icon: assets/ui/flame.png. Size of the tank and speed: ENERGY in src/config.js (recipe A).
3 Coins Icon: assets/ui/coin.png.
4 Customer assets/ui/who-1.png to who-6.png in the first district; the same names inside assets/bairros/<id>/ in the others (recipe C).
5 Order and its pay What customers ask for and how much they pay: ORDERS in src/config.js (recipe A). Pictures on wide screens: assets/ui/barraca-balao.png and barraca-fita.png; on phones: assets/ui/tag.png.
6 Ready button assets/ui/btn-check.png. It appears when the dishes of the order are on the counter.
7 Market stall around the customers Wide screens only: assets/ui/barraca-fundo.png, barraca-prateleira.png, barraca-placa.png, barraca-placa-p.png and barraca-corda.png.
8 Counter squares assets/ui/tile-l.png (wide screens) and assets/ui/tile-p.png (phones); frame: assets/ui/frame.png. The tint of each district is in style-more.css (recipe H).
9 Food stall assets/items/gen-<stall>-1.png to -5.png, one picture per stall level (recipe B). Name: key gen.<stall>.
10 Dish assets/items/<chain>-1.png to -8.png (recipe B). Names: the list item.<chain>.
11 Lid with a number assets/ui/lid.png. The level that opens each square is the list UNLOCK in src/config.js.
12 Name of the selected dish Texts: item.<chain>, ui.lv, ui.next (recipe E). Panel picture: assets/ui/panel-plain.png.
13 Sell button assets/ui/btn-orange.png (it turns into Serve with btn-green.png). Text: ui.sell. Price: SELL in src/config.js.
14 Recipe book button assets/ui/icon-9.png. Reward of a complete page: BOOK_REWARD in src/config.js.
15 Shelf assets/ui/shelf-land.png (wide screens), shelf-port.png and slot-port.png (phones).
16 Gift box assets/ui/btn-gift.png; the red dot is dot.png.
17 Street button assets/ui/btn-lantern.png.
18 Pause button assets/ui/btn-pause.png.
19 Scenery behind the counter scene-land.jpg (wide screens, 1672×941) and scene.jpg (phones, 1914×822), in assets/ui/ for the first district and in assets/bairros/<id>/ for the others (recipe C).

The street

The street, real screenshot with numbered parts 1 2 3 4 5 6 7 8 9
# What you see File to change
1 District name Text: key bairro.<id> (recipes D and E).
2 Map of the districts Drawn by the code from the list DISTRICTS: the picture of each one is its area-3.png; padlock: assets/ui/lock.png.
3 Picture of the place area-1.png, area-2.png, area-3.png (533×534) of the district (recipe C).
4 Name of the place Text: key area.<place>; the three places of a district are listed in DISTRICTS.
5 Lanterns assets/ui/lamp2-on.png and lamp2-off.png. There are 6 per place (STEPS).
6 Price of the next lantern STEP_COST and DISTRICT_COST in src/config.js (recipe A).
7 Locked place assets/ui/plate-lock.png and lock.png. In the first district the places open at the levels of AREAS; in the others, one after the other.
8 Back to the counter Text: key ui.kitchen.
9 Street background street-dark.jpg (lanterns off) and street.jpg (lit), both 941×1672, shown turned on wide screens (recipe C).

A card (new level)

A card (new level), real screenshot with numbered parts 1 2 3 4 5 6
# What you see File to change
1 Medal assets/ui/medal.png.
2 Title of the card Texts: ui.levelUp and ui.levelUpSub. Plate picture: assets/ui/plate.png.
3 Hanging lantern assets/ui/lamp2-on.png.
4 Prizes of the level assets/ui/prize-flame.png, steamer-open.png and prize-gift.png.
5 Button of the card Text: key ui.ok. Picture: the three btn-gold-*.png files.
6 Card assets/ui/panel-plain.png, the border greca.png, the fireworks fogos-1.png and fogos-2.png.
Rush hour and special customer, real screenshot
Rush hour (the banner at the top) and a special customer with the ×3 seal, in the Snow Festival. Numbers: recipe A.
Better stall card, real screenshot
Two equal stalls merged: the card shows what the stall can make now (GEN_DROPS in src/config.js).
New district card, real screenshot
A new district: its first place (area-1.png) and its new stall.
The counter in the Harbor of Boats, real screenshot
Harbor of Boats: its own scenery, customers and counter color (recipes C and H).
Recipe book, real screenshot
Recipe book: one tab per food, 8 dishes and the 5 levels of the stall.
Win card, real screenshot
The 4 districts lit: the prize of the night (NIGHT_REWARD) and the next night.
The counter on a phone, real screenshot
The counter on a phone held upright: customers at the top, shelf at the bottom.
The street on a phone, real screenshot
The street on a phone (street.jpg upright).
Pause menu on a phone, real screenshot
Pause menu: volumes, language, less motion, Resume, Menu, Start over.

4. Recipe A: change the numbers of the game

Every number is in one file, src/config.js. Open it in the code editor, change only the number, keep the commas and save. Each line has a short comment (in Portuguese) next to it.

What Name in src/config.js As shipped
Size of the flame tank ENERGY.max 100
Time to get 1 flame back ENERGY.regenMs (thousandths of a second) 2000 = 2 seconds
Flames given back by a delivery ENERGY.refund (part of the cost of the order) 0.5
Price of the lanterns STEP_COST: the first number is the price of the first lantern, the second makes each next one dearer 40 and 10 (40, 50, 75, 112 … coins)
How much dearer each district is DISTRICT_COST 0.35 (35% more per district)
Stars per lantern, stars per level STEP_STARS, STARS_PER_LEVEL 2 and 3
Customers at the same time ORDERS.slots (at levels 1, 2 and 3 or more) 1, 2, 3
Dishes in one order ORDERS.maxItems (at levels 1, 2, 3 and 4 or more) 1, 2, 2, 3
Pay of an order ORDERS.pay 2
Free change of an order ORDERS.swapMs 120000 = 2 minutes
Special customer ORDERS.vipChance (0 to 1), ORDERS.vipPay, ORDERS.vipFrom (level) 0.12, 3, 3
Rush hour ORDERS.rushEvery (deliveries), ORDERS.rushMs, ORDERS.rushPay, ORDERS.rushFrom (level) 12, 60000 = 60 seconds, 2, 3
Prize of the night NIGHT_REWARD (multiplied by the number of the night) 500
Prize of a page of the recipe book BOOK_REWARD 80
Level at which the Steamer and Sweets stalls arrive at in GENS 4 and 7

5. Recipe B: change the picture of a dish or a stall

  1. Dishes and stalls are in assets/items/. A dish is <chain>-1.png to <chain>-8.png (for example tea-1.png … tea-8.png). A stall is gen-<stall>-1.png to gen-<stall>-5.png.
  2. Draw your picture as a square PNG of 256×256 pixels with a transparent background, with the object filling most of the square. A bigger square also works (we tried 512×512: the game draws it in the same space), it only makes the download heavier.
  3. Save it with exactly the same name as the picture you replace and copy it over the old file.
  4. Change the name of the dish in the list item.<chain> (8 names, in order) and the name of the stall in gen.<stall>, in every language you use (recipe E). The name of the food on the recipe book is chain.<chain>.

6. Recipe C: change the scenery and the customers of a district

The first district (Lantern Market) keeps its pictures in assets/ui/. The others have one folder each: assets/bairros/porto/, assets/bairros/lotus/ and assets/bairros/neve/. Every district uses the same 13 file names:

File Size as shipped Where it appears
scene.jpg 1914×822 Scenery above the counter on phones held upright
scene-land.jpg 1672×941 Scenery behind the counter on wide screens
street.jpg 941×1672 The street with the lanterns lit
street-dark.jpg 941×1672 The same street with the lanterns off (the lit one fades in over it)
area-1.png, area-2.png, area-3.png 533×534 The three places of the street; area-3.png is also the picture of the district on the map and on the win card
who-1.png … who-6.png about 300×285, transparent background The six customers, from the waist up
  1. Prepare your pictures in the same sizes and proportions.
  2. Give them the same names and copy them over the old files of that district.
  3. street.jpg and street-dark.jpg must be the same drawing, one lit and one dark.
  4. The names of the district and of its places are texts: bairro.<id> and area.<place> (recipe E).

7. Recipe D: add a district

We tried this recipe with a fifth district called coral: the street, the map of the districts and the win card showed the 5 districts on a phone and on a wide screen.

  1. Choose a short name with no spaces or accents, for example coral, and three names for its places, for example reef, cove and tide.
  2. Open src/config.js, find DISTRICTS and add a line at the end of the list, before the ];:
    export const DISTRICTS = [
      { id: 'market', areas: ['gate', 'alley', 'plaza'] },
      { id: 'porto', areas: ['harbor', 'pier', 'lighthouse'] },
      { id: 'lotus', areas: ['roundgate', 'bridge', 'pavilion'] },
      { id: 'neve', areas: ['icegate', 'hotrow', 'icegarden'] },
      { id: 'coral', areas: ['reef', 'cove', 'tide'] },
    ];
  3. Create the folder assets/bairros/coral/ with the 13 pictures of recipe C. To start, copy the folder of another district and replace the pictures one by one.
  4. Add the music assets/music/coral.mp3 (recipe F). Without this file the district is silent.
  5. Open src/locales.js and add the four texts to the English block, next to the other bairro. lines, and to the Portuguese block (the test of the source checks that Portuguese has every English text; the other languages show the English text until you translate it):
        'bairro.coral': 'Coral Bay',
        'area.reef': 'Reef Gate',
        'area.cove': 'Shell Cove',
        'area.tide': 'Tide Market',
  6. Optional, the color of the counter: in style-more.css, copy the block body[data-bairro='porto'] (the last one in the file with that name), change porto to coral and choose the two colors. Without it the district uses the color of the first one.
  7. Save, start the game and, on your computer, open ?debug&bairro=4 to see the new district (the count starts at 0).
Good to know. The night now ends after 5 districts, so the prize of the night and "Night 2" come after the new one. A new district does not bring a new stall by itself: the three stalls of the districts are set in GENS (dist: 1, 2, 3) and a new food needs a programmer (see What needs a programmer). Do not remove a district or change the order in a game that is already online: players' saves keep the number of the district.

8. Recipe E: change texts and languages

  1. English and Portuguese are in src/locales.js (the blocks en: and pt:, and a few more lines added below them). Each of the other 12 languages has its own file in src/locales/: es.js, fr.js, de.js, it.js, nl.js, pl.js, tr.js, ru.js, id.js, ja.js, ko.js, zh.js.
  2. Each line is 'key': 'text',. Change only the text between the quotes. Keep the key, the quotes and the comma. Keep words in braces such as {n} and {x}: the game puts a number or a name there. If your text has an apostrophe, write the text between double quotes, as in "Let's go!".
  3. Useful keys: ui.play (title button), tut.0 to tut.8 (the tutorial), tip.gift, tip.shelf, tip.swap, tip.book, tip.vip (tips), bairro.* and area.* (districts and places), item.* (lists of 8 dish names), gen.* (stalls), chain.* (foods), ui.rush, ui.vip, ui.win and ui.winSub (win card).
  4. A key missing in a language shows the English text.
  5. To add a language (tried with a 15th language): copy a file of src/locales/, for example es.js to ca.js, and translate it. In src/locales-more.js add the line import ca from './locales/ca.js'; and add ca to the list in the last line (export const MORE = { … zh, ca };). In src/locales.js add ['ca', 'Català'], to LANGS. The language then appears in the pause menu and ?lang=ca works.
  6. If you use source/, run npm test: it checks keys and braces in every language. After adding a language, change the number in the line assert.equal(LANGS.length, 14); of test/locales.test.mjs to the new count, or that test fails.

The bundled font has Latin letters only: Russian, Japanese, Korean and Chinese texts are drawn with a font of the player's device (recipe H).

9. Recipe F: replace or remove the music

  1. Logo: replace assets/ui/logo.png (900×388 pixels, transparent background). It is shown on the title screen.
  2. Title background: assets/ui/splash.jpg (phones held upright, 941×1672) and assets/ui/splash-land.jpg (wide screens, 1672×941). Leave room for the logo at the top and for the Play button.
  3. Name in the browser tab: open index.html and change the text inside <title>. The same file has the logo description in alt="Lantern Bites".
  4. Name of the installed web app: name and short_name in manifest.webmanifest.
  5. Icons: favicon.ico (browser tab), assets/icon-180.png (180×180), assets/icon-192.png (192×192) and assets/icon-512.png (512×512), square, without transparency. Replace them keeping the names.
  6. The girl of the tutorial is assets/ui/guide.png (268×300, transparent) and the pointing hand is assets/ui/hand.png.

11. Recipe H: change colors and the font

12. What needs a programmer

These parts are built into the code and the layout. Changing only a number or a file is not enough:

For custom work, write to willian@polargames.com.br.

13. Check and publish your changes

  1. Play the parts you changed on your computer (see Before you start), in a wide window and in a narrow one (F12, then Ctrl+Shift+M shows phone sizes).
  2. If you edited source/: in a terminal inside source/, run the commands below. The first checks the rules, the pace and the texts; the second copies the game to source/dist/.
npm test
npm run build
  1. Upload everything inside game/ (or source/dist/, if you built it) to your web hosting, replacing the old files.
  2. Open your game address and press Ctrl+F5. If you still see the old version, read the section about updates and cache in the main buyer guide.

14. If something goes wrong