Skip to content

kitajchuk/2dk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

798 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2dk

For the love of 2D. A JavaScript SDK.

Netlify Status

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.

The process

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.

Game bundles

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.

Game making

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.

Getting started

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 dev

Studio software

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

Audio compression

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.

Resources

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.

Open source

I've been trying to keep track of where I've found resources online. Stuff like sprites, tiles and audio.

Assets

Inspiration

Disclaimer

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.

About

For the love of 2D. A JavaScript SDK.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •