Prozi Posted September 8, 2018 Share Posted September 8, 2018 Introduction Hi I am a long time programmer in JavaScript mostly But recently I switched to Unity Which has some great concepts. I tried to implement a simple framework to mimic the: Scene -> GameObjects -> Scripts / Components structure in JavaScript License: MIT https://www.npmjs.com/package/@minininja/engine https://www.npmjs.com/package/@minininja/pixijs https://www.npmjs.com/package/@minininja/threejs Base concept You create GameObjects + Scripts / Components. Each GameObject has a Transform property which is either a base Vector3 instance some kind of i.e. pixi.js or three.js object. Scripts have a many to one relationship with a GameObject. You append a script's Transform to a GameObject's Transform. Once you call one GameObjects onUpdate it propagates to all its children. You can reference a Transform's parent GameObject by this.gameObject accessor and GameObject's Transform by this.transform in GameObject context. mattstyles 1 Quote Link to comment Share on other sites More sharing options...
Prozi Posted October 19, 2018 Author Share Posted October 19, 2018 So I've updated the documentation as it sucked Also added a benchmark https://prozi.github.io/engine-pixijs/demo/ Quote Link to comment Share on other sites More sharing options...
Prozi Posted October 26, 2018 Author Share Posted October 26, 2018 Added Three.js variant for all those who're more into 3D https://www.npmjs.com/package/@minininja/threejs demo: https://prozi.github.io/engine-threejs/demo/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.