components-systems holds NanoForge's official component and system packages for the editor, made
for Engine v2. Each folder of packages is one
package of the registry:
| Package | Side | What it gives |
|---|---|---|
@nanoforge/basics |
shared | Position2D, Velocity2D, Acceleration2D and move2D |
@nanoforge/graphics-2d |
client | Rectangles, circles and texts with a color or an image, draw2D |
@nanoforge/physics-2d |
shared | Hitboxes, collisions, gravity, walls and platforms |
@nanoforge/controls-2d |
client | Move and jump with the keyboard |
@nanoforge/combat-2d |
both | Health, damage, bullets fired at the mouse |
The packages to install in a new project are listed in Default packages.
In the editor: File › Packages…, search for @nanoforge/, and install. A package installs the
packages it depends on.
The editor reads everything from the code (TSDoc), there is no separate manifest per item:
- a component is a class tagged
@component, with a literalnameequal to the class name, andpublicconstructor parameters with defaults: they are the fields of the inspector; - a system is a function
(registry, ctx)tagged@system, that queries its components withregistry.getZipper([A, B]); @side clientfor what uses graphics or input,@side sharedfor the rest;@group,@preset,@color,@assetlay out the inspector (see the editor's Components doc).
Keep the parameters few and named for beginners, with what is less common in an Advanced hidden
group. Everything else stays reachable from code (shape on drawables, collisions on hitboxes).
A package imports another with its name and the path of a file in it:
import { Position2D } from "@nanoforge/basics/components/position-2d".
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
documentation.
See the contribution guide if you'd like to submit a PR.
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to ask questions in discussions.
