HUNT the WUMPUS

Code/HTML © 2017 by Columbina.
Reuse it as you like, but give credit.

For help, notes, etc:
scroll down below the map!

with tunnels (0-32)
Darkness
Fast-Forward

MOVE
Arm your weapon! (R)
SHOOT
Instructions and Notes

Click again to hide


Notes

This version of Hunt the Wumpus is based on the "grid" design of the game that was created by Kevin Kinney for the TI 99/4A system back in 1980. If you are old enough to have played that game you will want to watch out for a couple of differences in my rules, which are noted where they occur below.

I did this as a practice run for a more serious game which will use the same technique of overlaying several HTML5 canvas elements atop one another. Since one of my goals here was to have the whole thing be self-contained within a single web page, I've thrown out grid resizing and other stuff which really want a dynamic pre-loader or start page to do most cleanly. The map grid on this page is 720x720 pixels, and ideally you want a window wide enough to see it and also draw the control panel to its right. But it'll work on narrower screens; it'll just be a bit more clumsy to use, especially if you have to scroll the grid to see it all.

None of the graphics in this game (such as they are) are premade images. Everything (including the end-game screens) is drawn in place using primitives on the canvases. The code is mostly straight Javascript; I use JQuery for convenience, but it could have been written without it, just as the layout could have been handled without Bootstrap.

Game Settings

A new game/map was automatically created when you loaded the page. Once that game ends, or if you get disgusted with that map, you can use the New Game button to reshuffle. The number of tunnels (from 0 to 32) is the difficulty setting of the game. The tunnels are what make the mapping hard. Zero tunnels is good for training purposes only. 32 (tunnels make up half the map) can be extremely frustrating. Changes to this setting will only be used when generating a new map; changing it in mid-game has no effect.

The Darkness checkbox is what the TI version called the "blindfolded" option. In this version, only the cave or tunnel you're currently occupying is displayed! You'll have to keep the layout of where you've been in your head.

The Fast-Forward checkbox is what the TI version called the "express" option. When checked, you will move all the way through a tunnel to the cave at its end, wherever that is, as soon as you enter the tunnel. This adds an element of risk, since some tunnels can be fairly long and you can no longer step through one slowly to see if it's leading in a direction you don't want to go. NOTE: In the TI version of the game, tunnels didn't stay displayed onscreen when this option was on. In my version they do ... unless, of course, you're working in the dark.

NOTE: Changing either the Darkness or Fast-Forward settings in the middle of the game may produce some strange results in what parts of the map are or aren't shown.

The Show Map button will display the whole map. Normally you use this after you lose, to see where you went wrong. You can also use it at any time during play, but it will immediately end the game when you do. (That's cheating.)

You can use keys for most game commands instead of clicking the controls:
New Game = N
Show Map = V
Movement = W: north, A: west, S: south, D: east
Ready/unready weapon = R (this is just to keep you from shooting accidentally)
Shoot = I: north, J: west, K: south, L: east
NOTE: Sometimes the focus isn't where you think it is. Click the map area if the keys aren't responding and that should get them to work.

How to Play

You are trying to kill that ferocious and omnivorous horror, the Wumpus. You come equipped with a gun that has been specifically designed to penetrate the Wumpus' thick hide. The problem is, the gun only has one shot (it's basically a small rocket launcher). The other problem is, it's awfully loud.

You need to wander the caves and tunnels collecting information that will allow you to deduce the location of the Wumpus without ever actually entering the cave where it's sleeping. If you do enter that cave, you will die.

The clue to the location of the Wumpus is the blood spots from its prey that it leaves in the vicinity of its lair. All caves either one or two caves away from the Wumpus have blood spots. That is, the caves which are adjacent to the Wumpus' lair, and the caves which are adjacent to those. Tunnels don't count; two caves joined by a tunnel, no matter how long the tunnel is, are considered adjacent.

NOTE: The number and color of the blood spots in a cave is determined randomly. It does not provide any information about proximity to the Wumpus, so don't assume a cave is closer to the Wumpus just because there's a lot of blood in it.

When you believe you are standing in a cave which is adjacent to the Wumpus (again, tunnels don't count), you can ready your weapon and fire it. Be sure to fire in the correct direction! If you fire in the wrong direction, or fire from a cave that isn't adjacent to the Wumpus, the noise will wake up the Wumpus, it will find you (it's very fast), and you will die.

And as if that weren't bad enough ...

On every map there are two pits of toxic slime. If you enter a cave which has a slime pit, you fall in and die. You can tell when a slime pit is nearby, because all caves adjacent to a slime pit have slime moss growing on the walls (as indicated by green diagonal wiggly stripes). Again, tunnels don't count toward "adjacent."

The two slime pits could be adjacent to one another. Also, the Wumpus could be living in a slime pit. Wumpuses love slime.

Obviously, it is possible for a cave to have both slime moss and blood spots. Look carefully.

Cave and tunnel connections wrap around the edges of the map. If you go off the top of the map, you reenter from the bottom, and so forth.

We must also discuss the Bats of Unusual Size. There are two. The first time you enter a cave where a bat is sleeping, you wake it up and it gives you an annoyed look, but it doesn't do anything. The second time you enter that same cave, the bat, in a fit of pique, picks you up and carries you to a different location. It then flies off to an entirely different cave, where hopefully you won't find it and it can get back to its nap. If you do enter that cave, you wake it up again, and the second time you enter that cave ... you get the idea.

Bats can be in mossy or bloodspotted caves, which sometimes makes them a little hard to see. Look for them lurking at the top of the cave.

NOTE: Unlike the TI version, the second time you enter a bat's cave, it will ALWAYS carry you off; there's no chance of sneaking past. To compensate for this, though, in this version, a bat can't drop you into the Wumpus lair or a slime pit, which I always thought was unfair. Also, even if the bat relocates into a cave you've already mapped, you won't see that it's there until you reenter the cave.

The game ends when you shoot the Wumpus, or the Wumpus eats you, or you fall in a pit. Two of these are not considered successful outcomes.