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
#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:
| Monster | Crack | Wind-up | |
|---|---|---|---|
| Caveman, Hawkman, Vampire | 1, and stuns it; nothing while it's stunned | The same | [17] [18] |
| Mantrap | 1, and stuns it; nothing while it's stunned | The same | [19] |
| Giant Spider | 1, at most once every 10 steps | 1 a step, with no wait | [20] [21] [16] |
| Tomb Lord | 1, at most once every 10 steps, and only level with its top 12 pixels | 1 a step, from any height | [22] [16] |
| Yeti | Nothing: it knocks the Yeti back | Nothing: it knocks it back | [23] [24] |
| Yeti King | Nothing | 1 a step | [25] [16] |
| Magma Man | Nothing | 1 a step, off its life | [26] [16] |
| Ghost | Nothing | Nothing | [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.
Gallery
#See also
#References
#objects/oPlayer1/step.gml:415-533objects/oWhip/create.gml:4objects/oPlayer1/step.gml:1175-1202objects/oPlayer1/step.gml:1313-1319objects/oPlayer1/step.gml:524-533objects/oWhipPre/create.gml:3-5objects/oPlayer1/step.gml:415-480objects/oPlayer1/step.gml:535-539objects/oWhip/step.gml:1-14objects/oWhipPre/step.gml:1-14objects/oPlayer1/step.gml:1177objects/oPlayer1/other_animation_end.gml:1-5- Clip whip/crack
objects/oEnemy/collision_oWhip.gml:1-8objects/oEnemy/collision_oWhipPre.gml:1-8- Quirk 1 (docs/quirks.md)
objects/oCaveman/collision_oWhip.gml:1-17objects/oVampire/collision_oWhipPre.gml:1-13objects/oManTrap/collision_oWhip.gml:1-20objects/oGiantSpider/collision_oWhip.gml:1-7objects/oEnemy/collision_oWhipPre.gml:1objects/oTombLord/collision_oWhip.gml:1-8objects/oYeti/collision_oWhip.gml:22-30objects/oYeti/collision_oWhipPre.gml:22-30objects/oYetiKing/collision_oWhip.gml:1-16objects/oMagmaMan/collision_oWhip.gml:1-6objects/oGhost/collision_oWhip.gml:1- Clip giant-spider/wind-up
objects/oShopkeeper/collision_oWhip.gml:1-19- Replay
fidelity/replays/shop-seed-11-whip.txt objects/oJar/collision_oWhip.gml:1-21objects/oDamsel/collision_oWhip.gml:13-23objects/oDamsel/collision_oWhipPre.gml:13-23objects/oPlayer1/step.gml:432-446objects/oWhipPre/create.gml:3objects/oCaveman/collision_oWhip.gml:1
Source code
objects/oWhip/create.gmlobjects/oWhip/step.gmlobjects/oWhipPre/create.gmlobjects/oWhipPre/step.gmlobjects/oPlayer1/step.gmlobjects/oPlayer1/other_animation_end.gmlobjects/oEnemy/collision_oWhip.gmlobjects/oEnemy/collision_oWhipPre.gml