Frog
Verified against the spelunky.ai port v0.1.10 on .
For the orange frog that explodes, see Fire Frog.
The Frog is a monster of the Jungle in Spelunky Classic that sits still until the player comes near, then leaps at him in long jumps, biting for 1 heart.
Level generation puts Frogs on blocks all over the Jungle, under water as well as on land. A Frog doesn't move until the player comes within 64 pixels; then it jumps at him again and again, each jump carrying it several blocks, and bites him if it lands on him. With 1 hit point, it dies to any damage, whether from the Whip, a stomp or a thrown Rock.
Behaviour
#A Frog sits still until the player is within 64 pixels of it, counting from the edges of the two, and then croaks and starts jumping [5]. Each jump starts from the ground at 2–4 pixels per step upward and 3 pixels per step (90 per second) across, toward the player, and it keeps that speed across until it lands [6]. A wall it hits sends it back the other way at 1 pixel per step, and a ceiling stops it rising [7] [8].
Gravity adds 0.2 pixels per step to its fall every step, which brings it down again about 20, 30 or 40 steps after a jump at 2, 3 or 4 upward, so a jump carries it about 60, 90 or 120 pixels across, four to seven blocks [9]. In the clip, its first jump, at 3 upward, carries it 93 pixels and 23 high, clean over the player's head; its second lands on him [10].
When it lands, it stops dead and rests for 10–40 steps (0.33–1.33 seconds); if the player is still in range when the rest is over, it jumps again, and if not, it sits where it landed [11] [12]. It never walks: jumping is its only way of moving.
Water doesn't trouble a Frog: its gravity in water is the same 0.2 as in air, so it jumps and falls there as it does on land, and there's no drowning in its code [9] [13] [14]. Like most monsters, it only acts while it's on screen or just off it [15].
Damage
#When the player touches a Frog without stomping it, he loses 1 heart, is knocked away from it, and blinks, invincible, for 30 steps (1 second) [16]. This is the touch code most monsters share; the Frog has no attack of its own, and the clip above shows a jump landing on the player and taking him from four hearts to three.
Defeating
#A Frog has 1 hit point, so any damage kills it [17]:
| Way | Damage | |
|---|---|---|
| Whip | 1 hit point | [18] |
| Machete | 2 hit points | [18] |
| Stomp (landing on it), except while the player is swimming | 1, plus 1 for every 16 steps of falling; three times that with Spike Shoes | [19] |
| A thrown item moving faster than 2 pixels per step, such as a Rock | 1 | [20] |
| A Shotgun or Pistol bullet | 4 hit points | [21] |
| A Bomb's explosion | 30 hit points | [22] |
| A Spear Trap's spears | 2 | [23] |
| Falling onto Spikes | Kills it | [24] |
| Standing in Lava | Kills it | [25] |
| Lava over its head | Removes it | [26] |
| Ending up inside solid ground | Kills it | [27] |
Frogs killed count toward the player's kills, and the screen between levels draws a Frog icon for each [28] [29]. One that Spikes, Lava or a Spear Trap killed doesn't count [30] [31] [32].
Locations
#Level generation makes Frogs only in the Jungle, levels 5–8, on top of blocks with open space above them, outside the starting room and shops, and not on a graveyard level [33] [34]:
- On land, a 1 in 30 chance for each such block, once the rolls for a Mantrap, a Caveman and a Fire Frog have failed [35].
- Under water, where the block has water above it, a 1 in 30 chance once the roll for a Fire Frog has failed [36].
Frogs also come from:
- Fire Frogs. A Fire Frog that lands in water turns into a Frog [37].
- Olmec's yellow balls, which turn into a Bat, Spider, Snake, Frog or Fire Frog when they hit the ground [38].
- Custom levels, as the level editor's tile
f[39].
Tips
#- A Frog doesn't move until the player is within 64 pixels, so one can be left sitting by keeping that far away.
- Each jump keeps its speed across until the Frog lands, so a player who steps aside while it's in the air is out of its way.
- A Frog rests after every landing, which is the moment to whip it.
Trivia
#- The Frog's code names a walking state and a drowned state, but nothing ever puts a Frog in either: it only sits, jumps and lands [40].
- A commented-out line beside its range check would have woken it at 48 pixels rather than 64 [41].
FAQ
#- How much damage does a Frog do in Spelunky Classic?
1 heart per touch. A Frog that lands on or bumps into the player costs him 1 heart, knocks him back and makes him invincible for 30 steps (1 second).
- How do you kill a Frog in Spelunky Classic?
Hit it once with anything. A Frog has 1 hit point, so a Whip hit, a stomp, a thrown item, a bullet or a Bomb kills it.
- Where do Frogs live in Spelunky Classic?
In the Jungle, the only area whose level generation makes them, sitting on blocks on land and under water. One of Olmec's yellow balls can also turn into a Frog.
- What is the difference between a Frog and a Fire Frog in Spelunky Classic?
They move the same way and both die to one hit, but a Fire Frog's body explodes four seconds after it dies, and a Fire Frog that falls into water turns into an ordinary Frog.
See also
#References
#objects/oFrog/create.gml:15objects/oEnemy/collision_oCharacter.gml:25objects/oFrog/step.gml:66objects/oFrog/step.gml:40-78objects/oFrog/step.gml:38-47objects/oFrog/step.gml:58-78objects/oFrog/step.gml:25-33objects/oFrog/step.gml:85-86objects/oFrog/create.gml:8-9- Clip frog/jump
objects/oFrog/step.gml:48-57objects/oFrog/step.gml:40-47objects/oEnemy/create.gml:18objects/oEnemy/step.gml:34-55objects/oFrog/step.gml:3-4objects/oEnemy/collision_oCharacter.gml:14-25objects/oFrog/step.gml:13-23objects/oEnemy/collision_oWhip.gml:1objects/oEnemy/collision_oCharacter.gml:6-10objects/oItem/step.gml:256-348objects/oBullet/collision_oEnemy.gml:16objects/oExplosion/collision_oEnemy.gml:14objects/oEnemy/step.gml:76-106objects/oEnemy/step.gml:108-128objects/oEnemy/step.gml:65-74objects/oEnemy/step.gml:63objects/oFrog/step.gml:11objects/oFrog/step.gml:16-21objects/oTransition/alarm_0.gml:173-178objects/oEnemy/step.gml:68objects/oEnemy/step.gml:101objects/oEnemy/step.gml:120scripts/scrInitLevel.gml:26scripts/scrEntityGen.gml:262-296scripts/scrEntityGen.gml:285-292scripts/scrEntityGen.gml:294-295objects/oEnemy/step.gml:44-49objects/oYellowBall/step.gml:4-19scripts/scrCreateTileObj.gml:156-159objects/oFrog/create.gml:22-28objects/oFrog/step.gml:45objects/oEnemy/step.gml:63-74
Source code
objects/oFrog/create.gmlobjects/oFrog/step.gmlobjects/oEnemy/create.gmlobjects/oEnemy/step.gmlobjects/oEnemy/collision_oCharacter.gmlobjects/oEnemy/collision_oWhip.gmlscripts/scrEntityGen.gmlobjects/oYellowBall/step.gml