SkillAgentSearch skills...

Moirai

:black_joker: React.js game engine. Exciting, experimental and unstable

Install / Use

/learn @frostney/Moirai
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

moirai

Dependency Status devDependency Status

React.js game engine. Exciting, experimental and unstable.

moirai borrows a lot of ideas from Lyria.

What does it look like?

Let's create a game:

import React, {Component} from 'react';
import ReactDOM from 'react-dom';

import {Viewport, SceneDirector, Scene, GameObject} from 'moirai';

const updateFn = function(dt, gameObject) {
  gameObject.setState({x: gameObject.state.x += (dt * 10)});
};

const Game = () => (
  <Viewport>
    <SceneDirector>
      <Scene>
        <GameObject initialX={10} initialY={10} />
          <Texture source="hero.png" />
          <Behavior
            onUpdate={updateFn} />
        <GameObject />
      </Scene>
    </SceneDirector>
  </Viewport>
);

ReactDOM.render(<Game />, document.getElementById('container'));

This game engine is heavily inspired by React Router.

Philosophy

  • Thin layer on top of React.js

License

Public domain (UNLICENSE). If that does not work for you, you are allowed to license it under the terms of the MIT license.

View on GitHub
GitHub Stars46
CategoryDevelopment
Updated1y ago
Forks5

Languages

JavaScript

Security Score

60/100

Audited on Sep 2, 2024

No findings