Aspect ratio calculator / Pixel Halloween Castle

Pixel Halloween Castle

A rotating haunted castle with monsters, ghosts and lightning. Free to download, copy or embed.

2027 series · All animations

Free to use, change and share under the MIT License. One file, no libraries, no sign-up.

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

CharacterWhereDetail
The vampire countOn the path in front of the gateBlack cape with a high red collar and red eyes
ZombiesIn the graveyard, three of themGreen skin, arms out, torn clothes
SkeletonsTwo, beside the wallsWhite bones against the dark grass
GhostsSix, circling the towersThey always turn to face you; the Ghosts button hides them
The figure in the top hatUnder the green street lampA Victorian silhouette in a long coat, in the spirit of gaslight mysteries
A witchCrosses the sky every 30 secondsOn a broomstick, passing the moon
BatsSeven, in front of the moonWings flap in two frames
Jack-o’-lanternsSix pumpkins around the groundsThe carved faces glow and flicker
Graves and dead treesAround the backTombstones, 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

MIT License. You can use it, change it, share it and sell things made with it, for personal or commercial work. The one condition: keep the copyright and license notice that is at the top of the file.
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 changeWhereExample
Draw your own monsterthe text pictures COUNT, ZOMBIE, SKEL, RIPPER: each letter is one coloured block'..kfffk..'
Where a figure standsthe plant(...) lines: picture, colours, angle, distance from the centreplant(ZOMBIE, ZC, 2.3, 33, 2)
Pumpkinsthe pumpkin(...) line: angle, distance, sizepumpkin(3.1, 31, 4)
Number of ghosts and batsthe loops that fill GHOSTS and BATSg < 6, b < 7
How often lightning strikesthe line that sets nextFlash16 + Math.random() * 20
How often the witch fliesWGAP and WFLYWFLY = 9, WGAP = 30
Castle coloursthe pal('stone'...) and pal('roof'...) linespal('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.

Related tools and guides