Skip to content

coilysiren/galaxy-gen

Repository files navigation

galaxy-gen

{ rust => wasm => js } galaxy generation simulation

previous verison, written in python

commands

  • $ make install
  • $ make dev
  • see makefile for others

infrastructure

  • ./src/rust/ is the rust backend, with wasm-bindgen decorators. the first build stage runs rust tests via cargo test
  • ./pkg/ is created via wasm-pack, which compiles the rust code to wasm + js + typescript
  • ./src/js/ imports ./pkg/ and runs js tests via npm test
  • ./dist/ is created via webpack, which compiles everything mentioned above + angular
  • http://galaxygen.coilysiren.me is updated via heroku with the compiled code

Note: the compiled folders aren't present on the default branch. Go to { branch: deploy } to view them.

code

rust

rust/* contains the rust logic, wrapped in calls to wasm-bindgen to provide a js api

the files there are compiled to galaxy_gen_backend as wasm + js

rust files

galaxy.rs represents the proxy of a real life Galaxy, like a spiral or ring.

cell.rs represents a unit of space within a galaxy, and holds all of the identifying information about that unit of space. The galactic terrain is composed of (a variable language quantity of) cells, and come in two types: generic gas clouds and star systems.

js

src/js/* handles rendering the data created by the rust backend

The wasm + js apis are loaded into the main application typescript via async imports

About

{ rust => wasm => js } galaxy generation simulation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published