Darkness is usually used as atmosphere, which wastes it. Light can do three completely different mechanical jobs, and the interesting games are the ones that make it do more than one at once.
Light as a vision limit
The simplest use: you can see a radius and nothing else. Dungeon Tunnel does this, with a lit circle around the wizard and black beyond it.
What this buys is not difficulty so much as a different kind of difficulty. A maze you can see entirely is a route-planning problem solved once at the start; a maze you can see a radius of is a memory problem solved continuously.
The radius also shrinks as the lantern burns - from about 250 pixels at full to 120 at the end - which means running low is felt before it is read. That is better design than a number going down, because the player experiences the consequence rather than being told about it.
Implementation matters here too. A vision limit drawn as a hard circle looks cheap; drawn as a radial gradient with the corners filled it looks like light.
Light as a safe zone
The second use is entirely different: light as territory that enemies will not enter.
Goblin Escape does this. Goblins inside a torch's radius turn and run out of it by the shortest route, then resume the chase. The light is not damaging them and it is not slowing them - it is a wall they will not cross.
That turns light into a positional resource. Where you stand matters, where you throw a torch matters, and the edge of a light circle becomes a place with real meaning.
The important implementation detail is that the edge must be hard. A soft gradient looks better and makes the boundary ambiguous, so Goblin Escape draws a visible ring at the exact radius where goblins stop - because 'where they will not go' has to be a line rather than a feeling.
Ad space reserved. See README.md to connect an ad unit.
Light as a clock
The third use: light burns down, and when it runs out something changes.
Dungeon Tunnel's lantern ends the run when it expires, which makes it a conventional timer with a visual presentation. Goblin Escape's torch does not end the run - it simply makes everything much worse, removing your safe ground and your treasure multiplier in one moment.
The second version is the better mechanic, because the player gets to feel it happening and has a chance to respond. A relight appears whenever the torch drops below a third, always at a distance, so recovering the light is a run across open ground with everything chasing - the most dangerous thirty seconds in the game and the only way out of its worst situation.
Combining the three is where it gets interesting
Goblin Escape uses all three at once, and the tension comes from the fact that they conflict.
The torch is your vision, your safety and your clock. Standing in the light is safe, and it burns the light. Throwing the torch buys you a corridor through a crowd and leaves you unlit. Collecting inside the light doubles the value and requires you to be in the place that is running out.
Every one of those is a genuine decision, and all of them are the same resource. That is a much better design than three separate meters, because a player can hold one thing in their head and it is always relevant.
How darkness is actually drawn
Worth a note because the technique is simple and the effect is not obvious.
The night is drawn as a single filled rectangle over the whole scene, and then the light is punched out of it with one composite operation that removes rather than adds. Each light source is a radial gradient in that removal pass.
That means the cost does not rise with the number of light sources in any meaningful way, and it means overlapping lights combine correctly rather than stacking into a bright patch.
The alternative - drawing light on top - produces a washed-out glow rather than a hole in the dark, and it cannot make anything genuinely invisible.
Playing well in the dark
Four habits.
Explore while the light is good and execute when it is not. Finding the third key at ten seconds of lantern is much harder than at thirty, so the order of operations matters more than the speed.
Track junctions rather than corridors, because a small radius makes corridor memory useless and junction memory sufficient.
In Goblin Escape, go for the relight before the torch is out rather than after. Crossing open ground in the dark with six pursuers is a different problem from crossing it with a torch.
And throw the torch to escape, not to score. It plants a safe circle where it lands and leaves you unlit, which is a trade worth making when cornered and almost never otherwise.
Key takeaways
- Light does three jobs: it limits vision, it defines safe territory, and it runs down as a clock.
- A shrinking vision radius lets a player feel a resource running out rather than reading about it.
- A safe-zone edge must be a hard line, not a gradient, because 'where they will not go' has to be unambiguous.
- A clock that makes things worse is better than one that ends the run, because the player gets to respond.
- Combining all three into one resource is stronger than three separate meters.
- Explore while the light is good; execute when it is not.
Frequently asked questions
Why does the visible area shrink in Dungeon Tunnel?
Because the lantern is burning down. The radius falls from about 250 pixels to 120, which lets you feel the resource running out rather than just reading a number.
Do goblins take damage from torchlight?
No. They simply will not enter it - they turn and leave by the shortest route, then resume the chase. The light is a wall rather than a weapon.
What happens when my torch goes out in Goblin Escape?
The run continues but gets much worse: no safe ground anywhere and no doubled treasure. A relight appears at a distance whenever the torch drops below a third.
Should I throw my torch?
To escape a crowd, yes - it plants a burning circle goblins will not cross. To score, no, because it leaves you unlit and unlit treasure is worth half.
How is the darkness drawn?
As one filled layer with the light punched out of it in a single removal pass, which is why overlapping lights combine cleanly rather than stacking into a bright patch.