bevy_logic
A logic gate simulation plugin for bevy
.
Features
- A
LogicGraph
resource for sorting (potentially cyclic) logic gate circuits. - A separate
LogicUpdate
schedule with a fixed timestep. LogicGate
trait queries.World
andCommands
extensions for spawning and removing logic gates and child fans.- Events for
LogicGraph
simulation synchronization. - Modular plugin design. Pick and choose the features you need.
Running examples
cargo run --release --example 3d
Custom logic gates
You can create your own logic gates by implementing the LogicGate
trait...
use *;
/// The XOR gate emits a signal if the number of true inputs is odd.
;
And then registering the component with bevy_trait_query
...
;
You can use the logic::commands
module to spawn gates and fans,
and then connect fans with wires.
Bevy Compatibility
bevy |
bevy_logic |
---|---|
0.13 | 0.1.1 |