SpelunkyWiki

Water

For the liquid that burns, see Lava.

Water is terrain in Spelunky Classic, the pools and lakes of the Jungle, that the player swims in, slowing his falls and breaking any fall's damage.

Water fills pools in the Jungle's rooms and the Black Market's, and the lake of a flooded level. The player swims in it: it slows his falls, ends a fall without its damage, and lets him kick up toward the surface. Some monsters change in it, and some only hunt a player who's in it. Lava is, to the code, a kind of water too, but what it does is its own page's.

How it works

#
Replays it in the game, where you can take over.Replays it in the game, to pause and scrub.
Falling into water. The player walks off a high ledge and falls into a pool, landing unhurt after a fall long enough to hurt him on dry ground; he walks along the bottom, breathing out bubbles, then kicks up to the surface and climbs out onto the bank.

The clip shows a fall into a pool: the player walks off a ledge high above it, and has been falling for more than the 16 steps that would hurt and stun him on landing, when he goes into the water unhurt. He walks along the bottom, breathing out bubbles, then kicks up to the surface and climbs out [3].

Going in

#

When the middle of the player goes into water, it splashes, and from then on he's swimming [4]. A Cape closes in water [5].

Falling and sinking

#

While he's swimming, a fall doesn't count: the time he has been falling goes back to nothing each step, so a fall into water never ends in a long drop's stun or lost hearts, however far he came [6] [7]. Sinking, he keeps only half his falling speed each step, where in the air he keeps all of it; otherwise, with his head under, he keeps 0.9 of his speed up or down [8]. He walks along the bottom as on any floor. While he swims, he breathes out a bubble each time a timer of 20 steps runs out, and the step it's set again on makes that one every 21 steps; a bubble rises until it leaves the water [9] [10].

Swimming up

#

The jump key kicks the player up whenever there's water just above his head, on the bottom or not: a jump's push, as on the ground, and 3 pixels per step more speed upward besides [11] [12] [13]. Without water above his head, the key works as on land: a jump if he's standing on the bottom, no kick if he's afloat with his head out. So a player rises by kicking from just under the surface, and the last kick carries him out onto a bank, as in the clip. Out of the water, he stops swimming [14].

Draining

#

Water stays where it is until a block around it is destroyed. Then, each step, every block of water that has empty space, nothing solid and no water, to its left, to its right or below it goes, dripping, until none does: a pool whose side or floor is blown open drains out through the hole [15] [16] [17]. Water never flows anywhere: it only goes.

Locations

#

Level generation makes water from the Jungle's room tiles:

TileWhat it makes
WaterWater[18]
Water or earthWater or Jungle earth, even odds[19]
Chest in waterWater, with a Chest in it[20]
A flooded level's lakeWater, under earth on some tiles, and the Megamouth's[21]

The Black Market's rooms have the same tiles [22] [23]. In custom levels water is the level editor's tile w [24].

Interactions

#
  • Fish. Each block of water outside a block of earth gets a Piranha with a 1 in 30 chance, or on a graveyard level a Dead Fish [25]. Both go after a player who's swimming, and only then [26] [27].
  • Bats don't wake for, or chase, a player who's swimming [28].
  • Stomping. The stomp check most monsters share needs a player who isn't swimming, so landing on a monster in water doesn't stomp it [29].
  • Monsters in water splash and fall at a third of their gravity, 0.2 rather than 0.6, in the code most monsters share [30], and a Fire Frog that goes in turns into an ordinary Frog [31].
  • Rubble slows in water, and a drip of water ends in it [32].

Tips

#
  • A drop into water is safe from any height: a pool at the foot of a long shaft is a way down without losing hearts.
  • Getting out takes a bank no higher than a jump from the surface; from the bottom, kicks bring the player up to it first.
  • Swimming keeps Bats off, but draws Piranhas.

Trivia

#
  • Only water in the top 512 pixels of a level drains, except in a custom level, and none drains in Olmec's Lair [33]. A safety count stops the draining after 100,000 blocks have been looked at [34].
  • Every block of water is set up with the type "Water", which the draining code reads to tell it from lava's [35] [36].

FAQ

#
Does water break your fall in Spelunky Classic?

Yes. While the player is in water, his fall doesn't count, so landing in a pool from any height costs no hearts and doesn't stun him, and the water slows his fall as he sinks.

How do you swim up in Spelunky Classic?

With the jump key, while there's water just above the player's head: each press kicks him up, standing on the bottom or not. With his head out, the key gives no kick, so he climbs out on a kick from just under the surface.

Can you stomp monsters underwater in Spelunky Classic?

No. The stomp checks most monsters share don't count a player who's swimming, so landing on a monster in water doesn't hurt it.

What lives in the water in Spelunky Classic?

Piranhas, made in a block of water with a 1 in 30 chance, which attack only a swimming player; Dead Fish in their place on a graveyard level; and, in a flooded level's lake, the Megamouth.

See also

#

References

#
  1. objects/oPlayer1/step.gml:302-311
  2. objects/oGame/step.gml:88-94
  3. Clip water/swim
  4. objects/oPlayer1/step.gml:177-186
  5. scripts/characterStepEvent.gml:750-752
  6. objects/oPlayer1/step.gml:302-304
  7. objects/oPlayer1/step.gml:268-289
  8. scripts/characterStepEvent.gml:750-771
  9. objects/oPlayer1/step.gml:305-310
  10. objects/oBubble/step.gml:1-6
  11. scripts/characterStepEvent.gml:308-319
  12. scripts/characterStepEvent.gml:338-342
  13. scripts/isCollisionWaterTop.gml:6-9
  14. scripts/characterStepEvent.gml:767-771
  15. objects/oSolid/destroy.gml:35
  16. objects/oGame/step.gml:49-104
  17. objects/oWaterSwim/destroy.gml:1-4
  18. scripts/scrRoomGen2.gml:376-379
  19. scripts/scrRoomGen2.gml:344-348
  20. scripts/scrRoomGen2.gml:371-375
  21. scripts/scrRoomGen2.gml:380-394
  22. scripts/scrRoomGenMarket.gml:257-260
  23. scripts/scrRoomGenMarket.gml:285-294
  24. scripts/scrCreateTileObj.gml:46-49
  25. scripts/scrEntityGen.gml:326-335
  26. objects/oPiranha/step.gml:32
  27. objects/oDeadFish/step.gml:52
  28. objects/oBat/step.gml:23-36
  29. objects/oEnemy/collision_oCharacter.gml:6
  30. objects/oEnemy/create.gml:17-18
  31. objects/oEnemy/step.gml:34-53
  32. objects/oRubblePiece/step.gml:5-10
  33. objects/oGame/step.gml:55-57
  34. objects/oGame/step.gml:96-97
  35. objects/oWater/create.gml:3
  36. objects/oGame/step.gml:62-66

Source code

#