Framework Docs
The DN framework powers every browser game on this site.
Independent JavaScript modules — no bundler, no build step,
just <script> tags and game logic.
Four layers: 2D core, tilemap generation,
3D (Three.js), and the data-driven gameplay layer.
Load Order
Include only what your game needs. Order matters — math first, then core, then gameplay layer.
<!-- 1. Math (always first — everything depends on Vector2D) -->
<script src="/js/dn/mathUtils.js"></script>
<!-- 2. Core loop + input -->
<script src="/js/dn/gameLoop.js"></script>
<script src="/js/dn/inputHandlers.js"></script>
<!-- 3. Scene system (multi-scene games) -->
<script src="/js/dn/scene.js"></script>
<script src="/js/dn/sceneManager.js"></script>
<!-- 4. Camera (scrolling worlds) -->
<script src="/js/dn/camera.js"></script>
<!-- 5. Tilemap generation (procedural worlds) -->
<script src="/js/dn/tilemap/mapWalkers.js"></script>
<script src="/js/dn/tilemap/noiseMapGen.js"></script>
<script src="/js/dn/tilemap/worldGenUtils.js"></script>
<script src="/js/dn/tilemap/tileMapBitmask.js"></script>
<!-- 6. Gameplay layer (entity/behavior RPG framework) -->
<script src="/js/dn/gameplay/inventory.js"></script>
<script src="/js/dn/gameplay/questState.js"></script>
<script src="/js/dn/gameplay/marketManager.js"></script>
<script src="/js/dn/gameplay/behaviors.js"></script>
<script src="/js/dn/gameplay/popupManager.js"></script>
<script src="/js/dn/gameplay/popupRenderer.js"></script>
<script src="/js/dn/gameplay/areaLoader.js"></script>
<!-- 7. Your game -->
<script src="game.js"></script> All Modules
Design Decisions
Each module is independent. Use only what you need — a simple arcade game uses gameLoop.js alone. A tile-map RPG adds the gameplay layer on top.
Game objects like canvas, context, and input are intentionally global. For a single-canvas browser game, module imports add complexity with no benefit.
GameLoop separates update (fixed rate) from render (fires after update). Physics runs at the same speed on any display — 60Hz or 144Hz.
The gameplay layer defines games as data — areas, entities, behaviors, quests — rather than code. Swapping a movement module changes the game genre; entity data stays the same.
The 3D framework uses Y-up / 1m coordinates to match Decentraland. A GLB exported by the terrain builder loads directly in a DCL scene — one tool, two runtimes.
This started as the S3D engine (2020). Each game either uses an existing module or adds a new one. v0.1 is the first formal release — confirmed and documented, building from here.