What it is
A medieval castle on a dark night, built from little cubes and turning slowly through 360 degrees. Candle-lit windows flicker in the keep and its four round towers. Around the walls stands a small cast of Halloween characters, ghosts drift in circles, bats wheel in front of a huge moon, fog creeps along the ground, and every so often lightning lights the whole scene. Press Thunder! to call the lightning yourself.
Who is in it
| Character | Where | Detail |
|---|---|---|
| The vampire count | On the path in front of the gate | Black cape with a high red collar and red eyes |
| Zombies | In the graveyard, three of them | Green skin, arms out, torn clothes |
| Skeletons | Two, beside the walls | White bones against the dark grass |
| Ghosts | Six, circling the towers | They always turn to face you; the Ghosts button hides them |
| The figure in the top hat | Under the green street lamp | A Victorian silhouette in a long coat, in the spirit of gaslight mysteries |
| A witch | Crosses the sky every 30 seconds | On a broomstick, passing the moon |
| Bats | Seven, in front of the moon | Wings flap in two frames |
| Jack-o’-lanterns | Six pumpkins around the grounds | The carved faces glow and flicker |
| Graves and dead trees | Around the back | Tombstones, crosses and two bare trees |
How to take it
1. Download the file
Press Download the HTML file above. You get pixel-halloween-castle.html. Open it in a browser, or upload it to your own site. It works offline too.
2. Copy the code
View the code
Loading…3. Embed it on your page
<iframe src="https://aspect.tools/pixel-halloween" width="420" height="720" style="border:0;max-width:100%" title="Pixel Halloween castle" loading="lazy"></iframe>
License and credit
Pixel Halloween Castle, 2027 series, by aspect.tools (https://aspect.tools/halloween), MIT License
A visible credit is appreciated but not required.
How to change it
It is published well ahead of October so there is time to adapt it. Open the file in a text editor:
| What to change | Where | Example |
|---|---|---|
| Draw your own monster | the text pictures COUNT, ZOMBIE, SKEL, RIPPER: each letter is one coloured block | '..kfffk..' |
| Where a figure stands | the plant(...) lines: picture, colours, angle, distance from the centre | plant(ZOMBIE, ZC, 2.3, 33, 2) |
| Pumpkins | the pumpkin(...) line: angle, distance, size | pumpkin(3.1, 31, 4) |
| Number of ghosts and bats | the loops that fill GHOSTS and BATS | g < 6, b < 7 |
| How often lightning strikes | the line that sets nextFlash | 16 + Math.random() * 20 |
| How often the witch flies | WGAP and WFLY | WFLY = 9, WGAP = 30 |
| Castle colours | the pal('stone'...) and pal('roof'...) lines | pal('roof', 104, 76, 140) |
Halloween is on October 31. The scene shows no date or greeting, so it also suits any spooky or gothic page.
Questions
Can I use the pixel Halloween castle on my own website?
Yes. It is under the MIT License for personal and commercial use. Keep the license notice inside the file.
Is it scary?
No. It is small, cartoon-like pixel art with no gore, suitable for general audiences.
Does the lightning flash a lot?
By itself it flashes once every 16 to 36 seconds, and not at all for visitors who have asked their device to reduce motion. Remove the nextFlash line to switch automatic lightning off.
Can I add my own characters?
Yes. Each figure is a small text picture in the script, and one line places it on the grounds.
Does it need a server or libraries?
No. It is one HTML file that runs in the browser, also offline.