SpelunkyFan wiki

Level editor

Verified against the spelunky.ai port v0.1.10 on .

The level editor in Spelunky Classic, opened with F2 on the title screen, builds custom levels of 40 by 32 tiles, which F3 then lists and plays.

A level is a grid of tiles, each a character in a text file in the game's levels folder: blocks, ladders, water, monsters, traps, treasure and items, an entrance and exits, and signs with messages. The editor places them with the mouse, gives the level its starting hearts, bombs and ropes and its music, plays it to test it, and saves it. A custom level plays like a level of the game, and its exits can lead to more custom levels; none of it counts for the high scores (Scoring) [1].

How it works

#

Opening a level

#

F2 on the title screen opens the editor, which asks EDIT LEVEL: for a name. Enter opens the saved level of that name, if there is one, and otherwise starts an empty level [2] [3]. An empty level's author is ANONYMOUS, its music CAVE, its starting hearts, bombs and ropes 4 each and its next level NONE [4]. Escape at the prompt goes back to the title [5]. Every key types twice there, as in every text the editor asks for: GO comes out GGOO [6] [7].

Placing tiles

#
Building and testing a level. In the level editor, the player names a level GG, places an entrance, an exit and a floor of bricks, then a snake, spikes and gold bars, erasing one. Edit Info sets the music, the bombs and the next level; Test plays the level, where the player walks over the gold bar to the exit, and leaving it returns to the editor.

The left mouse button places the chosen tile in the square under the cursor, and the right button erases what's there [8]. The keys 1 to 4 choose a group (blocks, monsters, traps or items) and the tile shown at the cursor, and A and S or the mouse wheel step back and forward through it, going round at its ends [9] [10] [11]. The level is bigger than the screen: the view scrolls 4 pixels a step while the cursor is within 16 pixels of its edge [12], and the corner shows the level's name, its author and the cursor's position [13]. In the clip the player builds a floor of bricks with an entrance and an exit, adds a snake, spikes and gold bars, erases one of them, sets the level's info and tests it [14].

The editor's groups start with the Mines' tiles. Paying the Tunnel Man's shortcut to level 5 adds the Jungle's blocks, monsters and traps, the shortcut to level 9 the Ice Caves', and the shortcut to level 13 the Temple's; every item is there from the start [15] [16] [17] [18]. The list is in Numbers. Only the editor checks: a level plays with whatever tiles it has [19].

Doors and signs

#

E over an exit or an entrance asks for its LABEL, and over a sign for its MESSAGE, up to 38 characters (each key types two); Enter sets it and Escape leaves it as it was [20] [21]. An exit's label is the level it leads to, in place of the level's next level [22]. An entrance's is the level the player must come from to start there; coming from anywhere else, he starts at one of the entrances, or in the top left corner if there's none [23].

The level's info

#

The EDIT INFO button asks for the LEVEL NAME, the AUTHOR, the MUSIC, the START LIFE, START BOMBS and START ROPE, and the NEXT LEVEL, each ended with Enter [24] [25]. The music is CAVE, LUSH, ICE, TEMPLE or BOSS, the music of the Mines, the Jungle, the Ice Caves, the Temple or Olmec's Lair; anything else plays the Mines' [26]. Played from the menu, the starting hearts are 1 to 99 and the bombs and ropes 0 to 99, whatever was typed [27]. The next level is the one its exits lead to; with no level of that name, leaving ends the chain (Chains of levels).

Testing

#

The TEST button, or the attack key, saves the level to a file of its own, test.tmp, and plays it, with the starting hearts, bombs and ropes as they were typed [28] [29] [30]. Taking the exit, or dying and pressing attack (PRESS X TO EDIT LEVEL.), goes back to the editor, which reopens the level from test.tmp [31] [32] [33] [34].

Saving

#

Escape asks SAVE LEVEL? (Y/N), warning NO ENTRANCE! and NO EXIT! when the level hasn't one [35] [36]. Y saves the level as its name, in lower case, with .lvl, and goes back to the title; N goes back without saving; Escape goes back to editing [37] [38] [21]. The NEW button asks the same, then starts again from the name prompt [39].

The file is text: 32 lines of 40 tile characters, 0 for an empty square, then the author, the music, the starting hearts, bombs and ropes and the next level, a line each, then how many exits and entrances are named and their names, in the order they're in the grid, then the same for the signs' messages [40]. Any text editor can write one.

Playing custom levels

#
The custom levels menu. The menu F3 opens lists the levels in the levels folder, ten to a page. The player clicks a level, pages down to the second page and back, picks ALPHA, and presses Load; the level starts and the player walks right.

