A Fire of London interactive game lets players relive the Great Fire of 1666 as an escape-and-firefighting challenge. The simplest working version is a browser-based board game built with HTML, CSS and JavaScript: draw a map of the City of London on gridded streets, place buildings on the spaces between, and let players race to stop the blaze spreading before the historic firebreak at the Tower of London is reached. The only things needed are a text editor, a web browser and a free code editor such as Visual Studio Code. Nothing is installed beyond that, because the game runs from a single local file.
This guide builds a complete, playable game you can open by double-clicking a file. It also covers a physical classroom version for groups without computers. Menu labels in the online tools mentioned here can differ slightly by version, device or region, so look for the nearest equivalent wording if what you see does not match exactly.
What You'll Need
- A computer running Windows, macOS or Linux with a modern browser (Chrome, Edge, Firefox or Safari).
- A text editor. A free code editor such as Visual Studio Code is easiest because it highlights errors, but Notepad or TextEdit works.
- One folder to hold three files: index.html, style.css and script.js.
- Optional: a printed map of the City of London or a simple drawing of streets, St Paul's Cathedral, Pudding Lane and the Tower of London for reference.
- For the paper version: dice, paper, coloured counters and a large sheet for the map.
Step-by-Step
- Set up the folder. Create a new folder named fire-of-london. Inside it, create three empty files: index.html, style.css and script.js. Keep the exact names and lower-case spelling, because the browser will not find the files otherwise.
- Write the map grid. Open index.html and add a container with a heading, a short line of instructions (for example, "Roll, move and choose: stop the fire before it reaches the Tower"), a button to roll or advance a turn, and a score or status line. Inside the container, add an empty element with the id map where the game board will appear. End the body with a small script tag pointing to script.js.
- Style the board in style.css. Give the map element a grid layout with nine columns and nine rows, a fixed size, and a background colour in warm parchment tone. Give each square a light border so the streets read clearly. Mark squares with classes such as building, street, river and landmark, and colour them differently: brown for buildings, grey for streets, blue for the Thames across the bottom row, red for the fire, and gold for St Paul's and the Tower. Use a red border to show the current player position.
- Define the board in script.js. Create an array of 81 entries, one per square. Each entry is an object with a type and optional label. Put landmarks at the correct corners and edges: Pudding Lane near the east side, St Paul's toward the middle, and the Tower at the far east. Put the river along the bottom row so players can see the firebreak. Keep buildings as the default type.
- Render the board. Write a function that clears the map element and loops through the array, creating a div for each square, adding the correct class and label, and appending it. Call the function once when the page loads. Check the result in the browser by double-clicking index.html; you should see the full grid, not empty space or a list of text.
- Add the player and the fire. Keep two variables for the player's square index and an array for fire squares. Start the player near Pudding Lane and the fire on that square. In the render function, add the player class to the player's square and the fire class to every square in the fire array. Refresh by calling render after each change of state.
- Write the turn logic. Each turn, the player presses the button and gains two actions: one move to a neighbouring square (up, down, left or right, never diagonally) and one firefighting action. Moving into the river or onto the Tower is a safe escape. After the player's actions, the fire spreads to one randomly chosen neighbouring building square. Remove fire squares the player has doused. Track turns in the status line.
- Add a win and lose state. If the player reaches the river or the Tower, show a win message and disable the button. If the fire count reaches a set limit, for example eight squares, show a loss message with a short historical note that the fire raged for days before the wind dropped and firebreaks took effect. Disable the button in both cases so the game cannot continue past the end.
- Add the firebreak rule. Give the player one limited ability: demolishing an adjacent building stops the fire from crossing that square, at the cost of skipping a turn. Represent demolished squares with a dark outline. This mirrors the real tactic of pulling down houses, and it makes the game strategic rather than entirely random.
- Test and tune. Play ten rounds. If the fire always wins, reduce the spread rate or allow two firefighting actions per turn. If it is too easy, increase the starting fire or lower the douse limit. Change numbers only in the top section of script.js so tuning stays simple.
- Add the physical version. For groups without computers, draw a similar 9 by 9 grid on a large sheet, label the landmarks, and give each team a counter. Roll a die to move, and use a flip of a coin to decide whether the fire spreads each round. Place small red counters to mark flames and remove them when a team reaches a building with a bucket token.
Common Mistakes
The most frequent problem is mismatched file names or a server that is not running. The three files must sit in the same folder, and the link tags in index.html must match the exact names.
Second, cases are common in logic errors: diagonal moves allowed, the fire spreading onto the river, or fire counts recalculated instead of stored. Keep the fire as an array of indexes so you can add, remove and count entries reliably.
Third, players build the board without a reachable goal. Always place the river and the Tower within a short path of the start, or a game can be unwinnable before it begins.
Finally, avoid turning the whole map into buildings. Streets and water need to be visually and logically distinct, or the fire has no barrier and the game ends by luck alone.
Tips
Play in groups with one person running the fire and one running the players; it halves the difficulty of handling the spread. Announce the fire's direction each round ("the wind pushes east") so the randomness feels like weather rather than punishment.
Keep a copy of script.js after each working stage. If a change breaks the game, restore the last good file rather than hunting through the whole script.
Pair the game with a short reading of a reliable history of the Great Fire so names and places match the era. A moment before each turn is enough to keep the theme alive.
On tablets, tap targets need to be larger than on desktop. Enlarge the grid squares with a larger font size as well as larger squares, or players will misread labels.
Troubleshooting
If you see a blank page, open the browser's developer tools (press F12, or use the menu) and check the console for errors. Common causes are a mistyped file name, a genuine JavaScript syntax error, or script.js loading before the page elements exist. Put the script tag at the very end of the body to solve the last one.
If the board displays as a list of words instead of squares, the CSS file is not linked. Check the link tag's href attribute and the file's folder location.
If clicking the button does nothing, the event listener is missing or attached before the button exists. Confirm the button has an id and that the script adds the listener after the page loads.
If the fire spreads through the river, inspect the spread function: it should test the neighbour's type and skip water, streets and demolished squares. Test each rule in isolation by reading the array in the console.
If the file will not open at all, use a different browser or copy the folder to a simple path without spaces or unusual characters. Long folder paths can also cause failures on some systems, so move the folder to your desktop.
If you want to change the rules, do it one variable at a time and play five turns after each change. Reverting changes is far easier when you know which single value is responsible.
Frequently Asked Questions
Do I need to know how to code?
Basic familiarity with HTML and JavaScript helps, but the steps above are copy-in-order rather than puzzle-solving. Follow them one at a time and test after each one.
Can I play without a computer?
Yes. The board, dice and counter version described in step 11 works on paper and needs no hard file or browser.
Is the game historically accurate?
No. It is a simplified model inspired by the Great Fire of 1666. The escape route and landmarks echo the real city, but the rules are designed for play and should not be treated as a history source.
How many players can play?
The digital version above is one player against the fire. To add more, create an array of players and rotate through it each turn.
Does it work on a phone?
Yes, once the CSS scales to smaller screens. Use relative widths and larger touch targets rather than fixed pixel sizes.
Can I share it with a class?
Yes. Send the folder as a zip file or open it from a shared drive; no internet connection is required after the files are saved locally.