Contents
- Overview
- Installing on your website
- Requirements
- How to play
- The 10 worlds
- Screens
- Files and folders
- Customizing
- Languages
- Saving and resetting
- Development (optional)
- Updating and clearing the cache
- Licences and credits
- Common problems
- FAQ
- Before you ask for support (2 minutes)
- Report a problem
- For AI assistants
- Support
1 Overview
Barnyard Bunch is a complete HTML5 farm animal sort puzzle for one player. Farm animals sit on hay bales: lift the farm animal on the right end of a hay bale, move it to another hay bale, group 4 matching farm animals to fill a balloon and send every farm animal off in as few moves as you can.
There are 100 levels in 10 worlds of 10 levels. Every world has its own farm scenery, its own music and its own ambient sound, and worlds 2 to 9 add one new twist each. A solver checked every level when the levels were made, so every level can be solved, and it stored the best number of moves (the par) that gives 3 stars. Each level gives 3 helps: Undo (5 per level), Shuffle (1 per level) and Extra bale (1 per level).
Around the levels: 17 farm animals (16 regular farm animals and a rainbow chick that matches any farm animal), each with 9 faces and 8 poses, a tutorial that teaches by doing, up to 3 stars per level (300 in all), combos and praise words, 14 interface languages, vibration, reduce motion and full screen where the device supports them, and layouts for phone, tablet, desktop and ultrawide screens in portrait and landscape. Everything you see is drawn with picture files (WebP), so you can replace the art without touching the code.
2 Installing on your website
Installing takes a few minutes if you have FTP access or a file manager in your hosting panel.
The game can live in the main folder of a website or in a subfolder, such as
games/barnyard-bunch/. It needs HTTPS or HTTP hosting: opening index.html directly
from the disk (file://) does not work.
- 1. Extract
barnyard-bunch-static-1.0.0.zipon your computer. -
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/barnyard-bunch/. -
3. Upload only the contents of the
game/folder, so thatindex.htmlsits directly inside the target folder. -
4. Keep the folders
css/,fonts/,src/andassets/besideindex.html, with their names and letter case unchanged. -
5. Open
https://your-domain.example/games/barnyard-bunch/in a modern browser.
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.htmldirectly from the disk (file://) does not work, because browsers block JavaScript modules there. - A current browser on desktop, tablet or phone: Chrome, Edge, Safari or Opera. The game draws with HTML, CSS and a canvas, so it needs no 3D graphics.
-
About 30 MB of space on the server. The game makes no request to other websites: the fonts, pictures,
sounds and music are all inside
game/. -
Node.js is only needed to run the tests or to rebuild the game from
source/(see the development section). - Tested on a computer in Chromium and WebKit (the Safari engine) browsers, also in phone-sized windows. It has not been formally tested on physical phones or tablets.
4 How to play
Goal: send every farm animal off in a balloon. A hay bale holds up to 4 farm animals. Tap (or drag) a hay bale to lift the farm animal on its right end, then tap another hay bale to move it. Only the farm animal on the right can move, and 2 or 3 matching farm animals on the right move together. An empty hay bale takes any farm animal; otherwise a farm animal only lands next to a matching farm animal.
Balloons: group 4 matching farm animals on a hay bale to fill a balloon. 3 balloons are shown at a time and each balloon shows the farm animal it wants; new balloons arrive as others leave. If no balloon wants the group yet, the group naps until its balloon comes.
Helps: every level starts with Undo (5 per level), Shuffle (1 per level) and Extra bale (1 per level, it adds an empty hay bale with 4 seats). Shuffle only gives a layout that can still be solved. If no move is left, the game says "No moves left" and offers Try again and the helps.
Stars: 3 stars when you finish in up to 1.3 times the par, 2 stars up to 1.8 times the par, and 1 star otherwise. The par is the fewest moves the solver found for that level. There are 300 stars in all. Fewer moves, more stars.
Learning: levels 1 to 4 teach by doing, one hint at a time with a pointing hand, and the first level of each new twist shows one short hint. You can turn the hints off with Tips in Settings. The level map shows 10 levels per world in 2 rows of 5.
Controls: touch (tap or drag), mouse (click or drag) and keyboard (the arrow keys pick a hay bale, Space or Enter act, Esc closes a panel). Options: Music and Effects (the Sound panel), Vibration (only where the device supports it), Reduce motion (it also follows the system setting), Tips, Full screen (only where supported) and Language.
5 The 10 worlds
World 1 teaches the basics. Every world after it adds one twist, and the game shows a short hint the first time it appears. World 10 mixes them all.
- World 1: the basics. Move farm animals, fill balloons.
- World 2, mystery farm animals: hidden farm animals show up as a "?" silhouette and are revealed when they reach the right end of a hay bale.
- World 3, tiny hay bale: a tiny hay bale holds only 1 farm animal.
- World 4, straw dust with a request: a covered hay bale shows a farm animal and a number (for example "x2"); the straw dust settles after that many groups of that farm animal have been sent.
- World 5, ice: some farm animals are in ice; the ice melts when a matching farm animal lands next to it.
- World 6, rainbow chick: the rainbow chick matches any farm animal.
- World 7, hay bale sizes: hay bales with 2, 3 and 5 seats appear next to the usual 4, so count the seats.
- World 8, rope: farm animals tied with a rope move together.
- World 9, surprise balloon: a "?" balloon shows its farm animal later.
- World 10: everything together.
6 Screens
Marks on the screenshot
- Logo
- Farm animals on a hay bale
- Play (shows your level)
- Levels
- How to play
- Sound
- Settings
Marks on the screenshot
- World name and arrows
- The 10 levels of the world
- Total of stars
Marks on the screenshot
- Level
- Groups delivered
- The 3 balloons
- Hay bales and farm animals
- Undo, Shuffle and Extra bale
- Pause
Marks on the screenshot
- Stars
- Moves
- Play again
- Next level
Marks on the screenshot
- Try again
Marks on the screenshot
- The six cards
Marks on the screenshot
- Music slider
- Effects slider
Marks on the screenshot
- Switches
- Language
Marks on the screenshot
- Languages
7 Files and folders
game/ is the ready-to-host game. source/ has the same files plus the tests and two
small tools: a local preview server and the level generator. The code is plain JavaScript ES modules with no
compile step and no npm dependency.
game/ - upload these contents to your web host
index.html - the page with every screen and panel
css/ - the styles of the page and its panels
fonts/ - Fredoka and Nunito, with their license (OFL.txt)
src/config.js - START HERE: feel numbers (FEEL), the 17 cats (CATS), colours and personalities
src/game/ - rules.js (the rules and HELPS), solver.js and levels/world-1.js to world-10.js
src/render/, src/fx/ - the canvas: clouds, cats, balloons, motion and effects
src/ui/ - the screens: menu, level map, how to play, settings, panels, tutorial hints
src/audio/ - the sound engine and the lists of sound files
src/lib/ - language (i18n.js), save (storage.js), screen fitting, full screen
src/locales/ - one text file per language (14 files)
assets/ - cats/, bg/, game/, ui/, icons/, fx/ (pictures), sfx/, music/, amb/ (sounds)
DOCUMENTATION.txt - short note that points to this guide
source/ - the same editable files, plus:
package.json, package-lock.json
README.md, DO-NOT-UPLOAD.txt
test/ - npm test (5 test files)
tools/generate-levels.mjs - makes the levels of worlds 2 to 10 (npm run levels)
tools/serve.mjs - local preview server (npm run serve)
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 (and 13 other languages)
documentation/img/ - the pictures 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 and Nunito licenses (SIL OFL 1.1)
-
src/config.js: START HERE.FEELhas every number of the feel (times, distances, sizes, volumes, particles),CATSis the list of farm animals, and the colours and personality of each farm animal are in the same file. -
src/game/:rules.jshas the rules as pure functions andHELPS(the helps per level),solver.jsproves every level can be solved, andlevels/world-1.jstoworld-10.jsare the 100 levels as data. -
src/render/andsrc/fx/: the canvas that draws the hay bales, farm animals and balloons, and the motion and effects.src/ui/: the screens (menu, level map, how to play, settings, panels, tutorial hints). -
src/audio/: the sound engine (sound.js), what plays when (cues.js) and the lists of sound files (sfx-files.js,amb-files.js,music-meta.js).src/lib/: language, save, screen fitting and small helpers.src/locales/: one text file per language. -
index.htmlandcss/: the page, its panels and the styles.assets/: the pictures (cats/,bg/,game/,ui/,icons/,fx/) and the sounds (sfx/,music/,amb/).fonts/: Fredoka and Nunito with their license. -
Some names are in Portuguese because the game was built that way: for example the sound ids
pegar(pick up),soltar(drop),voo(flight),pousar(land),grupo(group),entrega(delivery),balao(balloon),nuvem(hay bale),gelo(ice),novelo(rope) andneblina(straw dust), and the music filesjogo-1tojogo-10(game). Many names are built by the code, so do not rename them: replace the file and keep its name.
8 Customizing
CUSTOMIZATION.html in the main folder of the download, or
documentation/customization.html.
Rules and helps: HELPS in src/game/rules.js has the helps per level (Undo 5,
Shuffle 1, Extra bale 1) and stars() in the same file has the limits of the stars (1.3 and 1.8
times the par).
Feel: FEEL in src/config.js has the lift and flight times, the delivery, the
balloons, the combos, the effects, the voices, the vibration and the mixing of the volumes. Change one
number at a time and play a level to see it.
Pictures: replace a file in assets/ with another WebP of the same name and the same size. The
farm animals are 9 faces and 8 poses each, the sceneries come in 3 shapes (portrait, landscape and
ultrawide) and the logo is assets/ui/logo.webp. The Customization Guide has the exact list and
sizes in its Reskin chapter.
Texts: every interface text is in src/locales/, one file per language. The name of the game is
the title text and the <title> line of index.html.
Sounds and music
Every sound effect is an MP3 in assets/sfx/, named with its id and a version number
(pegar-1.mp3, pegar-2.mp3). The music is assets/music/menu.mp3 and
jogo-1.mp3 to jogo-10.mp3 (one per world), and every world has an ambient loop in
assets/amb/.
There are two volume controls for the player, Music and Effects: the farm animal voices and the ambient
sound follow Effects. To replace a sound, keep the file name and the format, and keep the loudness close to
the old one. The lists are src/audio/sfx-files.js (how many versions each effect has),
amb-files.js (the length of each ambient loop) and music-meta.js.
barnyard-bunch-save and barnyard-bunch-prefs (in
src/lib/storage.js). If you publish a very different version of the game, change both names
so old saves do not mix with the new one.
9 Languages
The game has 14 languages: English, Portuguese (Brazil), Spanish, French, German, Italian, Dutch, Polish, Turkish, Russian, Indonesian, Japanese, Korean and Chinese (Simplified). The first visit uses the browser language; the player can change it in Settings.
To change a text, edit the same key in src/locales/<code>.js (the codes are
en, pt, es, fr, de, it,
nl, pl, tr, ru, id, ja,
ko and zh-Hans). Every language must have exactly the same keys as
en.js; npm test checks it (test/locales.test.mjs). To add a language,
copy en.js, translate it, then add it to the list in src/locales/index.js and
change the number 14 and the list of codes in test/locales.test.mjs.
The first visit uses the language of the browser, and the player changes it in Settings, where it is
remembered. You can also open the page with ?lang=de at the end of the address (any of the 14
codes) to start in that language. The Latin alphabets use the included Fredoka font and Russian uses the
included Nunito font. Japanese, Korean and Chinese use the fonts of the device.
10 Saving and resetting
- Your unlocked level, the level you are on, the stars of every level, the language, the two volumes, Reduce motion, Vibration and Tips are saved automatically in the browser of each player (localStorage). Nothing is sent to a server.
-
Two keys are used:
barnyard-bunch-save(the progress) andbarnyard-bunch-prefs(the settings). The game keeps working if the browser blocks storage, but then the progress lasts only until the page is closed. - To start over, delete these keys in the developer tools (F12), under Application, Local Storage, or clear the site data in the browser.
barnyard-bunch-save
barnyard-bunch-prefs
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 npm dependencies and no compile step, and there is
nothing to build: the files of source/ are the files of the game.
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 the checks: the rules, the 100 levels and their
solutions, the 14 languages, the sounds and the save.
npm ci
npm test
5. Preview: npm run serve starts a local server; open http://localhost:5180/ in your browser,
play for a while, and stop the server with Ctrl+C.
npm run serve
6. Levels: npm run levels makes the levels of worlds 2 to 10 again (add a world number, for
example npm run levels -- 4, to make only that world). It takes a while: the solver proves
every level.
npm run levels
npm run levels -- 4
7. Publish: back up the game on your website, then upload index.html and the folders
css/, fonts/, src/ and assets/ of
source/ 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.
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 text in THIRD-PARTY-LICENSES/: the Fredoka font
(Latin and Latin Extended) and the Nunito font (Cyrillic), both under the SIL Open Font License 1.1, also in
fonts/. The game has no third-party code library.
The pictures, the sound effects, the farm animal voices, the ambient sounds and the music were made by Polar
Games for its games and are licensed with this item under the same license as the code. They are not
third-party stock files. Three of the world music tracks (jogo-8, jogo-9 and
jogo-10) are also used in Birdy Branch, another Polar Games game.
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 toindex.html. - No sound: browsers start audio only after the first tap, click or key press, so tap "Tap to start" first. Check both volumes in the Sound panel (Effects also controls the farm animal voices and the ambient sound), the volume of the device and the silent switch of an iPhone.
- A blank page after you edit a code file: a typo in the file. Open the browser console (F12) to see the message, then fix the line or put the original back.
- The game feels slow on an old phone: turn on Reduce motion in Settings. The game also lowers its own effects when it notices a slow device.
- The old version still appears after an update: clear the cache (see the section above). Two copies on the same domain share their save (see the save keys).
- A picture or a voice is missing or does not change: the file has another name than the one the game asks for, or the letter case differs (servers are case sensitive). Keep the exact names.
- A level feels too hard: use Undo (5 per level), Shuffle and Extra bale, keep one empty hay bale free, and remember that every level can be solved. The level map lets you replay any unlocked level for more stars.
15 FAQ
Does the game need a database or a server language?
Does it use a game engine or a library?
Can I change the levels, the helps, the farm animals and the art?
Does it work on phones?
Does it have ads, accounts, an online ranking or purchases?
How many levels are there? Do they repeat?
A level is too hard. Is it broken?
Can I add more levels or worlds?
Where is the progress saved? Can I move it to another device?
barnyard-bunch-save and
barnyard-bunch-prefs. It belongs to one device, one browser and one web address (http and
https, or www and without www, are different addresses). Decide the final address before you launch.
Can I use my own farm animals, art or sounds?
Can I publish it on a game portal or an app store?
Which license do I need?
What does support include?
16 Before you ask for support (2 minutes)
- 1. Do a hard refresh (Ctrl+F5 or Cmd+Shift+R) or open the game in a private window; an old copy in the cache is the most common cause.
-
2. Open the game through
https://(or a local server), never from the disk (file://). - 3. Press F12, open Console and note the first red message.
- 4. Try another browser or another device.
- 5. Look for your case in Common problems and in the FAQ above.
17 Report a problem
Copy this template, fill it in and send it with your message. It saves a round of questions. Do not send your purchase code, passwords or FTP data in a public comment.
report.t
18 For AI assistants
If you ask an AI assistant to help you change this game, give it the prompt below together with your request. It describes the project so the assistant works on the right files and does not break the rules, the levels or the saves.
You are helping me change "Barnyard Bunch", a finished HTML5 farm animal sort puzzle for one player (version 1.0.0). Read these facts before you edit anything.
PROJECT
- Plain JavaScript ES modules, HTML and CSS. No bundler, no compile step, no npm dependencies, no game engine, no external library. There is no build and no dist/ folder.
- The editable project is source/ (the same files as game/, plus tests and tools). Edit source/, never game/.
- To publish, upload index.html and the folders css/, fonts/, src/ and assets/ of source/ (or the contents of game/) to a static web host. The game does not run from file://.
- Node.js 26.13.0 or newer is needed only for: npm ci, npm test, npm run serve (http://localhost:5180/) and npm run levels.
GAME
- One player. Farm animals sit on hay bales (4 seats, some hay bales have 1, 2, 3 or 5). In the code a farm animal is a "cat" and a hay bale is a "cloud" (names kept from the engine): keep those names. Only the farm animal on the right end of a hay bale moves, 2 or 3 matching farm animals on the right move together, an empty hay bale takes any farm animal, otherwise a farm animal lands only next to a matching one. 4 matching farm animals on a hay bale fill the bucket of a balloon. 3 balloons are shown at a time (SHOWN in src/game/rules.js). 100 levels in 10 worlds of 10. There is no money, betting, shop or prize of value: never add any.
- 17 farm animals: CATS in src/config.js, 16 regular farm animals and the rainbow chick (WILD = 16, it matches any farm animal). The position of a farm animal in CATS is its number in the levels: never reorder the list.
- Helps: HELPS in src/game/rules.js (undo 5, shuffle 1, extra 1 per level). Stars: stars(moves, par) in the same file (3 stars up to 1.3 times the par, 2 stars up to 1.8 times, otherwise 1). The par is the fewest moves the solver found.
- src/game/rules.js has the pure rules (no screen, sound or time code); every action returns { ok, events } and the feel layer only animates the events. src/game/solver.js proves that a level can be solved.
- src/config.js: FEEL has every number of rhythm, distance, size, volume, particles and vibration; changing FEEL never changes a rule, a level or a score. Also CATS, catColor and persona (one entry per farm animal, same order as CATS).
- src/render/ and src/fx/ draw and animate on a canvas; src/ui/ has the screens and panels; src/audio/ has the sound engine, the cues and the lists of files; src/lib/ has language, save and screen fitting.
LEVELS
- World 1 (src/game/levels/world-1.js) is fixed: test/levels.test.mjs checks it byte by byte with W1_HASH.
- Worlds 2 to 10 (src/game/levels/world-2.js to world-10.js) are written by tools/generate-levels.mjs with the solver. Never edit these files by hand: change the recipe in spec() of the generator and run npm run levels (or npm run levels -- 4 for one world), then npm test.
- A level has n, clouds (cats, and the optional cap, hid, ice, tie, fog, fogT), queue, qhid, par and sol.
TEXTS, SAVES AND FILES
- Texts: src/locales/<code>.js, 14 languages (en, pt, es, fr, de, it, nl, pl, tr, ru, id, ja, ko, zh-Hans), exactly the same keys in every file; English is the fallback. New text goes in all 14. test/locales.test.mjs checks the keys.
- Saving: localStorage keys barnyard-bunch-save (progress) and barnyard-bunch-prefs (settings), through src/lib/storage.js only. Add nothing to another key.
- Pictures are WebP in assets/ (cats/, bg/, game/, ui/, icons/, fx/) and sounds are MP3 in assets/sfx/, assets/music/ and assets/amb/. The game finds each file by its name and its size: keep names, sizes and proportions. Panels, plates and long buttons in assets/ui/ are nine-slice pictures: keep their size and corners.
- Some names are in Portuguese (for example pegar, soltar, voo, balao, nuvem, jogo-1.mp3 to jogo-10.mp3). Never rename them: the code builds many of them. New sound ids go in src/audio/sfx-files.js.
- The farm animals have 18 files each in assets/cats/ (9 faces, 8 poses and a peek head) and assets/cats/poses.json holds the body box of each pose.
RULES FOR YOU
1. Make the smallest change that does what I ask. Do not rename or move files.
2. Run npm test after every change and fix what it reports (the tests are in test/).
3. Test through a web server (npm run serve), never from file://.
4. Add no network request, CDN, analytics, advertising or external font. Keep THIRD-PARTY-LICENSES/ and fonts/OFL.txt.
5. Keep comments in English and keep the last line of each own JavaScript file: // End of <path> (complete file).
MY REQUEST:
(write what you want here)
Replace the last line with what you want, for example: make Undo give 10 per level, change the colour of a
farm animal or change the texts of a language. Always run npm test after the change.
19 Support
Questions or problems: write to willian@polargames.com.br with your purchase code, the browser
and the report above (or 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.