There are several ways to embed the game with a specific prototype:
Add ?prototype=name to the URL:
<iframe
src="https://wileywiggins.com/dungeonkit/?prototype=labyrinth"
width="800"
height="600"
></iframe>
Direct link example: index.html?prototype=labyrinth
Set data-prototype on the game container:
<div id="game" data-prototype="labyrinth"></div>
<!-- Load scripts -->
<script src="lib/rot.js"></script>
<script src="lib/pixi.min.js"></script>
<script src="lib/tweenjs.js"></script>
<script src="lib/howler.js"></script>
<script src="globals.js"></script>
<script src="lighting.js"></script>
<script src="sound.js"></script>
<script src="interface.js"></script>
<script src="input.js"></script>
<script src="engine.js"></script>
<script>
initializeGame();
</script>
Define window.DUNGEON_CONFIG before loading the engine:
<script>
window.DUNGEON_CONFIG = {
prototype: 'labyrinth'
};
</script>
<div id="game"></div>
<!-- Load scripts... -->
<script src="engine.js"></script>
<script>
initializeGame();
</script>
When multiple methods are used, the prototype is selected in this order:
default - Default test prototypelabyrinth - Cretan Labyrinth (Theseus vs Minotaur)arena - Combat testing arena (see arena.html for balance testing UI)Add new prototypes in the /prototypes/ directory.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>My Dungeon Game</title>
<link rel="stylesheet" href="assets/main.css">
</head>
<body>
<div id="game" data-prototype="labyrinth"></div>
<script src="lib/rot.js"></script>
<script src="lib/pixi.min.js"></script>
<script src="lib/tweenjs.js"></script>
<script src="lib/howler.js"></script>
<script src="globals.js"></script>
<script src="lighting.js"></script>
<script src="sound.js"></script>
<script src="interface.js"></script>
<script src="input.js"></script>
<script src="engine.js"></script>
<script>
window.addEventListener('load', () => initializeGame());
</script>
</body>
</html>