Crates.io | moonshine-core |
lib.rs | moonshine-core |
version | |
source | src |
created_at | 2024-05-04 23:36:24.81588 |
updated_at | 2024-11-30 01:59:26.013674 |
description | Unconventional framework for making games in Bevy |
homepage | https://github.com/Zeenobit/moonshine_core |
repository | https://github.com/Zeenobit/moonshine_core |
max_upload_size | |
id | 1229907 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Unconventional cocktail of libraries to make ECS-driven development easier and safer in Bevy.
See individual crates for detailed documentation and examples.
Type safety solution for Bevy entities:
use bevy::prelude::*;
use moonshine_core::prelude::*;
#[derive(Component)]
struct Fruit;
#[derive(Component)]
struct FruitBasket {
fruits: Vec<Instance<Fruit>>
}
Ergonomic wrapper for managing complex enttiy hierarchies:
use bevy::prelude::*;
use moonshine_core::prelude::*;
#[derive(Component)]
struct Bird;
#[derive(Component)]
struct Flying;
fn setup_bird(birds: Objects<Bird, Added<Flying>>, mut commands: Commands) {
for bird in birds.iter() {
if let Some(wings) = bird.find_by_path("./Wings") {
for wing in wings.children() {
// TODO: Flap! Flap!
}
}
}
}
Save/Load framework for managing persistent game state:
use bevy::prelude::*;
use moonshine_core::prelude::*;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins((SavePlugin, LoadPlugin))
.add_systems(PreUpdate, save_default().into_file("world.ron").run_if(should_save))
.add_systems(PreUpdate, load_from_file("world.ron").run_if(should_load))
.run();
}
fn should_save(key: Res<ButtonInput<KeyCode>>) -> bool {
key.just_pressed(KeyCode::KeyS)
}
fn should_load(key: Res<ButtonInput<KeyCode>>) -> bool {
key.just_pressed(KeyCode::KeyL)
}
Tools for spawning entity hierarchies witout systems:
use bevy::prelude::*;
use moonshine_spawn::prelude::*;
fn chicken() -> impl Bundle {
Chicken.with_children(|chicken| {
chicken.spawn(ChickenHead);
})
}
#[derive(Component)]
struct Chicken;
#[derive(Component)]
struct ChickenHead;
Collection of generic utilities for improved safety, diagnostics, and ergonomics.
Please post an issue for any bugs, questions, or suggestions.
You may also contact me on the official Bevy Discord server as @Zeenobit.