Git Product home page Git Product logo

whitestorm.js's Introduction

           

<p align="center"><i><b>Framework for developing 3D web apps. <a href="https://raw.githubusercontent.com/WhitestormJS/whitestorm.js/cece6dacfbbc7ee158ca86b782521da65c44c6e7/build/whitestorm.js" download>Physics version</a><sup>[2.86 Mb]</sup> | <a href="https://raw.githubusercontent.com/WhitestormJS/whitestorm.js/dev/build/whitestorm.light.js" download>Light version</a><sup>[1.00 Mb]</sup>(no physics engine).</b></i></p>
<p align="center"><b>*</b>Made <b>by people</b> who want to create <b>awesome</b> browser games</p>



PLAYGROUND 🚀

GAME EXAMPLE 🎮

INSTALLATION ⤬ USAGE

NODE

npm install whitestormjs

BOWER

bower install whitestormjs

BROWSER

Include a script tag linking the WhitestormJS library in your head or after your body:

<script src="{path_to_lib}/whitestorm.js"></script>

After adding the library, you can configure your app.

WEBPACK

See WhitestormJS/test-whitestorm-webpack for more details.

DEVELOPING AN APP/GAME

const world = new WHS.World({
    stats: "fps", // fps, ms, mb or false if not need.
    autoresize: true,

    gravity: { // Physic gravity.
        x: 0,
        y: -100,
        z: 0
    },
    
    camera: {
      z: 50 // Move camera.
    }
});

const sphere = new WHS.Sphere({ // Create sphere comonent.
  geometry: {
    radius: 3
  },

  mass: 10, // Mass of physics object.

  material: {
    color: 0xffffff,
    kind: 'basic'
  },

  pos: {
    x: 0,
    y: 100,
    z: 0
  }
});

sphere.addTo(world);
sphere.getNative(); // Returns THREE.Mesh of this object.

world.start(); // Start animations and physics simulation.

DEVELOPING A COMPONENT

import * as THREE from 'three';

// Basic component class.
import {Component} from 'whitestormjs/core/Component';
// Decorator for THREE.Mesh for component class.
import MeshComponent from 'whitestormjs/core/MeshComponent';
// Some utils that should help.
import {extend, loadMaterial} from 'whitestormjs/utils/index';

@MeshComponent
class BasicSphere extends Component {
  constructor(params = {}) {
    super(params, BasicSphere.defaults);

    extend(params, {
      myParameter: 10 // Default for myParameter. (Sphere radius)
    });

    if (params.build) { // params.build is "true" by default. (@MeshComponent)
      this.build(params);
      // Apply position & rotation, scale ...
      super.wrap();
    }
  }

  build(params = {}) {
    // Load THREE.Material from properties.
    const material = loadMaterial(params.material);

    return new Promise((resolve) => {
      this.native = new THREE.Mesh(
        new THREE.SphereGeometry(params.myParameter, 16, 16),
        material
      );

      resolve();
    });
  }

  clone() {
    return new Sphere({build: false}).copy(this);
  }
}

export {
  BasicSphere
};

FEATURES

  • Simple shape crafting — We use a JSON-like structure for creating objects from inputted data and adding them to your 3D world.

  • Physics with WebWorkers — We use the Physi.js library for calculating physics of 3D shapes with WebWorkers technology that allows for rendering and calculating physics in multiple threads.

  • Plugin system — Our framework supports plugins & components made by other users. You need to include them after whitestorm.js and follow provided instructions.

  • Automatization of rendering — Our framework does rendering automatically and doesn't need a to be called. Functionality like the resize function can be called automatically by setting additional parameters such as autoresize: true.

  • ES6 Features - Our framework is written using the latest features of ECMAScript 6 and ECMAScript 7 (beta) features and compiled with Babel.

  • Softbodies - WhitestormJS is the only engine (except native ammo.js) that supports softbodies.


👾 BASIC:

💎 DESIGN:

🏂 FIRST-PERSON:

  • FPS / Shooter (First person example with Wagner effects and terrain. + fog) [TODO]
  • FPS / Fog (First person game with animated objects) [TODO]

🎳 PHYSICS:

🚀 PERFORMANCE:



Author Contributor Contributor Contributor Contributor Contributor Contributor Contributor Contributor


forthebadge

whitestorm.js's People

Contributors

bdirl avatar brunocascio avatar electron0zero avatar jackdalton avatar jackdalton2 avatar noctisdark avatar preco21 avatar sasha240100 avatar t4r0 avatar taro-0 avatar typedef42 avatar yeliex avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.