Skip to content

About

A Web Implementation of Atari's Gauntlet

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Gauntlet Reforged

This is a fan-made homage to Gauntlet, the 1985 Atari Games coin-op that popularized cooperative dungeon-crawling (Warrior, Valkyrie, Wizard, Elf, and all). Atari Games released the original; Midway Games later acquired Atari's assets and continued the series (Gauntlet Legends, etc.) through the late '90s and 2000s; and following Midway's 2009 bankruptcy, the Gauntlet IP passed to Warner Bros. Entertainment, managed today through Warner Bros. Interactive Entertainment. Gauntlet is listed by name among the acquired titles in Schedule 2.1 of the May 20, 2009 Asset Purchase Agreement filed with the SEC.

This project is an unofficial re-implementation built from scratch in JavaScript, utilizing nothing more than HTML5 canvas. This project is not affiliated with, endorsed by, or built from assets owned by Atari, Midway, or Warner Bros. "Gauntlet Reforged," which is my own title, is used here descriptively, to credit the game this project is inspired by and to make it clear that this is not the original Gauntlet.

It's worth calling out that this is a partial implementation, not a full recreation of the arcade game. There are seven training levels that teach the mechanics, followed by ten dungeon levels, with a simple win screen after the last one. None of the later arcade sequels' features are here.

Playing

Up to two players share the keyboard, plus one per connected gamepad.

Join Move Fire Potion
Player 1 1–4 Arrow keys Space Enter
Player 2 1–4 again, or 5–8 W A S D F G
Gamepad A B X Y Stick or d-pad RB LB

The number keys pick a character — 1 Warrior, 2 Valkyrie, 3 Wizard, 4 Elf — and the game hands out whichever keyboard set is still free. So if the first player takes the Warrior with 1, a second player pressing 2 joins as the Valkyrie on WASD. The 5–8 row claims the second control set explicitly, if you would rather be deliberate about it. Players can join mid-run, not just from the menu.

Esc quits to the menu during play, and dismisses a help popup.

Difficulty

Hard mode makes the monsters genuinely hunt you. Normally they walk at whichever compass point the nearest player happens to be in, so a wall between you and them is enough to leave them grinding into it. In hard mode everything except the ghost follows a shared flow field — a breadth-first map of the true walking distance to the nearest player — so they route around walls, come through doorways, and converge from several directions at once.

Toggle it from the menu (the difficulty line under the play area); the choice is remembered between sessions.

Developer Options

God mode

Type the Konami code — ↑ ↑ ↓ ↓ ← → ← → B A — at any point. There is no prompt or announcement, just the same green glow a potion gives, to confirm it landed. It is a toggle, so entering it again turns it back off.

It switches off both incoming damage and the automatic health drain (players normally bleed 1 health every half second), which together are the same two switches as ?nodamage=1&noautohurt=1.

URL flags

Append to the page URL, e.g. ?level=8&hard=1&potions=4. Boolean flags accept 1, true, y or yes.

Flag Effect
?hard=1 Smart monster pathing (see Difficulty above)
?level=N Boot straight into level N and start playing, skipping the menu. 0 is the test level, 1–7 the Training levels, 8–17 the Dungeons
?player=NAME Which character ?level starts you as: warrior, valkyrie, wizard or elf. Defaults to warrior
?nodamage=1 Monsters and their fire do no damage
?noautohurt=1 Stops the half-second health drain
?nomonsters=1 Suppresses monsters placed on the map (generators still spawn them)
?nogenerators=1 Suppresses monster generators
?notreasure=1 Suppresses every map pickup — gold, food, health, poison, potions and keys. Levels with locked doors become unfinishable, so pair it with ?keys=N
?potions=N Start each player with N potions
?keys=N Start each player with N keys
?reset=1 Wipes saved progress, high score and difficulty on load
?grid=1 Draws the tile grid over the map
?wall=N Force a wall tileset, 1–6
?floor=N Force a floor tileset, 1–9
?music=ID Force a track: lostcorridors, bloodyhalo, citrinitas, fleshandsteel, mountingassault, phantomdrone, thebeginning, warbringer
?heap=1 Logs JS heap usage to the console
?buddy=NAME Adds a computer-controlled second player with that persona, such as guardian or rookie (see Buddy below for the list)
?buddyas=NAME Which character the buddy plays. Defaults to the first one free, Valkyrie first

Console helpers

The running game is exposed as window.game, so from the browser console:

game.nextLevel();      // and game.prevLevel()
game.toggleHard();     // same as the menu toggle
game.debugGrid();      // toggle the tile grid
game.debugWall();      // cycle wall tilesets; pass true to cycle backwards
game.debugFloor();     // cycle floor tilesets; pass true to cycle backwards
game.resetLevel();     // clear the saved checkpoint, keep the high score
game.addBuddy('guardian');                     // add a buddy mid-run (see Buddy below)
game.addBuddy('foodhog', 'elf', { leash: 3 }); // pick the character, and override any trait
game.removeBuddy();

Buddy

The buddy is a computer-controlled second player, so one tester can try the parts of the game that need two people: a second player joining, the shared camera, one player dying while the other carries on, two players reaching the exit at different times. It plays through the same controls a person would, with the same speed, health drain and weapons, and gets nothing a person doesn't. It also never touches Math.random, so a seeded run with a buddy replays exactly.

