Taro

A lightweight 3D game engine for the web.

README


GIF

A lightweight 3D game engine for the web. Built with three.js and cannon-es.

⚛️ Physics - Full integration with a 3D rigid-body physics engine.
🔌 Entity Component System - Write efficent and extendable code.
🔊 Sound - 3D positional sounds built on the Web Audio API.
📜 Scripts - Design game behaviors in JavaScript.
⚡ Performance - Taro is a thin framework on top of three.js.

Documentation


You can find the Taro documentation on the website.

Usage


There are several examples on the website. Here is an example to get started:
  1. ``` js
  2. var app = new TARO.App();
  3. document.body.appendChild( app.domElement );

  4. var scene = new TARO.Scene();
  5. app.setScene(scene);

  6. class CubeController {
  7.   init() {
  8.     // fires when the component is attached to an entity
  9.     this.rotation = this.entity.rotation;
  10.   }

  11.   update() {
  12.     // fires once per frame
  13.     this.rotation.x += 0.01;
  14.     this.rotation.y += 0.01;
  15.   }
  16. }

  17. TARO.registerComponent('cubeController', CubeController);

  18. var cube = new TARO.Entity('cube');
  19. cube.addComponent('material', { color: 0x00ff00 });
  20. cube.addComponent('geometry', { type: 'box' });
  21. cube.addComponent('cubeController');

  22. var camera = new TARO.Entity('camera');
  23. camera.position.z = 5;
  24. camera.addComponent('camera');

  25. app.start();
  26. ```

This example will display a spinning cube on the canvas.

Builds


* (ESM)* (UMD)* (UMD minified)

Editor


In addition to the engine, there is a visual editor available to get a taste of Taro.

License