@minininja/engine v1.1.9
@minininja/engine
A simple zero-dependency modular game engine for bootstrapping games.
Installation
npm i --save @minininja/engine
Documentation
https://prozi.github.io/engine/
Base concept
You create
GameObjects +Scripts /Components.Each
GameObjecthas aTransformproperty which is either a baseVector3instance some kind of i.e.pixi.jsorthree.jsobject.Scripts have a
many to onerelationship with aGameObject.You append a script's
Transformto aGameObject'sTransform. Once you call oneGameObjectsonUpdateit propagates to all its children.You can reference a
Transform's parentGameObjectbythis.gameObjectaccessor andGameObject'sTransformbythis.transforminGameObjectcontext.
Classes
✅ Vector3: class
- Recommended read: Vector3
✅ Component: class
- Recommended read: Component
✅ Script: Component
✅ Transform: Vector3
Recommended read: Transform
This is a
transformproperty in aGameObject.This is to be replaced in child class with an instance of any child of PIXI.DisplayObject
✅ GameObject: Component
- Recommended read: GameObject
✅ Scene: GameObject
- transform = PIXI.Container
TL; DR
All constructors eat a JSON with parameters:
✅ name: string
✅ active: boolean
and four optional handlers:
✅ onEnable: function
✅ onDisable: function
✅ onStart: function
✅ onUpdate: function
✅ transform: property (Vector3, source of position you can overwrite with anything)
Notable Mentions
https://www.npmjs.com/package/@minininja/pixijs -> for use of this library with pixi.js
https://prozi.github.io/engine-pixijs/demo/ -> benchmark / demo of the above
License
MIT
Author
Jacek Pietal prozi85@gmail.com