Dark level
Verified against the spelunky.ai port v0.1.10 on .
A dark level is a special level of Spelunky Classic, lit only around the player and a few lights: 1 in 12, at most once an area, and never in the Ice Caves.
A dark level is an ordinary level of its area, built as usual, but drawn in the dark: the screen is black except for the circles that lights cut out of it. The player has a dim light of his own, and a crate of flares waits by the entrance. Generation adds lamps or tiki torches, makes the traps lit kinds that glow, and hangs Scarabs, which live only here.
Generation
#The roll
#Each level makes the roll, 1 in 12, after its rooms are built. A level can't be dark if it's level 1, Olmec's Lair (level 16) or in the Ice Caves, if its area has had a dark level already, or if the level before it was finished too fast [2] [3]. The area's dark level is forgotten on its first level (1, 5, 9 and 13), so each of the three areas that can be dark has one at most [4].
"Too fast" is the screen between levels' doing: it reads the finished level's time and turns dark levels off for the next one if the seconds past the whole minute are 20 or fewer, the code's comment calling it a speed run [5]. So a level that took 1:05 rules out a dark level as one that took 0:05 does, and one that took 0:21 doesn't. A new game starts with dark levels off, so the first level after the title screen is never dark, the shortcuts' levels 5, 9 and 13 included [6] [7].
The Black Market is never dark: it's lit again after the roll. But a roll that comes up there still counts as the Jungle's dark level, so no later Jungle level is dark [8] [7] [9]. Any other special level can be dark too: a snake pit, a flooded level, a graveyard level, the City of Gold.
A dark level opens with "I CAN'T SEE A THING!" and "I'D BETTER USE THESE FLARES!", or, if the player wears the Hedjet, "THE HEDJET SHINES BRIGHTLY." [10]. A special level's own message comes after it [11]. In the clip, level 2 of the Mines loads dark: the crate of flares glows beside the entrance, and the player climbs down through the dark by his own small light [12].
The darkness
#Each step, the screen is filled with black and then lit in circles [13]:
| Light | Radius | |
|---|---|---|
| The player | 96 pixels less 64 times the darkness (below): about 38 pixels at the darkest | [14] |
| A flare, the crate of flares, a lamp (hanging or carried), an explosion | 96 pixels | [15] [16] |
| The Ghost | 64 pixels | [17] |
| A lit trap, a tiki torch, a Fire Frog, Lava | 32 pixels | [18] [19] |
| A Scarab | 16 pixels | [20] |
The darkness is the distance from the player to the nearest light (a flare, or within 200 pixels a lamp, the crate, lava or an explosion, a lit trap or a tiki torch counting as 48 pixels farther than it is), divided by 160, and 0.9 at most. So the player's own light grows as he nears a light, and is at its widest, 96 pixels, beside one [21] [22]. With the Hedjet the darkness is 0, and his light is always 96 pixels (Hedjet).
Made dark later
#Defiling one of Kali's altars a third time, and every time after, makes the level dark, with a Ghost if there's none yet; if it's dark already and has a Ghost, Kali punishes the player another way [23]. That can darken any level with an altar, the Ice Caves' too, but it comes after generation, so such a level has none of the lights, lit traps or Scarabs below.
Inhabitants
#The dark level's own monster is the Scarab, made only on a dark level, in the spots where monsters hang under a block (two open tiles below) [24] [25] [26]:
| Monster | Area | Chance | |
|---|---|---|---|
| Scarab | The Mines | 1 in 40, once the Giant Spider's and a lamp's 1 in 60 fail, before a Bat's | [27] |
| Scarab | The Jungle | 1 in 40, before a Bat's | [28] |
| Scarab | The Temple | 1 in 40 | [29] |
The rest are the area's usual monsters. A Scarab is treasure that flits about, and glows; in the clip, on a dark Temple level, the player drops onto one and collects it [30].
Hazards
#The traps are the area's, but made as lit kinds that glow [31] [32] [33] [34] [35]:
-
Lit Arrow Traps in the Mines and the Temple, which fire as the plain ones do. In the clip, one fires into the player as he drops down a ladder through its line, and a bomb destroys it [36].
Lit arrow trap. On a dark level, a lit arrow trap fires as the player drops down a ladder through its line; the arrow takes two hearts. He walks back, lays a bomb beside the trap and climbs away, and the blast destroys it. -
Lit Spear Traps in the Jungle and the Temple.
-
Lit Smash Traps in the Temple. The lit kind isn't a smash trap to the player's code: its touch takes no hearts and throws him nowhere, and it kills only by sliding on into him until he's crushed [7] [37].
Items and shops
#- A crate of flares by the entrance, on its left if there's room, else on its right, else on it [38]. It's carried like a heavy item, and opened by pressing up and the attack key over it, which throws out three flares [39] [40]. Flares and the crate go out in water [41] [42].
- Lamps, in the Mines, hanging under a block, 1 in 60 where a monster could hang [43]. When the block above it is destroyed, a lamp falls as one the player can carry [44].
- Tiki torches, in the Jungle, on 1 in 20 of the ground's spots for a Spear Trap, before the trap's roll [45].
Shops and treasure are the area's. Every shop has a lamp, which lights it on a dark level [46] [47] [48].
Trivia
#- Messages stay on screen twice as long on a dark level: the screen's drawing counts their time down each step, and the level's own drawing, which shows them only when the level is lit, counts it down again, so a message lasts 200 steps in the dark and 100 in the light [49] [50] [7] [51]. So a special level's second message, 209 steps after the first, follows it 9 steps after it's gone in the dark, where in the light the screen is clear for 109 [10] [52] [53].
- The light around the player is tinted blue the darker it is: its colour is full blue, with red and green falling as the darkness grows [54].
- The level's own drawing code once darkened the screen with a rectangle, and is commented out [55].
- Two commented-out lines sit in the roll: an older version of it with a chance of 1 in 1, and one that would have put a flare at the player's feet on every dark level [56].
- Level generation draws the lamp's and the Scarab's rolls from the random numbers on lit levels too, as
GameMaker 8 evaluates both sides of an
and[57] [7].
FAQ
#- How do you get a dark level in Spelunky Classic?
By chance: each level of the Mines, the Jungle and the Temple after the first has a 1 in 12 chance, once in an area at most. The roll only counts if the level before it took more than 20 seconds past a whole minute on its clock, so a fast level is never followed by a dark one.
- How do you see on a dark level in Spelunky Classic?
By light: the player carries a small light of his own, and a crate of three flares waits by the entrance. Lamps, glowing traps, tiki torches, lava, explosions and Scarabs light the cave around them, and wearing the Hedjet widens the player's light to a flare's.
- Are there dark levels in the Ice Caves in Spelunky Classic?
No. Level generation never makes an Ice Caves level dark, nor level 1, Olmec's Lair or the Black Market. Defiling one of Kali's altars too often can darken any level, after it's made.
- What is special about a dark level in Spelunky Classic?
Only dark levels have Scarabs, glowing beetles worth money, and their traps are lit kinds that glow. The level opens with "I CAN'T SEE A THING! I'D BETTER USE THESE FLARES!".
Gallery
#See also
#- Found here
References
#scripts/scrInitLevel.gml:169scripts/scrInitLevel.gml:167-174scripts/scrClearGlobals.gml:54scripts/scrInitLevel.gml:31-37objects/oTransition/draw.gml:89-102scripts/scrClearGlobals.gml:51- Quirk 1 (docs/quirks.md)
scripts/scrInitLevel.gml:176- Replay
fidelity/replays/jungle-seed-9-market-dark-roll.txt objects/oPlayer1/alarm_0.gml:5-13objects/oPlayer1/alarm_1.gml:1-48- Clip dark-level/arrival
objects/oScreen/step_begin.gml:148-240objects/oScreen/step_begin.gml:178objects/oScreen/step_begin.gml:179-194objects/oScreen/step_begin.gml:219-222objects/oScreen/step_begin.gml:231-234objects/oScreen/step_begin.gml:195-218objects/oScreen/step_begin.gml:223-226objects/oScreen/step_begin.gml:227-230objects/oLevel/step.gml:110-137objects/oPlayer1/step.gml:73-136objects/oSacAltarLeft/destroy.gml:39-58scripts/scrEntityGen.gml:47-62scripts/scrEntityGen.gml:264-271scripts/scrEntityGen.gml:445-450scripts/scrEntityGen.gml:52-63scripts/scrEntityGen.gml:271-272scripts/scrEntityGen.gml:449- Clip scarab/collect
scripts/scrEntityGen.gml:155-168scripts/scrEntityGen.gml:247-249scripts/scrEntityGen.gml:436-437scripts/scrEntityGen.gml:467-471scripts/scrEntityGen.gml:508-521- Clip arrow-trap/dark
- Clip smash-trap/lit
scripts/scrEntityGen.gml:527-545objects/oFlareCrate/create.gml:1-12objects/oPlayer1/step.gml:649-669objects/oFlare/step.gml:4-17objects/oFlareCrate/step.gml:3-18scripts/scrEntityGen.gml:61objects/oSolid/destroy.gml:29-33scripts/scrEntityGen.gml:235-238scripts/scrRoomGen.gml:173-204scripts/scrRoomGen.gml:427-431objects/oScreen/step_begin.gml:187-190objects/oScreen/step_begin.gml:243-259objects/oLevel/draw.gml:11-27- Replay
fidelity/replays/mines-seed-2.txt - Replay
fidelity/replays/jungle-seed-10-dark-graveyard-lake.txt - Replay
fidelity/replays/city-of-gold-seed-9-sacrifice-pit.txt objects/oScreen/step_begin.gml:155objects/oLevel/draw.gml:1-10scripts/scrInitLevel.gml:168-173scripts/scrEntityGen.gml:61-62