F3 on the title screen opens LOAD LEVEL:, which lists the levels in the levels folder, ten to a page, but not those whose names start with ! [41] [42] [43]. A click picks a level, or the name can be typed, each key twice as in the editor [6]; Enter or the LOAD button loads it, and a name with no level shows NO SUCH LEVEL EXISTS! [44] [45]. Escape goes back to the title. In the clip the player pages through twelve levels and loads ALPHA [46].

A custom level plays as a level of the game does, with its own music and starting hearts, bombs and ropes. Dying there and pressing attack goes back to the menu (PRESS X TO LOAD ANOTHER LEVEL.) [47] [48].

Chains of levels

#
A chain of custom levels. After the first level's tally, its next level, SECOND, loads, and the player starts at the entrance named for the level he left. He takes the first exit, named THIRD, and after SECOND COMPLETED! the level THIRD loads in place of SECOND's own next level.

Leaving a custom level by its exit shows the screen between levels, NAME COMPLETED!, then loads the exit's level, or the level's next level if the exit has no label, and the player keeps his hearts, bombs and ropes [49] [50] [51] [52]. In the clip the player starts SECOND at the entrance named for the level he left, and its first exit takes him to THIRD in place of SECOND's own next level [53]. When the next level doesn't exist, the chain ends in the custom levels' own ending (Endings) [54].

Numbers

#

The tiles, by group, with their characters in the file. Each area's are added as the Tunnel Man's shortcut to it is paid [55]:

Group (key)From the startLevel 5's shortcutLevel 9'sLevel 13's
Blocks (1)Entrance @, exit X, sign I, Mines brick 1, ladder L, ladder top P, push block B, Web &, Rock r, Jar j, bones and Skull kJungle block 2, water w, vine v, vine top t, tree trunk |, tree top x, leaves ), branch qIce Caves rock 3, falling platform d, ice iTemple block 4, Lava l
Monsters (2)Bat b, Snake n, Spider s, Giant Spider S, Skeleton K, Caveman h, Shopkeeper !Frog f, Fire Frog F, Zombie z, Vampire A, Mantrap M, Monkey m, Piranha p, Megamouth {Alien a, UFO U, Alien Boss E, Yeti y, Yeti King YHawkman H, Tomb Lord T
Traps (3)Spikes ^, Arrow Trap facing left < and right >Spear Trap in a ceiling ] and a floor [Spring Trap _Smash Trap +
Items (4)Gold Bar $, Gold Bars *, Golden Idol #, Crystal Skull O, Big Emerald 5, Big Sapphire 6, Big Ruby 7, Diamond 8, Chest c, Crate C, Damsel D, bomb bag ., bomb box :, Paste u, rope pile R, Parachute `, Compass o, Machete /, Spring Shoes ~, Spike Shoes V, Bow }, Pistol -, Shotgun =, Web Cannon W, Spectacles %, Climbing Gloves G, Pitcher's Mitt g, Teleporter ?, Mattock (, Cape \, Jetpack J

What each character makes in a level is scrCreateTileObj's [56].

Value
A level's size40 by 32 tiles[57]
A label or message, at most38 characters[58]
Starting hearts, from the menu1 to 99[59]
Starting bombs and ropes, from the menu0 to 99[60]
Levels a page in the menu10[61]
The view's scrolling4 pixels per step[62]

Examples

#
  • A level with every tile the editor offers, opened in the editor and tested [63], in the clip below.
  • A test with 1,111 bombs typed in: the player's step caps them to 99 the step after [64].
  • A level made in the native app with keys held down, saved, then loaded from the menu and played [65].
Every tile. A saved level holding every tile the level editor offers, five rows of them on brick floors, opens in the editor: blocks, ladders, trees and vines, water and lava, monsters, traps, treasure and items. Test plays it, and the monsters, traps and items come alive as the player walks in.

Quirks

#
  • The info prompt skips three fields. Each Enter moves the prompt two fields on, so the author, the starting hearts and the starting ropes can't be changed [66] [7]. The same doubling types the E that opens a label or message into it.
  • The test doesn't limit the starting values that the menu limits to 99 [66] [64].
  • A saved level without exits loses its signs' messages [66] [67].
  • Escape twice adds a second set of buttons [66] [68].
  • In custom levels, a Skeleton walks right wherever the player is (Skeletons facing right), the Yeti King's touch takes no hearts (The Yeti King's harmless touch in custom levels), and two Damsels saved on one level give one heart [66].

FAQ

#
How do you open the level editor in Spelunky Classic?

Press F2 on the title screen. The editor asks for a level's name: a saved level of that name opens to be edited, and any other name starts an empty level.

How do you play custom levels in Spelunky Classic?

Press F3 on the title screen. A menu lists the levels in the game's levels folder, ten to a page, but not those whose names start with an exclamation mark. Click one, or type its name (each key types twice, as in the editor), then press Enter or the Load button.

