Gnome dig, its rules in Hazel
Hazel activities › One-player games · source on GitHub · hazeljs on npmYou are a gnome with a lantern, digging down through the ground for the gems: the arrow keys (or W A S D), a swipe, or the four buttons, held to keep going. The monsters follow your tunnels, and now and then burrow. Dig under a boulder and it wobbles, then falls: it squashes a monster below it (200 points), or you. Your lantern (💡, or Enter or F; from the fourth level, find it first: it glows in the earth near the top) stuns every monster within three cells of you, for three seconds, and is ready again a second later (it glows on you when it is): walk into a stunned one to catch it (100 points). Take every gem for the next level: a party, until you tap, click or press a key. The ghosts never come into the sunlight: let it in on one and it runs, or burns up (150 points). On some levels a love shooter 💘 lies in the earth: with it, the ghosts near you run away, and its love blast (💘 or L, every two seconds) sends hearts straight ahead along the tunnel: every ghost they reach is won over for good (200 points). Deeper in the game, grey bedrock that nothing digs, often over a ghost's pocket, keeps the sun off it. Mind the animals: dig out a mole, a rabbit or a badger and it drops, and a boulder falling on one loses the level. Under the water, boulders and animals fall slowly. From the second level on, some levels have ground water: under it you hold your breath (the bubbles over your head), until you find the level's diving gear 🤿, which lies under the water, just reachable on one breath if you dig straight down to it. Above, trees, bushes, ferns, flowers and mushrooms; below, the trees' roots, the mushrooms' mycelium, an ants' nest, the rabbit's burrow, the mole's run, the badger's sett, worms, grubs and beetles, a new garden of them each level, all made by Hazel too (dig/rules/Scene.hz) from the level's seed. Each step, and the robot that plays it for you, are Hazel (dig/rules/Dig.hz). ⏸ or the space bar pauses.
This app needs JavaScript, and a page served over http (python3 -m http.server, then localhost).
The vocabulary the module sees (dig/rules/preamble.hz). The listings are text, highlighted, until Edit in Hazel opens each in Hazel's own editor; an edit changes the next step.
loading preamble.hz…
loading Dig.hz…
loading Scene.hz…
hazeljs-examples · versions · Apache 2.0 (code), CC BY 4.0 (words, the icon) · by Matthew Hammer · an example for hazeljs