DEV Community

Cover image for Started a repo for my new game engine
Jack Le Hamster
Jack Le Hamster

Posted on

Started a repo for my new game engine

I just wanted to start by sharing the repo where I'll be building my JavaScript game engine. It's part of my NAPL project, discussed in previous posts.

https://github.com/jacklehamster/bun-engine

It's built using bun.js, because it's the only framework that doesn't constantly break whenever I bring in a new dependency.

There's not much at the moment. You just have an image rendered using WebGL, and you can move around to look at it.

I usually try to have something more interesting before sharing it out, but I guess this time I thought I'd better share this early, in case anyone wants to contribute in any way.

Goal

Ultimately, the goal is for this is to make a engine that makes it easy for creating games. You could have a bunch of JSON files and assets describe your game, with no programming code involved.

Immediate iteration

  • For now, I need to enhance sprite support. A set of images will be uploaded into WebGL textures, separated in slots of 256x256. That's the basic sprite size, but if larger sprites are needed, it can take multiple slots.

  • Animation support: A spritesheet will be uploaded into the textures, so that a sprite can animate by moving the slot within that texture.

  • Movement and transform for a sprite will be coded properly so that we can provide a snippet of JSON to define a sprite. For example:

{
  "name": "turtle",
  "anim": "turtle-animation",
  "size": [1000, 1000],
  "rotation": [-90, 0, 0],
  "position": [0, 0, 0],
}
Enter fullscreen mode Exit fullscreen mode

Note that I already have a game that uses this entire schema (namely World of Turtle). But I found myself still writing too much game specific code for it, so that's why I decided to redo my game engine from scratch.

As I iterate on the engine, you can check the DEMO, which hopefully will look more and more interesting as time goes on, and eventually entire games will be created using this engine.

Cheers.

Top comments (0)