Why can't the level editor place every tile at first?

The Jungle's, the Ice Caves' and the Temple's blocks, monsters and traps are added as the Tunnel Man's shortcuts to levels 5, 9 and 13 are paid. Every item is there from the start, and the menu plays any level, whatever its tiles.

Do custom levels count for the high scores in Spelunky Classic?

No. Dying in a custom level, or reaching the end of a chain of them, leaves the high scores as they were.

How do you link custom levels together?

Give a level a next level in its info, or press E over an exit and type a level's name. Leaving by that exit loads the named level, with the player's hearts, bombs and ropes; with no such level, the chain ends.

See also

#
Related

References

#
  1. objects/oLoadLevel/create.gml:5
  2. objects/oTitle/keypress_F2.gml:1-3
  3. objects/oLevelEditor/keypress_anykey.gml:1-124
  4. objects/oLevelEditor/create.gml:20-26
  5. objects/oLevelEditor/keypress_escape.gml:12-16
  6. Quirk 5 (docs/quirks.md)
  7. Replay fidelity/replays/editor-build-test-save.txt
  8. objects/oLevelEditor/step.gml:18-73
  9. objects/oLevelEditor/keypress_1.gml:1-11
  10. objects/oLevelEditor/keypress_S.gml:1-7
  11. objects/oLevelEditor/mouse_wheel_up.gml:1-7
  12. objects/oLevelEditor/step.gml:4-12
  13. objects/oLevelEditor/draw.gml:72-85
  14. Clip level-editor/build
  15. objects/oLevelEditor/keypress_1.gml:5-8
  16. objects/oLevelEditor/keypress_2.gml:5-8
  17. objects/oLevelEditor/keypress_3.gml:5-8
  18. objects/oLevelEditor/keypress_4.gml:5
  19. scripts/scrLoadLevel.gml:96-133
  20. objects/oLevelEditor/keypress_anykey.gml:125-199
  21. objects/oLevelEditor/keypress_escape.gml:5-11
  22. objects/oPlayer1/step.gml:881-888
  23. scripts/scrLoadLevel.gml:162-183
  24. objects/oEditButton/mouse_left_release.gml:1-8
  25. objects/oLevelEditor/keypress_anykey.gml:201-322
  26. scripts/startMusic.gml:1-35
  27. scripts/scrLoadLevel.gml:138-149
  28. objects/oTestButton/mouse_left_release.gml:1-8
  29. objects/oLevelEditor/step.gml:13-17
  30. scripts/scrTestLevel.gml:24-95
  31. objects/oPlayer1/other_animation_end.gml:58-62
  32. objects/oPlayer1/step.gml:922-926
  33. objects/oGame/draw.gml:28-44
  34. objects/oLevelEditor/create.gml:138-283
  35. objects/oLevelEditor/keypress_escape.gml:1-4
  36. objects/oLevelEditor/draw.gml:46-71
  37. objects/oLevelEditor/keypress_Y.gml:1-75
  38. objects/oLevelEditor/keypress_N.gml:1-11
  39. objects/oNewButton/mouse_left_release.gml:1-8
  40. objects/oLevelEditor/keypress_Y.gml:8-62
  41. objects/oTitle/keypress_F3.gml:1-8
  42. objects/oLoadLevel/create.gml:42-82
  43. objects/oLoadLevel/draw.gml:1-26
  44. objects/oLoadLevel/keypress_anykey.gml:1-25
  45. scripts/scrLoadLevel.gml:152-160
  46. Clip level-editor/load-level
  47. objects/oPlayer1/step.gml:927-932
  48. objects/oGame/draw.gml:35-39
  49. objects/oTransition/draw.gml:75
  50. objects/oTransition/step.gml:19
  51. objects/oLoadLevel/create.gml:84-87
  52. scripts/scrLoadLevel.gml:24
  53. Clip level-editor/chain
  54. scripts/scrLoadLevel.gml:154-157
  55. objects/oLevelEditor/create.gml:42-136
  56. scripts/scrCreateTileObj.gml:22-416
  57. objects/oLevelEditor/create.gml:29-35
  58. objects/oLevelEditor/keypress_anykey.gml:180
  59. scripts/scrLoadLevel.gml:140-142
  60. scripts/scrLoadLevel.gml:143-148
  61. objects/oLoadLevel/create.gml:78
  62. objects/oLevelEditor/step.gml:7
  63. Clip level-editor/every-tile
  64. Replay fidelity/replays/editor-test-hud-caps.txt
  65. Replay fidelity/replays/editor-live-native.txt
  66. Quirk 1 (docs/quirks.md)
  67. Replay fidelity/replays/editor-sign-no-exit.txt
  68. Replay fidelity/replays/editor-doors-signs-new.txt

Source code

#