For the love of 2D. A JavaScript SDK.
2dk is a hobby project combining my love for web technology and my nostalgic passion for 2D gaming, specifically the Game Boy era. It's a never ending creative outlet, whenever I have the time, to tinker and develop new features across the engine and studio software.
This issue here is tracking towards an MVP version with the ability to create functional sandbox games without writing a lick of code using the studio software and running in the 2dk engine.
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.
Currently you can create and paint maps quite well for the background, foreground and collision layers. It's basically Photoshop for 2D map painting. I've been using the game Link's Awakening as a model for the game engine and mechanics of the TopView
plugin for the Player
. If you run the Studio you'll find it's there, named LA.
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:5050
yarn dev
The 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 dev
As 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 Link's Awakening DX from khinsider
- Sprites and 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.