components-systems holds NanoForge's official component and system packages for the editor, made
for Engine v3. Each folder of packages is one
package of the registry:
| Package | Side | What it gives |
|---|---|---|
@nanoforge/basics-2d |
shared | Position, velocity and move2D; tags, models, lifetimes, following another entity |
@nanoforge/basics-3d |
shared | Position3D, Rotation3D, Scale3D, Velocity3D, Acceleration3D and move3D |
@nanoforge/graphics-2d |
client | Shapes and texts with a color or an image, sprite animations, facing, a camera, a HUD, draw2D |
@nanoforge/physics-2d |
shared | Hitboxes, collisions, gravity, walls, bounces and deflectors, walking, jumping, chasing and bounds |
@nanoforge/controls-2d |
client | Keyboard, mouse and gamepad controls for walking, jumping and shooting; click, drag and follow the mouse |
@nanoforge/combat-2d |
both | Health, damage, shooters fired by a player, a turret or the server; health bars |
@nanoforge/scenes-2d |
both | Scene vars shown in texts, coins and zones that add to them |
@nanoforge/network-2d |
both | The server sends where its entities are, how they move and which are gone; the clients follow |
@nanoforge/audio |
client | Sound effects, music per level, a mute key |
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 or runs only on a client,@side serverfor what runs only on a server,@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-2d/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.
