Sign in to follow this  
Prozi

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

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.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.