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
#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
#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
#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 start | Level 5's shortcut | Level 9's | Level 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 k | Jungle block 2, water w, vine v, vine top t, tree trunk |, tree top x, leaves ), branch q | Ice Caves rock 3, falling platform d, ice i | Temple 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 Y | Hawkman 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 size | 40 by 32 tiles | [57] |
| A label or message, at most | 38 characters | [58] |
| Starting hearts, from the menu | 1 to 99 | [59] |
| Starting bombs and ropes, from the menu | 0 to 99 | [60] |
| Levels a page in the menu | 10 | [61] |
| The view's scrolling | 4 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].
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
- Tunnel Man
- Endings
- Controls
- Bombs and ropes
- Skeletons facing right
- The Yeti King's harmless touch in custom levels
- Tunnel Man shortcuts
- Versions
References
#objects/oLoadLevel/create.gml:5objects/oTitle/keypress_F2.gml:1-3objects/oLevelEditor/keypress_anykey.gml:1-124objects/oLevelEditor/create.gml:20-26objects/oLevelEditor/keypress_escape.gml:12-16- Quirk 5 (docs/quirks.md)
- Replay
fidelity/replays/editor-build-test-save.txt objects/oLevelEditor/step.gml:18-73objects/oLevelEditor/keypress_1.gml:1-11objects/oLevelEditor/keypress_S.gml:1-7objects/oLevelEditor/mouse_wheel_up.gml:1-7objects/oLevelEditor/step.gml:4-12objects/oLevelEditor/draw.gml:72-85- Clip level-editor/build
objects/oLevelEditor/keypress_1.gml:5-8objects/oLevelEditor/keypress_2.gml:5-8objects/oLevelEditor/keypress_3.gml:5-8objects/oLevelEditor/keypress_4.gml:5scripts/scrLoadLevel.gml:96-133objects/oLevelEditor/keypress_anykey.gml:125-199objects/oLevelEditor/keypress_escape.gml:5-11objects/oPlayer1/step.gml:881-888scripts/scrLoadLevel.gml:162-183objects/oEditButton/mouse_left_release.gml:1-8objects/oLevelEditor/keypress_anykey.gml:201-322scripts/startMusic.gml:1-35scripts/scrLoadLevel.gml:138-149objects/oTestButton/mouse_left_release.gml:1-8objects/oLevelEditor/step.gml:13-17scripts/scrTestLevel.gml:24-95objects/oPlayer1/other_animation_end.gml:58-62objects/oPlayer1/step.gml:922-926objects/oGame/draw.gml:28-44objects/oLevelEditor/create.gml:138-283objects/oLevelEditor/keypress_escape.gml:1-4objects/oLevelEditor/draw.gml:46-71objects/oLevelEditor/keypress_Y.gml:1-75objects/oLevelEditor/keypress_N.gml:1-11objects/oNewButton/mouse_left_release.gml:1-8objects/oLevelEditor/keypress_Y.gml:8-62objects/oTitle/keypress_F3.gml:1-8objects/oLoadLevel/create.gml:42-82objects/oLoadLevel/draw.gml:1-26objects/oLoadLevel/keypress_anykey.gml:1-25scripts/scrLoadLevel.gml:152-160- Clip level-editor/load-level
objects/oPlayer1/step.gml:927-932objects/oGame/draw.gml:35-39objects/oTransition/draw.gml:75objects/oTransition/step.gml:19objects/oLoadLevel/create.gml:84-87scripts/scrLoadLevel.gml:24- Clip level-editor/chain
scripts/scrLoadLevel.gml:154-157objects/oLevelEditor/create.gml:42-136scripts/scrCreateTileObj.gml:22-416objects/oLevelEditor/create.gml:29-35objects/oLevelEditor/keypress_anykey.gml:180scripts/scrLoadLevel.gml:140-142scripts/scrLoadLevel.gml:143-148objects/oLoadLevel/create.gml:78objects/oLevelEditor/step.gml:7- Clip level-editor/every-tile
- Replay
fidelity/replays/editor-test-hud-caps.txt - Replay
fidelity/replays/editor-live-native.txt - Quirk 1 (docs/quirks.md)
- Replay
fidelity/replays/editor-sign-no-exit.txt - Replay
fidelity/replays/editor-doors-signs-new.txt
Source code
What links here
#- Alien
- Alien Boss
- Ankh
- Arrow Trap
- Bat
- Big Emerald
- Big Ruby
- Big Sapphire
- Bomb
- Bombs and ropes
- Bow
- Cape
- Caveman
- Chest
- Climbing Gloves
- Compass
- Controls
- Crate
- Crystal Skull
- Dead Fish
- Diamond
- Emerald
- Fire Frog
- Frog
- Ghost timer
- Giant Spider
- Gold Bar
- Gold Bars
- Gold Chunk
- Gold Nugget
- Golden Idol
- Hawkman
- Health
- Hedjet
- Jar
- Jetpack
- Kapala
- Lava
- Level generation
- Machete
- Magma Man
- Mantrap
- Mattock
- Megamouth
- Monkey
- Olmec
- Parachute
- Paste
- Piranha
- Pistol
- Pitcher's Mitt
- Rock
- Rope
- Ruby
- Sapphire
- Sceptre
- Shotgun
- Skeleton
- Skull
- Smash Trap
- Snake
- Spear Trap
- Spectacles
- Spider
- Spike Shoes
- Spikes
- Spring Shoes
- Spring Trap
- Teleporter
- Tomb Lord
- Trap Block
- Tunnel Man shortcuts
- Udjat Eye
- UFO
- Vampire
- Versions
- Web
- Web Cannon
- Yeti
- Yeti King
- Zombie