Skip to content

About

Library of default genericals components and systems to develop your games easily

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


NanoForge


npm version npm downloads Tests status Documentation status Last commit Contributors

About

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.

Installation

In the editor: File › Packages…, search for @nanoforge/, and install. A package installs the packages it depends on.

Writing a component or a system

The editor reads everything from the code (TSDoc), there is no separate manifest per item:

  • a component is a class tagged @component, with a literal name equal to the class name, and public constructor parameters with defaults: they are the fields of the inspector;
  • a system is a function (registry, ctx) tagged @system, that queries its components with registry.getZipper([A, B]);
  • @side client for what uses graphics or input or runs only on a client, @side server for what runs only on a server, @side shared for the rest;
  • @group, @preset, @color, @asset lay 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".

Links

Contributing

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.

Help

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.

About

Library of default genericals components and systems to develop your games easily

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages