SpelunkyFan wiki

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].

A dark level. Level 2 of the Mines loads dark, with the message "I CAN'T SEE A THING! I'D BETTER USE THESE FLARES!" A crate of flares glows by the entrance, and the player climbs down through the dark by the small light around him.

The darkness

#

Each step, the screen is filled with black and then lit in circles [13]:

LightRadius
The player96 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 explosion96 pixels[15] [16]
The Ghost64 pixels[17]
A lit trap, a tiki torch, a Fire Frog, Lava32 pixels[18] [19]
A Scarab16 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]:

MonsterAreaChance
ScarabThe Mines1 in 40, once the Giant Spider's and a lamp's 1 in 60 fail, before a Bat's[27]
ScarabThe Jungle1 in 40, before a Bat's[28]
ScarabThe Temple1 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].

Scarab. On a dark Temple level, the player drops down onto a glowing scarab and collects it: his money starts counting up by $12,000.

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!".

#
Lit smash trap. On a dark Temple level, the player jumps into the line of a lit smash trap, which slides at him and crushes him.

See also

#

References

#
  1. scripts/scrInitLevel.gml:169
  2. scripts/scrInitLevel.gml:167-174
  3. scripts/scrClearGlobals.gml:54
  4. scripts/scrInitLevel.gml:31-37
  5. objects/oTransition/draw.gml:89-102
  6. scripts/scrClearGlobals.gml:51
  7. Quirk 1 (docs/quirks.md)
  8. scripts/scrInitLevel.gml:176
  9. Replay fidelity/replays/jungle-seed-9-market-dark-roll.txt
  10. objects/oPlayer1/alarm_0.gml:5-13
  11. objects/oPlayer1/alarm_1.gml:1-48
  12. Clip dark-level/arrival
  13. objects/oScreen/step_begin.gml:148-240
  14. objects/oScreen/step_begin.gml:178
  15. objects/oScreen/step_begin.gml:179-194
  16. objects/oScreen/step_begin.gml:219-222
  17. objects/oScreen/step_begin.gml:231-234
  18. objects/oScreen/step_begin.gml:195-218
  19. objects/oScreen/step_begin.gml:223-226
  20. objects/oScreen/step_begin.gml:227-230
  21. objects/oLevel/step.gml:110-137
  22. objects/oPlayer1/step.gml:73-136
  23. objects/oSacAltarLeft/destroy.gml:39-58
  24. scripts/scrEntityGen.gml:47-62
  25. scripts/scrEntityGen.gml:264-271
  26. scripts/scrEntityGen.gml:445-450
  27. scripts/scrEntityGen.gml:52-63
  28. scripts/scrEntityGen.gml:271-272
  29. scripts/scrEntityGen.gml:449
  30. Clip scarab/collect
  31. scripts/scrEntityGen.gml:155-168
  32. scripts/scrEntityGen.gml:247-249
  33. scripts/scrEntityGen.gml:436-437
  34. scripts/scrEntityGen.gml:467-471
  35. scripts/scrEntityGen.gml:508-521
  36. Clip arrow-trap/dark
  37. Clip smash-trap/lit
  38. scripts/scrEntityGen.gml:527-545
  39. objects/oFlareCrate/create.gml:1-12
  40. objects/oPlayer1/step.gml:649-669
  41. objects/oFlare/step.gml:4-17
  42. objects/oFlareCrate/step.gml:3-18
  43. scripts/scrEntityGen.gml:61
  44. objects/oSolid/destroy.gml:29-33
  45. scripts/scrEntityGen.gml:235-238
  46. scripts/scrRoomGen.gml:173-204
  47. scripts/scrRoomGen.gml:427-431
  48. objects/oScreen/step_begin.gml:187-190
  49. objects/oScreen/step_begin.gml:243-259
  50. objects/oLevel/draw.gml:11-27
  51. Replay fidelity/replays/mines-seed-2.txt
  52. Replay fidelity/replays/jungle-seed-10-dark-graveyard-lake.txt
  53. Replay fidelity/replays/city-of-gold-seed-9-sacrifice-pit.txt
  54. objects/oScreen/step_begin.gml:155
  55. objects/oLevel/draw.gml:1-10
  56. scripts/scrInitLevel.gml:168-173
  57. scripts/scrEntityGen.gml:61-62

Source code

#