1 unstable release

0.0.0 Feb 3, 2024

#24 in #entity-component

MIT license

100KB
2K SLoC

Fast, simple network layer for Entity-Component Systems

Dolphin

Echo-D (rs)

Distributed Entity-Component network protocol for Rust

MIT License

WIP! The Rust implementation is coming soon...

Installation

Install Echo-D with cargo

  cargo install echo-d

Basic Usage

Here is an example snippet that shows the basic usage of Echo-D:

use log::info;
use crate:echo-d::{Handler, Context, Options}

const context = new Context({
  // events
});

fn responder(data) => {
  otherEchoD.many(data)
}

fn onUpdate() {
  // events.emit('update')
}

const options = new Options({
  responder: responder,
  onUpdate: onUpdate,
});

const echoD = new EchoD(context, options);

echoD.spawnActor('actor')

const input = Input { type: 'jump' }
echoD.actorInput('actor', input)

echoD.spawnEntity('entity')
echoD.upsertComponent('entity', 'component', 'value')

fn onUpdated() {
  info!('update finished');
}

const update = echoD.updater()
update.then(onUpdated)

Documentation

Please refer to the documentation for more detailed information:

Documentation

Development Guide

Echo-D (rs) is developed and tested for rust. It is required to have rust installed for development.

Building WASM

To build a WASM module, run the following command:

  # TODO

Running Tests

To run tests, run the following command:

  # TODO

Dependencies

~1.1–2MB
~43K SLoC