Jump to content

A simple zero-dependency modular game engine for bootstrapping games.


Prozi
 Share

Recommended Posts

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

  1. You create GameObjects + Scripts / Components.

  2. Each GameObject has a Transform property which is either a base Vector3 instance some kind of i.e. pixi.js or three.js object.

  3. Scripts have a many to one relationship with a GameObject.

  4. You append a script's Transform to a GameObject's Transform. Once you call one GameObjects onUpdate it propagates to all its children.

  5. You can reference a Transform's parent GameObject by this.gameObject accessor and GameObject's Transform by this.transform in GameObject context.

 

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...