SpelunkyFan wiki

Whip

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

The Whip is the weapon the player always has in Spelunky Classic: a crack in front of him that takes 1 hit point from a monster on each step it touches it.

The player has it from the start of every game and never loses it: it's what the attack key does when his hands are empty. A swing hurts what's behind him as well as what's in front, and most monsters have a single hit point, so it kills them outright; bigger ones take it a hit point a step. A few monsters' own code changes what it does to them (Damage, below). The Machete and the Mattock swing the same way, harder.

Usage

#
Whip crack and wind-up. Two snakes close in on the player from both sides. One swing of the whip kills both: the wind-up behind him takes the snake at his back, then the crack in front takes the other.

Pressing the attack key with empty hands, standing, walking, jumping or falling but not ducking, starts a swing [3]; with anything in his hands, the key uses or throws that instead [4]. A swing has two parts:

  • The wind-up, 16 pixels behind the player, made on the swing's first steps; it lasts 3 steps [5] [6].
  • The crack, 16 pixels in front of him, made once the swing's animation is past its fifth frame and kept until the swing ends [7] [8].

Both follow the player if he moves [9] [10]. In play, the wind-up comes on the step after the key is pressed and the crack 4 steps after that, for 7 steps. A new swing can't start until the last one's animation has ended [11] [12]. The clip shows both parts: two Snakes close in from either side, and one swing kills both, the one behind him first [13].

Damage

#

Most monsters run the code their parent object shares, which takes the whip's 1 hit point on every step the crack or the wind-up touches them, with no pause between hits [14] [15]. A crack that stays on a Megamouth for all 7 of its steps takes 7 hit points [16]. Monsters with code of their own:

MonsterCrackWind-up
Caveman, Hawkman, Vampire1, and stuns it; nothing while it's stunnedThe same[17] [18]
Mantrap1, and stuns it; nothing while it's stunnedThe same[19]
Giant Spider1, at most once every 10 steps1 a step, with no wait[20] [21] [16]
Tomb Lord1, at most once every 10 steps, and only level with its top 12 pixels1 a step, from any height[22] [16]
YetiNothing: it knocks the Yeti backNothing: it knocks it back[23] [24]
Yeti KingNothing1 a step[25] [16]
Magma ManNothing1 a step, off its life[26] [16]
GhostNothingNothing[27]

The wind-up hurts the Giant Spider, the Tomb Lord, the Yeti King and the Magma Man because none of them has code of its own for it, so they take the shared code's, which has no wait: with his back to a Giant Spider, a swing takes 3 of its 10 hit points in 3 steps [28] [16].

Interactions

#
  • Shopkeepers. The crack or the wind-up doesn't hurt one, but knocks him back and makes him attack [29] [30].
  • Jars. A crack breaks one, which may let out gold, a gem, a Spider or a Snake [31].
  • Damsels. The crack or the wind-up makes a Damsel jump without hurting her, and angers the Shopkeeper if she's for sale [32] [33].

Tips

#
  • With his back to a monster, the player still hits it: the wind-up is the only part of the Whip that hurts the Yeti King or the Magma Man.
  • A Caveman, a Hawkman or a Vampire takes 1 a swing and is stunned by it, so a stunned one is better finished some other way.

Trivia

#
  • As the Tunnel Man, the swing makes a Mattock's hit instead of the crack [34].
  • The wind-up and the crack are both of type "Whip", and only the Machete's are "Machete": the code that treats the Machete differently tests that name [35] [36].

FAQ

#
How much damage does the Whip do in Spelunky Classic?

1 hit point for each step it touches a monster, with no pause between steps. Most monsters have 1 hit point and die to the first; a crack that stays on a bigger one, such as a Megamouth, can take up to 7.

Can the Whip hit monsters behind the player in Spelunky Classic?

Yes. Each swing starts with a wind-up 16 pixels behind the player, which hurts a monster there for 1 hit point on each of its 3 steps, as the crack does in front.

Why doesn't the Whip hurt a Yeti in Spelunky Classic?

A Yeti's own code only takes damage from a hit that punctures, which the Whip's doesn't: the crack knocks it back instead. A Machete or a Mattock punctures.

Can you use the Whip while holding an item in Spelunky Classic?

No. With something in the player's hands, the attack key throws or uses it instead; the Whip only comes out when his hands are empty.

#
A whip swing hurts a monster on every step it touches it. The player whips a megamouth three times as it charges. A swing has no pause between hits: the second one stays on the fish for seven steps and takes a hit point on each, seven in all.
Giant spider and the whip's wind-up. With his back to a giant spider, the player swings the whip: the wind-up behind him takes 3 of its 10 hit points, 1 on each of three steps in a row, though its own code waits 10 steps between whip hits. The spider leaps on him.

See also

#

References

#
  1. objects/oPlayer1/step.gml:415-533
  2. objects/oWhip/create.gml:4
  3. objects/oPlayer1/step.gml:1175-1202
  4. objects/oPlayer1/step.gml:1313-1319
  5. objects/oPlayer1/step.gml:524-533
  6. objects/oWhipPre/create.gml:3-5
  7. objects/oPlayer1/step.gml:415-480
  8. objects/oPlayer1/step.gml:535-539
  9. objects/oWhip/step.gml:1-14
  10. objects/oWhipPre/step.gml:1-14
  11. objects/oPlayer1/step.gml:1177
  12. objects/oPlayer1/other_animation_end.gml:1-5
  13. Clip whip/crack
  14. objects/oEnemy/collision_oWhip.gml:1-8
  15. objects/oEnemy/collision_oWhipPre.gml:1-8
  16. Quirk 1 (docs/quirks.md)
  17. objects/oCaveman/collision_oWhip.gml:1-17
  18. objects/oVampire/collision_oWhipPre.gml:1-13
  19. objects/oManTrap/collision_oWhip.gml:1-20
  20. objects/oGiantSpider/collision_oWhip.gml:1-7
  21. objects/oEnemy/collision_oWhipPre.gml:1
  22. objects/oTombLord/collision_oWhip.gml:1-8
  23. objects/oYeti/collision_oWhip.gml:22-30
  24. objects/oYeti/collision_oWhipPre.gml:22-30
  25. objects/oYetiKing/collision_oWhip.gml:1-16
  26. objects/oMagmaMan/collision_oWhip.gml:1-6
  27. objects/oGhost/collision_oWhip.gml:1
  28. Clip giant-spider/wind-up
  29. objects/oShopkeeper/collision_oWhip.gml:1-19
  30. Replay fidelity/replays/shop-seed-11-whip.txt
  31. objects/oJar/collision_oWhip.gml:1-21
  32. objects/oDamsel/collision_oWhip.gml:13-23
  33. objects/oDamsel/collision_oWhipPre.gml:13-23
  34. objects/oPlayer1/step.gml:432-446
  35. objects/oWhipPre/create.gml:3
  36. objects/oCaveman/collision_oWhip.gml:1

Source code

  • objects/oWhip/create.gml
  • objects/oWhip/step.gml
  • objects/oWhipPre/create.gml
  • objects/oWhipPre/step.gml
  • objects/oPlayer1/step.gml
  • objects/oPlayer1/other_animation_end.gml
  • objects/oEnemy/collision_oWhip.gml
  • objects/oEnemy/collision_oWhipPre.gml
#