Each persona is a set of traits, defined in the BUDDY table near the top of public/scripts/gauntlet.js:

Persona Behaves like Good for testing
guardian Stays within 4 tiles, shoots anything that comes near you, and uses a potion when you are swarmed The baseline: does a helpful second player work at all?
foodhog Eats every bit of food and health it can reach, needed or not Health balance when one player gets none of the food
wanderer Roams the parts of the map farthest from you The shared camera at its widest zoom
gloryhog Goes hunting on its own, steals kills, and grabs the gold Score attribution, and the best-score pick at the end of a game
rusher Heads for the exit straight away The rule that a level ends only when every player has exited or died
freeloader Never fights, and keeps to the side of you away from the monsters Whether monsters choose targets sensibly when one player is passive
panicker Uses a potion the moment a monster comes near, and picks up every potion it can Potion range and waste
rookie Slow to react, often aims a direction off, and walks straight over treasure, poison and keys included Damage, deaths, and one player dying while the other carries on

Unless its persona says otherwise, the buddy leaves keys, potions, gold and poison alone. It never opens a door, and it heads for an exit once you have exited or died. The rookie's slips come from its own fixed-seed dice rather than Math.random, so they replay too. Shots stop on other players without hurting them, so it won't fire when you are in the line of fire.

Levels

Each level is a small PNG in public/levels/, one pixel per tile, listed by URL in the level table near the top of public/scripts/gauntlet.js. The red and green channels of a pixel say what the tile is, and for monsters, generators and treasure the high four bits of the blue channel pick which one:

Color Tile Blue 0x00, 0x10, 0x20 … picks
#000000 black Nothing (outside the map)
#C0C000 yellow Door
#404000 dark yellow Wall
#F00000 red Monster generator ghost, demon, grunt, wizard, death
#400000 dark red Monster ghost, demon, grunt, wizard, death
#00F000 green Player start
#008000 medium green Treasure health, poison, three foods, key, potion, gold
#004000 dark green Exit

Any other color is plain floor.

public/levels/reference.png is a visual version of that table: each color square with the sprite it turns into beside it. The game never loads it; it is there to help when making or fixing a level. To try a new level, add it to the level table and open it with ?level=N.

Building

npm install
npm run dev       # vite dev server
npm run build     # regenerate bundles, then build for production
npm run preview   # serve the production build

When you need to run the build script

The page loads three scripts, and only two of them are generated:

Loaded by index.html Comes from
public/scripts/vendor.js generated from public/scripts/game/vendor/ — sizzle.js, animator.js, audio-fx.js, state-machine.js
public/scripts/game.js generated from public/scripts/game/ — base.js, game.js, pubsub.js, dom.js, key.js, gamepad.js, math.js
public/scripts/gauntlet.js edited directly — this is the game itself, and the build script never touches it

So: if you change anything under public/scripts/game/ (including vendor/), regenerate the bundles.

npm run build:engine

Changes to public/scripts/gauntlet.js, index.html or the stylesheet need no build step at all.

Two things worth knowing:

  • npm run dev does not rebuild the bundles. Vite serves public/ as-is, so edits to public/scripts/game/** will appear to do nothing until you rebuild. If you are working in there, run the watcher in a second terminal:

    node scripts/build.js --watch
  • The generated bundles are committed to the repository, not ignored. Rebuild and commit vendor.js / game.js alongside the sources you changed, or the deployed game will run stale code.

Attributions

  • Jake Gordon did his own version that he called javascript-gauntlet. His was actually a combination of Ruby and JavaScript. I refer to this as "original project" because I quickly learned there was a lot of good stuff in it but a whole lot that was left unimplemented. I also learned quite a lot from Alex's Gauntlet FPGA version. In the end I decided I want to go more with Jake's approach than with Alex's. One other project that inspired was Angelo Anthony Rettob's Gauntlet. The tilesheet and spritesheet approach was almost going to be the way I went with this.

  • All music is licensed, royalty-free, from Lucky Lion Studios for the original project. That license has been extended to this project as well. If you re-use this project for your own purposes you must license your own music or negotiate to have the music apply to your project.

  • All sound effects are licensed, royalty-free from Premium Beat for the original project. That license has been extended to this project as well. If you re-use this project for your own purposes you must license your own sound effects or negotiate to have the sound effects apply to your project.

  • Background tilesets (walls, floors, doors) are provided by Open Game Art, which have been placed in the public domain.

Author

Made with 🤍 by Jeff Nyman

Website - Jeff Nyman

LinkedIn - Jeff Nyman

Doxazein (δοξάζειν)

חֶסֶד וֶאֱמֶת אַל־יַעַזְבֻךָ קָשְׁרֵם עַל־גַּרְגְּרֹתֶיךָ כָּתְבֵם עַל־לוּחַ לִבֶּךָ

"Let not mercy and truth forsake thee:
bind them about thy neck;
write them upon the table of thine heart."
Proverbs 3:3

License

The code used in this project is licensed under the MIT license.

Note: The MIT license covers the original code in this repository only. It is not a license to the Gauntlet name or trademark, which belongs to Warner Bros. Entertainment and isn't granted by, or affiliated with, this project. It also doesn't extend to the licensed third-party music, sound effects, tilesets, and sprites listed above under Attributions, which remain under their own separate terms.

✨ Long live the classics.

About

A Web Implementation of Atari's Gauntlet

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages