For the love of 2D. A JavaScript SDK.
2dk is a hobby project combining my love for web technologies and my nostalgic passion for 2D gaming, specifically the Game Boy era. It's an ongoing creative outlet, as I have the time, to tinker and develop new features across the engine and studio software.
I've followed a pretty simple model: games should be created in the studio software in a designer like fashion and game makers should never write a lick of code. To do this I iterate on the best models for the game data, hard-code it, develop support for it in the game engine and circle back to adding support for it in the studio software. The game engine is always some amount ahead of the studio software's support for the features. Eventually I'll get around to better documenting how the game engine works and therefore how these features work in the studio software.
A 2dk game is a static PWA that contains all its own resources and data files. The Player, or engine, has a mobile first philosophy behind it and is designed to be played as a standalone web app on your phone. It handles offline mode with a Service Worker that caches all the game resources.
It's basically Photoshop for 2D map painting. You can paint background and foreground layers as well has a basic map collision layer. You can add NPCs to the maps and give them various attributes like dialogue, roaming AIs, projectiles etc. You can also manage meta layers to create spawn points, map events and active tiles.
I've been using my favorite game Link's Awakening as a model for the game engine and mechanics of the TopView plugin for the Player. The developer demo is a Zelda-based game called The Missing Link. This game is based on some very old dabbling with the Akihabara game library from quite a long time ago. I've archived that game here.
To develop clone this repo and then:
# Install packages
yarn
# Run local dev server for static frontend
# Runs watch scripts for all resources for an easy dev experience at localhost:8000
yarn devThe studio software is an Electron application. Currently there are no package scripts for the software distribution as the project is still in what I would consider alpha development. To run the electron application for local development:
# From project root install packages
yarn
# From project root build all resources
yarn build
# Move to studio software directory
cd studio
# Install packages
yarn
# Run the electron app
yarn devAs of right now the ability for uploaded audio files (mp3) to be compressed requires the installation of lame. For macos you can simply brew install lame. The electron software then uses node-lame for the compression (only if lame is available). Ideally the software will bundle the lame executable for each distro when we get there.
I've found the Mozilla Gaming docs to be quite helpful. I used these to implement the Gamepad API so I can play with my USB NES controller when developing in electron.
I've been trying to keep track of where I've found resources online. Stuff like sprites, tiles and audio.
- Sounds for LA from khinsider
- Sprites & Tiles from The Sprites Resource
- I'm an OG fan of kesiev's original Akihabara work
- Gotta Code Them All got me thinking back in the day as well
I take no credit for the Nintendo IPs used for the Zelda demo game nor for the artwork and designs. All I've done is increased the resolution of sprites and tilesets I've compiled from the internet.


