nesbox_utils

Crates.ionesbox_utils
lib.rsnesbox_utils
version0.0.3
sourcesrc
created_at2023-03-28 15:26:21.120022
updated_at2023-04-11 17:20:24.937332
descriptionQuickly develop NESBox games
homepage
repository
max_upload_size
id823174
size28,048
mantou (mantou132)

documentation

README

nesbox_utils

A utils functional for developing games for the NESBox

Example

use nesbox_utils::prelude::*;

fn global_handle(input: Res<ButtonInput>, mut next: ResMut<NextState<AppState>>) {
    if input.get_input(Player::One).just_pressed(Button::Reset) {
      log!("pressed reset button!");
    }
}

#[nesbox_bevy]
fn create_app() -> App {
    let mut app = create_bevy_app(256, 240, Color::default());

    let mut assets_resource = app.world.get_resource_mut::<AssetsResource>().unwrap();
    assets_resource.load_audio("select", decode_qoi_frame(include_bytes!("../assets/select-an-item.mp3.data")));

    app.add_state::<AppState>().add_system(global_handle);

    app
}
Commit count: 0

cargo fmt