Getting started quickly with NBase


I’ve been working on building classes on top of Heaps for all my future projects and ended up with a lot of things, so after some thought I then decided to clean up and document my code and share it as NBase. (Originally called NeroBase, but it felt… too egocentric.)

Here’s a link to the repo:

It’s not currently at its best state of course but most of it is already usable and clean enough for me to share. There’s only 2D stuff for now.

Here’s a list of what you’ll find there as of this version in no particular order:

  • An atlas class for combining your images into one single texture.
  • A sprite class for displaying your images and “complex” resources like aseprite files, gifs and spritesheets.
  • Scene/subscene/interactive classes for allowing you to have more complex interactions, having scene on scene on scene, etc…
  • An “all-in-one” file system that provides you with hot-reloading on javascript target with a local server, and boost your game loading times using multithreading.
  • A Tween class.
  • A Graphics class for drawing using less lines of code and complex fill operations.
  • Object classes have tags
  • A manager class, which can be used for creating/switching scenes.
  • A camera class with some nice functions for dealing with objects added to the camera and rescaling of objects. (Its the “scroller” kind.)
  • At least 90% of the code is documented so that you can understand easily, learn and make your own stuff if you want.
  • CC0 license, so you can just do whatever the hell you want with the code, no mention required.

This list is not exhaustive but I invite you to check out the rest by yourself.

You can expect classes that have their equivalent name in current heaps to be an extension class of them. nb.Scene extends h2d.Scene, etc. The only exception currently is Interactive.hx which is is not an extension of h2d.Interactive.

Tell me what you think, concerns and whatnot, I want to learn.

This is not all that is already written, that’s only code that I judged is good enough to share right now. I already have written things like UI classes, some kind of editor, a physics library, etc, but it needs a bit more time. Those should be ready in the next months and released gradually.

This will be outdated relatively quickly so here’s a link to the wiki.

About me.

I’m going all in on game development and wants to make and share a lot more things that would ultimately end up benefitting the community. I’m not planning to ever stop but money is my enemy. You giving even a dollar a month will probably help more than you think.

How to support :

Thanks for reading


Nice work! Gonna check it out :smile:

Great, please keep updating

Will do that for sure.