https://github.com/payload/bitworks
https://github.com/payload/bitworks
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/payload/bitworks
- Owner: payload
- License: mit
- Created: 2021-07-07T07:27:07.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-14T09:05:32.000Z (almost 4 years ago)
- Last Synced: 2025-02-10T09:12:01.112Z (4 months ago)
- Language: Rust
- Size: 712 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bitworks
## How to run and build things
Create assets by running `assets-generator`.
```cargo run --bin assets-generator bitworks/assets```
Run the main executable `bitworks` to run a current demo.
Probably is is starting as paused and you need to press a key to unpause.
Try it `Enter` or `Space`. Exit with `ESC`.```cargo run --bin bitworks```
There are other executables in this repository too.
They are usually experiments.## System overview
Sprites are created with a tool using `tiny-skia` to draw simple 2D shapes
and save them to PNG.Bitworks is a executable (`main.rs`) and a library (`lib.rs`).
The library exports all the modules public symbols but also bundles related things together in plugins.
The executable than adds the plugins to the bevy App and a bunch of less stable systems.
The executable also implements systems, usually those which are for debugging, drawing, user interaction and all this experimental things I am currently working on.Usually functions, traits and structs are weakly organised.
Extension traits for bevy and other dependency types are for convinience.
They may be worth a PR to the respective dependency, or not.Systems are usually complex and not only consist of a single system function but multiple
and some structs and components.`belt_advance_items` was kind of complicated to implement.
It deals with advancing items on belts and through item inputs into buildings and item outputs onto belts.
`map_cache` is quite useful. It allows to organise entities on a grid, look up by integer coordinates.
Probably gonna use that in the future too but have separate map caches for different entity types.
`belt_input_output_hookup` uses map cache to connect belt and building inputs with outputs.
In conjunction with `simple_spawner` this helps and spawning some connected buildings and belts.`assets` for now can keep some loading and organising assets systems and resources.
`camera` contains some spawn and configuration helpers for static and interactive cameras.
The default orbit camera can be used with mouse right drag, wheel and move while holding CTRL.`config` has the type definitions for the single config file `config.ron`.