#bevy #bevy-ecs #ecs #framework #unconventional #moonshine

moonshine-core

Unconventional framework for making games in Bevy

4 releases

0.2.0 Jul 21, 2024
0.1.2 Jul 5, 2024
0.1.1 May 5, 2024
0.1.0 May 4, 2024

#2403 in Game dev

Download history 1/week @ 2024-06-28 137/week @ 2024-07-05 4/week @ 2024-07-12 138/week @ 2024-07-19 30/week @ 2024-07-26 1/week @ 2024-08-02 28/week @ 2024-09-13 22/week @ 2024-09-20 6/week @ 2024-09-27 1/week @ 2024-10-04

57 downloads per month
Used in moonshine-view

MIT license

9KB

🍸 Moonshine Core

Unconventional cocktail of libraries to make ECS-driven development easier and safer in Bevy.

See individual crates for detailed documentation and examples.

🍎 Moonshine Kind

crates.io downloads docs.rs license stars

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>>
}

🌴 Moonshine Object

crates.io downloads docs.rs license stars

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!
            }
        }
    }
}

💾 Moonshine Save

crates.io downloads docs.rs license stars

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)
}

🥚 Moonshine Spawn

crates.io downloads docs.rs license stars

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;

🛠️ Moonshine Utilities

Collection of generic utilities for improved safety, diagnostics, and ergonomics.

crates.io downloads docs.rs license stars

Support

Please post an issue for any bugs, questions, or suggestions.

You may also contact me on the official Bevy Discord server as @Zeenobit.

Dependencies

~17–51MB
~888K SLoC