Wordtrail: HTML5 Word Search Game
- Wordtrail
- Privacy Policy
- Terms of Service
- Refund Policy
- Support
- Play Wordtrail
- Wordtrail documentation
- Wordtrail press kit
- Guides
Documentation · Plain JavaScript, no build step, no dependencies
Contents: Quick start · Files · Words & categories · Configuration · Reskin · Languages · Custom puzzles · Ads & hooks · CrazyGames · Daily challenge · Journey · Embedding · FAQ · Credits
Thank you for purchasing Wordtrail. This guide assumes no coding experience. Every change described here is made by editing
one text file, word-search-game/config/game-config.js, in any text editor (Notepad, TextEdit in plain-text mode, VS Code).
If you have a question that this document does not answer, email support@tanglement.ai or use the marketplace's item support page. Live demo: https://tanglement.ai/html5-wordsearch/play/.
1. Quick start
- Unzip the download.
- Open
word-search-game/index.htmlin a browser by double-clicking it. The game runs straight from your disk; no server is needed. - To publish it, upload the whole
word-search-gamefolder to any web host (shared hosting, Netlify, GitHub Pages, S3) and openhttps://your-site.example/word-search-game/.
Uploading by FTP: upload the contents of the folder with the same structure (index.html, css/, js/, config/, assets/). Nothing needs to be installed on the server and no database is used.
How to play
- Drag across letters in a straight line (horizontal, vertical or diagonal) to select a word. Backwards also works.
- Alternative for touch screens: tap the first letter, then tap the last letter.
- The bulb button highlights the first letter of a word you have not found yet (3 free hints per puzzle by default). Each hint costs points.
- Pause hides the grid so the timer cannot be cheated. The game also pauses automatically when the tab is hidden.
- Keyboard:
PorEscpauses or resumes,Huses a hint.
2. Files
| Path | What it is | Edit it? |
|---|---|---|
word-search-game/index.html | Page layout of all screens | Only for layout changes |
word-search-game/config/game-config.js | All settings: title, colours, categories, words, difficulty, ads | Yes, this is the file you edit |
word-search-game/css/style.css | Styles. Colours come from the config, so you rarely need this | Optional |
word-search-game/js/hooks.js | Integration points for ads, leaderboards, analytics | Yes, for ads |
word-search-game/js/adapters/crazygames.js | Ready-made CrazyGames SDK integration | No, switch it on in config |
word-search-game/js/journey.js | Journey levels, special tiles, stars, star gates, coins (no browser code; unit tested) | No, configure it in config |
word-search-game/js/engine.js | Puzzle generator, selection, scoring, high scores (no browser code; unit tested) | No |
word-search-game/js/game.js | Screens, input, timer, pause, sounds | No |
word-search-game/js/audio.js | Sound effects, synthesised in the browser (no audio files) | Optional |
word-search-game/assets/icons/*.svg | Category icons | Replace freely |
tests/ | Automated tests (Node.js 18+): node --test tests/ | Developers only |
3. Words and categories
Each category is one line in the categories list of config/game-config.js:
categories: [
{ id: 'animals', name: 'Animals', icon: 'assets/icons/animals.svg',
words: ['Tiger', 'Zebra', 'Giraffe', 'Monkey', 'Rabbit', 'Turtle'] },
{ id: 'brand', name: 'Our Products', icon: 'assets/icons/my-logo.png',
words: ['Coffee', 'Espresso', 'Latte', 'Mocha', 'Cappuccino', 'Americano'] }
]
id: a unique name without spaces. High scores are stored per id.name: shown on the button and above the word list.icon: path to an SVG, PNG, JPG or WEBP image, or a short piece of text (for example a letter). If left out, the first letter of the name is shown.words: as many words as you like. Each puzzle randomly picks a subset (seemaxWordsin difficulties), so long lists keep the game fresh. Words are shown exactly as you type them; spaces, hyphens and apostrophes are removed in the grid ("Ice Cream" becomes ICECREAM).- A word longer than the grid size of a difficulty is skipped at that difficulty. Give each category at least
2 × maxWordswords of varied length. - Optional per category:
alphabet(letters used to fill empty cells),locale(for upper-casing, e.g.'tr'),rtl: true(right-to-left word list).
To remove a category, delete its line. To make a single-category game, keep one line. Watch the commas: every line except the last ends with a comma.
If the config has a mistake (for example a category with fewer than 3 words), the game shows a clear message listing what to fix instead of a blank page.
4. Configuration reference
General
| Option | Default | Meaning |
|---|---|---|
title | Wordtrail | Title on the menu and in the browser tab |
subtitle | Find every hidden word | Line under the title (empty to hide) |
storagePrefix | wordsearch | Prefix for saved high scores. Use a different value for each game you host on the same domain |
sound.enabled | true | Sound on by default (players can toggle; their choice is remembered) |
sound.volume | 0.5 | 0 to 1 |
Gameplay
| Option | Default | Meaning |
|---|---|---|
gameplay.timerMode | 'up' | 'up' counts up (relaxed). 'down' counts down from countdownSeconds; the puzzle is lost at 0 |
gameplay.countdownSeconds | 180 | Time limit in countdown mode |
gameplay.hintsPerPuzzle | 3 | Free hints per puzzle (0 to disable free hints) |
gameplay.hintPenalty | 25 | Points removed per hint |
gameplay.pointsPerLetter | 10 | Points per letter of each found word |
gameplay.timeBonusMax | 500 | Bonus for finishing instantly; shrinks to 0 at the difficulty's parSeconds |
gameplay.showWordList | true | false hides the word list (harder "mystery" mode) |
gameplay.allowCustomPuzzles | true | Shows the "Create a Puzzle" button and accepts share links |
gameplay.startOnLoad | false | true skips the menu and starts a puzzle immediately (required by some game portals) |
Difficulties
difficulties: {
easy: { label: 'Easy', size: 8, maxWords: 6, parSeconds: 120, directions: ['E', 'S'] },
medium: { label: 'Medium', size: 10, maxWords: 8, parSeconds: 210, directions: ['E', 'S', 'SE', 'NE'] },
hard: { label: 'Hard', size: 12, maxWords: 10, parSeconds: 300, directions: ['E', 'W', 'S', 'N', 'SE', 'NW', 'NE', 'SW'] }
}
size is the grid width and height (4 to 20). directions are compass directions in which words are written:
E = left to right, W = right to left (backwards), S = top to bottom, N = bottom to top, and the four diagonals SE, NE, SW, NW.
You can add, rename or remove difficulties; at least one is required.
5. Reskin: colours, logo, background, icons, sounds
theme: {
background: '#14213d', // page background
backgroundImage: '', // e.g. 'assets/bg.jpg' (covers the screen)
panel: '#1f2f56', // buttons and cards
text: '#f5f7ff',
muted: '#9fb0d9', // labels
accent: '#fca311', // highlights, primary buttons
gridBg: '#ffffff',
gridText: '#1b1b2f',
selection: 'rgba(252, 163, 17, 0.55)',
foundColors: ['#8ecae6', '#90be6d', '#f9c74f', '#f8961e', '#f28482', '#b8a1e3', '#4cc9f0', '#80ed99'],
fontFamily: 'system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif',
logo: '' // e.g. 'assets/logo.png' replaces the title text
}
- Logo: put your image in
assets/and setlogo: 'assets/logo.png'. - Font: the default uses each device's system font, so nothing is downloaded. To use a web font, add its
<link>tag toindex.htmland put its name first infontFamily. - Icons: replace the SVG files in
assets/icons/or pointiconat your own images (square, 64×64 or larger). - Sounds: the game synthesises its sounds, so there are no audio files to license. To use your own files, add this line at the end of
config/game-config.js:
Any sound you leave out keeps its synthesised version.window.WSAUDIO_FILES = { tap: 'assets/sounds/tap.mp3', select: 'assets/sounds/select.mp3', found: 'assets/sounds/found.mp3', wrong: 'assets/sounds/wrong.mp3', hint: 'assets/sounds/hint.mp3', win: 'assets/sounds/win.mp3', lose: 'assets/sounds/lose.mp3' };
6. Languages, accents and right-to-left
Words may use any alphabet. Accented letters, Ñ, Cyrillic, Greek and combining marks each fill exactly one cell. Set alphabet on the category so the random filler letters match your language:
{ id: 'frutas', name: 'Frutas', locale: 'es', alphabet: 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZ',
words: ['Piña', 'Manzana', 'Limón', 'Sandía', 'Fresa', 'Cereza'] }
Interface texts (button labels) are in index.html and js/game.js (search for the English text).
For right-to-left word lists set rtl: true on the category. The grid itself is always laid out left to right, as in printed word searches.
7. Custom puzzles and share links
Players (teachers, party hosts, brands) can press Create a Puzzle, type up to 40 words, and either play right away or copy a share link. The link holds the words, so anyone who opens it gets the same puzzle and no server storage is needed. You can also build links yourself:
index.html?c=animals&d=hardopens the menu with Animals/Hard selected.index.html?c=animals&d=easy&autostart=1starts that puzzle immediately.index.html?seed=123&autostart=1always generates the same grid (for printed handouts or competitions).
8. Ads, leaderboards and analytics (js/hooks.js)
The game calls the functions in js/hooks.js at the right moments. Out of the box they do nothing, so the game runs with no ads.
To monetise, replace the body of a function with your ad network's call. Every ad function receives done, which it must call exactly once, whether or not an ad was shown.
| Hook | When |
|---|---|
init() | Before the game starts. Return a Promise to wait for an SDK (capped by platform.initTimeoutMs) |
getStorage() | Return a localStorage-like object to save scores somewhere else (e.g. a portal's cloud save) |
onReady() | The menu is shown (loading finished) |
onPuzzleStart(info) | A puzzle begins: category, difficulty, words, seed |
onGameplayStart() / onGameplayStop() | Active play begins or stops (start, pause, resume, end, menu, around rewarded ads) |
showInterstitial(done) | Between puzzles, every ads.interstitialEveryNPuzzles puzzles (0 = never) |
showRewarded(done) | The player taps the hint button after the free hints are used (if ads.rewardedHint is true). Call done(true) to grant the hint. After a granted reward the button shows a countdown for ads.rewardedCooldownSeconds (default 90) so ads are never offered back to back |
submitScore(result) | Every finished puzzle: score, best, seconds, words found, hints used. Send it to your leaderboard here |
onPuzzleComplete(result), onPause(), onResume() | Analytics |
Example: Google AdSense for games (H5 Games Ads)
After your AdSense account is approved for H5 games, add Google's ad tag to index.html as their instructions describe, then in js/hooks.js:
showInterstitial: function (done) {
adBreak({ type: 'next', name: 'puzzle-complete', adBreakDone: function () { done(); } });
},
showRewarded: function (done) {
var granted = false;
adBreak({ type: 'reward', name: 'extra-hint',
beforeReward: function (showAdFn) { showAdFn(); },
adViewed: function () { granted = true; },
adDismissed: function () {},
adBreakDone: function () { done(granted); } });
},
Mobile apps (AdMob)
To publish as an Android or iOS app, wrap the word-search-game folder with Capacitor or Cordova and call the AdMob plugin's interstitial and rewarded functions from the same two hooks.
Leaderboard
submitScore: function (result) {
fetch('https://your-server.example/scores', { method: 'POST', headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ score: result.score, category: result.category, difficulty: result.difficulty }) });
},
High scores are always saved on the player's device (localStorage) per category and difficulty, and shown on the menu and end screen.
9. CrazyGames integration (built in)
To publish on CrazyGames, set this in config/game-config.js:
platform: { provider: 'crazygames', useSdkStorage: true, initTimeoutMs: 6000 },
gameplay: { /* ... */ startOnLoad: true }, // CrazyGames asks that players land directly in gameplay
ads: { interstitialEveryNPuzzles: 1, rewardedHint: true, rewardedCooldownSeconds: 90 } // the SDK itself limits midgame ads to 1 per 3 minutes
The adapter (js/adapters/crazygames.js) loads the CrazyGames HTML5 SDK v3 and connects it for you:
SDK.init()before the game starts;loadingStart/loadingStoparound loading.gameplayStart/gameplayStopwhenever play starts, pauses, resumes or ends.- A midgame ad between puzzles and a rewarded ad for extra hints. Game audio is muted while an ad plays. If the ad fails (ad blocker, no fill, cooldown) the game continues and the reward is not granted.
- The SDK's
muteAudiosetting overrides the in-game sound toggle. happytime()when the player sets a new best score.- High scores and settings are saved with the SDK data module, so they follow logged-in players across devices. Tick "Progress Save" in the CrazyGames submission form.
Test locally by serving the folder from http://localhost (for example python3 -m http.server). The SDK runs in its "local" environment there and logs every call in the browser console.
If the SDK cannot load, the game still works without ads.
The daily streak and statistics are saved through the same data module (cloud save).
GameDistribution (built in)
platform: { provider: 'gamedistribution', gameId: 'YOUR-GAME-ID', initTimeoutMs: 6000 },
gameplay: { /* ... */ startOnLoad: true },
ads: { interstitialEveryNPuzzles: 1, rewardedHint: true, rewardedCooldownSeconds: 90 }
The adapter (js/adapters/gamedistribution.js) sets GD_OPTIONS, loads the SDK from the GameDistribution CDN, calls gdsdk.showAd() between puzzles and gdsdk.showAd('rewarded') for bonus hints and streak repair, and grants the reward only after SDK_REWARDED_WATCH_COMPLETE. Audio is muted between SDK_GAME_PAUSE and SDK_GAME_START. Enable rewarded ads for the game in the GameDistribution developer panel. Progress is saved in localStorage.
python3 tools/package.py builds a separate zip per portal (with GD_GAME_ID=... set for GameDistribution), each without the other portal's adapter.
Other portals (GameMonetize, Poki) use the same pattern: call their SDK's interstitial and rewarded functions inside showInterstitial and showRewarded, and their gameplay events in onGameplayStart/onGameplayStop.
9b. Daily challenge, streaks and statistics
The menu shows a Daily Challenge: one puzzle per calendar date, generated from the date, so every player gets the same grid that day with no server. Completing it extends the player's daily streak; missing a day resets it. Statistics (streak, best streak, dailies solved, best daily score, puzzles played, completion rate, words found) open from the chart button.
daily: {
enabled: true,
difficulty: 'medium',
difficultyByWeekday: null, // e.g. ['hard','easy','easy','medium','medium','medium','hard'] (Sunday first)
categories: null, // null = all categories without a custom alphabet; or ['animals','space']
salt: '', // change to give your copy its own daily sequence
streakRepairWithAd: true // after exactly one missed day, offer "Restore your streak" behind a rewarded ad
}
Links: index.html?daily=1 opens today's daily directly. Hooks: onDailyComplete(result) (first completion of the day, with result.streak) and onStreakRepaired(info).
9c. Journey: worlds, levels, special tiles, stars and coins
The Journey card opens a map of worlds. Each world has its own word theme and 10 levels; the default config ships 7 worlds (70 levels). Level n is generated from its world's words with a seed derived from n and journey.salt, so every player gets the same level n with no server. Grid size (7 to 12), word count (5 to 12) and directions (2 to all 8) ramp up over the whole journey.
- Stars: 1 for clearing a level, +1 within par time, +1 without hints. Levels unlock in order; world w also needs
starGates[w]stars in total. - Bonus tiles (from level 2): finding the word through a gold tile adds
bonusPointsand bonus coins on the first clear. - Locked words (from level 11): a padlocked word only counts after the shown number of other words is found.
- Bombs (from level 21): a red tile with a fuse in seconds. Find its word before the fuse runs out, or the level is lost; a rewarded ad adds
fuseExtendSecondsonce per attempt. Hints point at a live bomb word first. - Coins: earned for a first clear, each new star, bonus tiles and the first daily challenge of the day; spent on hints (
hintCost). With too few coins the hint button plays a rewarded ad worthrewardedCoins. Replaying a level never pays twice.
journey: {
enabled: true,
levelsPerWorld: 10,
salt: '', // change it to give your copy its own levels
starGates: [0, 12, 30, 50, 72, 96, 122], // total stars needed to enter each world
bonusPoints: 150,
fuseExtendSeconds: 20,
economy: { startCoins: 60, hintCost: 20, coinsPerLevel: 10, coinsPerStar: 5, coinsPerBonus: 10, coinsPerDaily: 25, rewardedCoins: 20 },
worlds: [ { id: 'meadow', name: 'Blossom Meadow', color: '#7bc96f', words: ['Bee', 'Seed', ...] }, ... ]
}
Each world needs at least 24 different words of 3 or more letters, including at least 12 of 7 letters or fewer (the first levels use a 7×7 grid). Add or remove worlds freely; the level count follows. Links: index.html?level=12 opens an unlocked level. Portal builds (startOnLoad: true) land in the player's current journey level. Progress is saved under the journey setting (localStorage, or the portal's cloud storage). Free Play categories and the daily challenge are unchanged.
10. Embedding in a website, WordPress or LMS
<iframe src="https://your-site.example/word-search-game/" width="100%" height="700"
style="border:0; max-width:900px" allow="fullscreen; autoplay"></iframe>
WordPress: upload the folder by FTP (e.g. to /games/word-search-game/) and paste the iframe into a Custom HTML block.
The game resizes to fit any width and works in portrait and landscape.
11. FAQ and troubleshooting
I edited the config and now the page is blank or shows an error.
Usually a missing comma or quote. The game lists config mistakes on screen; for syntax errors open the browser console (F12) to see the line number.
My changes do not appear online.
Your browser may be showing a cached copy: reload with Ctrl+F5 (Cmd+Shift+R on Mac).
Some words never appear.
A word longer than the grid size is skipped at that difficulty. Use shorter words or a larger size.
No sound on iPhone.
iOS allows sound only after the first tap, and not when the ring/silent switch is on silent.
Does it need PHP, a database or Node.js?
No. It is static HTML, CSS and JavaScript. Node.js is only needed to run the optional automated tests.
Browser support
Current Chrome, Edge, Firefox and Safari on desktop, Android and iOS. Tested in Chromium on desktop (1280×800) and phone (390×844 portrait, 844×390 landscape).
12. Credits and licences
All code, icons, word lists and sound effects in this item were created by the author for this item. No third-party libraries, fonts, images or audio are included. Sounds are generated at runtime with the Web Audio API. The default font is the device's own system font.
13. Changelog
2.0.0: Journey mode: 7 themed worlds, 70 deterministic levels, bonus / locked / bomb tiles, stars, star gates, coin economy for hints with rewarded ads, rewarded bomb revive; new default title.
1.1.0: daily challenge (same seeded puzzle for everyone each date), daily streaks with rewarded streak repair, statistics screen, cloud save of stats on CrazyGames, GameDistribution SDK adapter and portal build, Playwright end-to-end tests in CI.
1.0.0: initial release.