README
@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
GameObject
s +Script
s /Component
s.Each
GameObject
has aTransform
property which is either a baseVector3
instance some kind of i.e.pixi.js
orthree.js
object.Scripts have a
many to one
relationship with aGameObject
.You append a script's
Transform
to aGameObject
'sTransform
. Once you call oneGameObject
sonUpdate
it propagates to all its children.You can reference a
Transform
's parentGameObject
bythis.gameObject
accessor andGameObject
'sTransform
bythis.transform
inGameObject
context.
Classes
✅ Vector3
: class
- Recommended read: Vector3
✅ Component
: class
- Recommended read: Component
✅ Script
: Component
✅ Transform
: Vector3
Recommended read: Transform
This is a
transform
property 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